summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/debug_menu.c57
-rw-r--r--firmware/SOURCES1
-rwxr-xr-xfirmware/target/arm/s3c2440/debug-s3c2440.c85
-rwxr-xr-xfirmware/target/arm/s3c2440/debug-target.h23
-rwxr-xr-xfirmware/target/arm/tms320dm320/debug-dm320.c5
-rwxr-xr-xfirmware/target/arm/tms320dm320/debug-target.h1
6 files changed, 119 insertions, 53 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 576d01d336..f343ce6c78 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -88,7 +88,7 @@
88#endif 88#endif
89#include "hwcompat.h" 89#include "hwcompat.h"
90 90
91#if CONFIG_CPU == DM320 91#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440
92#include "debug-target.h" 92#include "debug-target.h"
93#endif 93#endif
94 94
@@ -984,16 +984,13 @@ static bool dbg_spdif(void)
984#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD 984#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
985# define DEBUG_CANCEL BUTTON_REC 985# define DEBUG_CANCEL BUTTON_REC
986 986
987#elif CONFIG_KEYPAD == GIGABEAT_PAD
988# define DEBUG_CANCEL BUTTON_A
989
990#elif CONFIG_KEYPAD == IRIVER_H10_PAD 987#elif CONFIG_KEYPAD == IRIVER_H10_PAD
991# define DEBUG_CANCEL BUTTON_REW 988# define DEBUG_CANCEL BUTTON_REW
992 989
993#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ 990#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
994 (CONFIG_KEYPAD == SANSA_C200_PAD) 991 (CONFIG_KEYPAD == SANSA_C200_PAD)
995# define DEBUG_CANCEL BUTTON_LEFT 992# define DEBUG_CANCEL BUTTON_LEFT
996#endif /* key definitios */ 993#endif /* key definitions */
997 994
998/* Test code!!! */ 995/* Test code!!! */
999bool dbg_ports(void) 996bool dbg_ports(void)
@@ -1265,54 +1262,8 @@ bool dbg_ports(void)
1265 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) 1262 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
1266 return false; 1263 return false;
1267 } 1264 }
1268#elif CONFIG_CPU == S3C2440 1265#else
1269 char buf[50]; 1266 return __dbg_ports();
1270 int line;
1271
1272 lcd_setmargins(0, 0);
1273 lcd_clear_display();
1274 lcd_setfont(FONT_SYSFIXED);
1275
1276 while(1)
1277 {
1278 line = 0;
1279 snprintf(buf, sizeof(buf), "[Ports and Registers]"); lcd_puts(0, line++, buf);
1280
1281 snprintf(buf, sizeof(buf), "GPACON: %08x GPBCON: %08x", GPACON, GPBCON); lcd_puts(0, line++, buf);
1282 snprintf(buf, sizeof(buf), "GPADAT: %08x GPBDAT: %08x", GPADAT, GPBDAT); lcd_puts(0, line++, buf);
1283 snprintf(buf, sizeof(buf), "GPAUP: %08x GPBUP: %08x", 0, GPBUP); lcd_puts(0, line++, buf);
1284 snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf);
1285 snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf);
1286 snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf);
1287
1288 snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf);
1289 snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf);
1290 snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf);
1291
1292 snprintf(buf, sizeof(buf), "GPECON: %08x GPFCON: %08x", GPECON, GPFCON); lcd_puts(0, line++, buf);
1293 snprintf(buf, sizeof(buf), "GPEDAT: %08x GPFDAT: %08x", GPEDAT, GPFDAT); lcd_puts(0, line++, buf);
1294 snprintf(buf, sizeof(buf), "GPEUP: %08x GPFUP: %08x", GPEUP, GPFUP); lcd_puts(0, line++, buf);
1295
1296 snprintf(buf, sizeof(buf), "GPGCON: %08x GPHCON: %08x", GPGCON, GPHCON); lcd_puts(0, line++, buf);
1297 snprintf(buf, sizeof(buf), "GPGDAT: %08x GPHDAT: %08x", GPGDAT, GPHDAT); lcd_puts(0, line++, buf);
1298 snprintf(buf, sizeof(buf), "GPGUP: %08x GPHUP: %08x", GPGUP, GPHUP); lcd_puts(0, line++, buf);
1299
1300 snprintf(buf, sizeof(buf), "GPJCON: %08x", GPJCON); lcd_puts(0, line++, buf);
1301 snprintf(buf, sizeof(buf), "GPJDAT: %08x", GPJDAT); lcd_puts(0, line++, buf);
1302 snprintf(buf, sizeof(buf), "GPJUP: %08x", GPJUP); lcd_puts(0, line++, buf);
1303
1304 line++;
1305
1306 snprintf(buf, sizeof(buf), "SRCPND: %08x INTMOD: %08x", SRCPND, INTMOD); lcd_puts(0, line++, buf);
1307 snprintf(buf, sizeof(buf), "INTMSK: %08x INTPND: %08x", INTMSK, INTPND); lcd_puts(0, line++, buf);
1308 snprintf(buf, sizeof(buf), "CLKCON: %08x CLKSLOW: %08x", CLKCON, CLKSLOW); lcd_puts(0, line++, buf);
1309 snprintf(buf, sizeof(buf), "MPLLCON: %08x UPLLCON: %08x", MPLLCON, UPLLCON); lcd_puts(0, line++, buf);
1310 snprintf(buf, sizeof(buf), "CLKDIVN: %08x", CLKDIVN); lcd_puts(0, line++, buf);
1311
1312 lcd_update();
1313 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
1314 return false;
1315 }
1316#endif /* CPU */ 1267#endif /* CPU */
1317 return false; 1268 return false;
1318} 1269}
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 29e30804b5..e78d74a198 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -584,6 +584,7 @@ target/arm/usb-fw-pp502x.c
584#ifndef SIMULATOR 584#ifndef SIMULATOR
585target/arm/lcd-as-memframe.S 585target/arm/lcd-as-memframe.S
586target/arm/mmu-arm.c 586target/arm/mmu-arm.c
587target/arm/s3c2440/debug-s3c2440.c
587target/arm/s3c2440/gigabeat-fx/adc-meg-fx.c 588target/arm/s3c2440/gigabeat-fx/adc-meg-fx.c
588target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c 589target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c
589target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c 590target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c
new file mode 100755
index 0000000000..23aa75ea38
--- /dev/null
+++ b/firmware/target/arm/s3c2440/debug-s3c2440.c
@@ -0,0 +1,85 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include "cpu.h"
22#include "system.h"
23#include "string.h"
24#include <stdbool.h>
25#include "button.h"
26#include "lcd.h"
27#include "sprintf.h"
28#include "font.h"
29#include "debug-target.h"
30
31bool __dbg_hw_info(void)
32{
33 return false;
34}
35
36bool __dbg_ports(void)
37{
38 char buf[50];
39 int line;
40
41 lcd_setmargins(0, 0);
42 lcd_clear_display();
43 lcd_setfont(FONT_SYSFIXED);
44
45 while(1)
46 {
47 line = 0;
48 snprintf(buf, sizeof(buf), "[Ports and Registers]"); lcd_puts(0, line++, buf);
49
50 snprintf(buf, sizeof(buf), "GPACON: %08x GPBCON: %08x", GPACON, GPBCON); lcd_puts(0, line++, buf);
51 snprintf(buf, sizeof(buf), "GPADAT: %08x GPBDAT: %08x", GPADAT, GPBDAT); lcd_puts(0, line++, buf);
52 snprintf(buf, sizeof(buf), "GPAUP: %08x GPBUP: %08x", 0, GPBUP); lcd_puts(0, line++, buf);
53 snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf);
54 snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf);
55 snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf);
56
57 snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf);
58 snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf);
59 snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf);
60
61 snprintf(buf, sizeof(buf), "GPECON: %08x GPFCON: %08x", GPECON, GPFCON); lcd_puts(0, line++, buf);
62 snprintf(buf, sizeof(buf), "GPEDAT: %08x GPFDAT: %08x", GPEDAT, GPFDAT); lcd_puts(0, line++, buf);
63 snprintf(buf, sizeof(buf), "GPEUP: %08x GPFUP: %08x", GPEUP, GPFUP); lcd_puts(0, line++, buf);
64
65 snprintf(buf, sizeof(buf), "GPGCON: %08x GPHCON: %08x", GPGCON, GPHCON); lcd_puts(0, line++, buf);
66 snprintf(buf, sizeof(buf), "GPGDAT: %08x GPHDAT: %08x", GPGDAT, GPHDAT); lcd_puts(0, line++, buf);
67 snprintf(buf, sizeof(buf), "GPGUP: %08x GPHUP: %08x", GPGUP, GPHUP); lcd_puts(0, line++, buf);
68
69 snprintf(buf, sizeof(buf), "GPJCON: %08x", GPJCON); lcd_puts(0, line++, buf);
70 snprintf(buf, sizeof(buf), "GPJDAT: %08x", GPJDAT); lcd_puts(0, line++, buf);
71 snprintf(buf, sizeof(buf), "GPJUP: %08x", GPJUP); lcd_puts(0, line++, buf);
72
73 line++;
74
75 snprintf(buf, sizeof(buf), "SRCPND: %08x INTMOD: %08x", SRCPND, INTMOD); lcd_puts(0, line++, buf);
76 snprintf(buf, sizeof(buf), "INTMSK: %08x INTPND: %08x", INTMSK, INTPND); lcd_puts(0, line++, buf);
77 snprintf(buf, sizeof(buf), "CLKCON: %08x CLKSLOW: %08x", CLKCON, CLKSLOW); lcd_puts(0, line++, buf);
78 snprintf(buf, sizeof(buf), "MPLLCON: %08x UPLLCON: %08x", MPLLCON, UPLLCON); lcd_puts(0, line++, buf);
79 snprintf(buf, sizeof(buf), "CLKDIVN: %08x", CLKDIVN); lcd_puts(0, line++, buf);
80
81 lcd_update();
82 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
83 return false;
84 }
85}
diff --git a/firmware/target/arm/s3c2440/debug-target.h b/firmware/target/arm/s3c2440/debug-target.h
new file mode 100755
index 0000000000..45eccd3be4
--- /dev/null
+++ b/firmware/target/arm/s3c2440/debug-target.h
@@ -0,0 +1,23 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#define DEBUG_CANCEL BUTTON_A
21bool __dbg_hw_info(void);
22bool __dbg_ports(void);
23
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c
index d2dce118c5..417dfee961 100755
--- a/firmware/target/arm/tms320dm320/debug-dm320.c
+++ b/firmware/target/arm/tms320dm320/debug-dm320.c
@@ -28,6 +28,11 @@
28#include "font.h" 28#include "font.h"
29#include "debug-target.h" 29#include "debug-target.h"
30 30
31bool __dbg_ports(void)
32{
33 return false;
34}
35
31bool __dbg_hw_info(void) 36bool __dbg_hw_info(void)
32{ 37{
33 int line = 0, button; 38 int line = 0, button;
diff --git a/firmware/target/arm/tms320dm320/debug-target.h b/firmware/target/arm/tms320dm320/debug-target.h
index 3c34c3125e..399ed32f4a 100755
--- a/firmware/target/arm/tms320dm320/debug-target.h
+++ b/firmware/target/arm/tms320dm320/debug-target.h
@@ -18,3 +18,4 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20bool __dbg_hw_info(void); 20bool __dbg_hw_info(void);
21bool __dbg_ports(void);