diff options
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/imx31/debug-imx31.c | 91 | ||||
-rw-r--r-- | firmware/target/arm/imx31/debug-target.h | 24 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/system-target.h | 3 |
3 files changed, 115 insertions, 3 deletions
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c new file mode 100644 index 0000000000..ab8db78063 --- /dev/null +++ b/firmware/target/arm/imx31/debug-imx31.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Michael Sevakis | ||
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 | #include "config.h" | ||
20 | #include "system.h" | ||
21 | #include "string.h" | ||
22 | #include "button.h" | ||
23 | #include "lcd.h" | ||
24 | #include "sprintf.h" | ||
25 | #include "font.h" | ||
26 | #include "debug-target.h" | ||
27 | |||
28 | bool __dbg_hw_info(void) | ||
29 | { | ||
30 | return false; | ||
31 | } | ||
32 | |||
33 | bool __dbg_ports(void) | ||
34 | { | ||
35 | char buf[50]; | ||
36 | int line; | ||
37 | |||
38 | lcd_setmargins(0, 0); | ||
39 | lcd_clear_display(); | ||
40 | lcd_setfont(FONT_SYSFIXED); | ||
41 | |||
42 | while(1) | ||
43 | { | ||
44 | line = 0; | ||
45 | snprintf(buf, sizeof(buf), "[Ports and Registers]"); | ||
46 | lcd_puts(0, line++, buf); line++; | ||
47 | |||
48 | /* GPIO1 */ | ||
49 | snprintf(buf, sizeof(buf), "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR); | ||
50 | lcd_puts(0, line++, buf); | ||
51 | |||
52 | snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1); | ||
53 | lcd_puts(0, line++, buf); | ||
54 | |||
55 | snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR); | ||
56 | lcd_puts(0, line++, buf); | ||
57 | |||
58 | snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO1_ISR); | ||
59 | lcd_puts(0, line++, buf); line++; | ||
60 | |||
61 | /* GPIO2 */ | ||
62 | snprintf(buf, sizeof(buf), "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR); | ||
63 | lcd_puts(0, line++, buf); | ||
64 | |||
65 | snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1); | ||
66 | lcd_puts(0, line++, buf); | ||
67 | |||
68 | snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR); | ||
69 | lcd_puts(0, line++, buf); | ||
70 | |||
71 | snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO2_ISR); | ||
72 | lcd_puts(0, line++, buf); line++; | ||
73 | |||
74 | /* GPIO3 */ | ||
75 | snprintf(buf, sizeof(buf), "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR); | ||
76 | lcd_puts(0, line++, buf); | ||
77 | |||
78 | snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1); | ||
79 | lcd_puts(0, line++, buf); | ||
80 | |||
81 | snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR); | ||
82 | lcd_puts(0, line++, buf); | ||
83 | |||
84 | snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR); | ||
85 | lcd_puts(0, line++, buf); line++; | ||
86 | |||
87 | lcd_update(); | ||
88 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | ||
89 | return false; | ||
90 | } | ||
91 | } | ||
diff --git a/firmware/target/arm/imx31/debug-target.h b/firmware/target/arm/imx31/debug-target.h new file mode 100644 index 0000000000..5928e0c64b --- /dev/null +++ b/firmware/target/arm/imx31/debug-target.h | |||
@@ -0,0 +1,24 @@ | |||
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_BACK | ||
21 | bool __dbg_hw_info(void); | ||
22 | bool __dbg_ports(void); | ||
23 | |||
24 | |||
diff --git a/firmware/target/arm/imx31/gigabeat-s/system-target.h b/firmware/target/arm/imx31/gigabeat-s/system-target.h index 8db0c78eb7..17f1593f62 100644 --- a/firmware/target/arm/imx31/gigabeat-s/system-target.h +++ b/firmware/target/arm/imx31/gigabeat-s/system-target.h | |||
@@ -30,9 +30,6 @@ static inline void udelay(unsigned int usecs) | |||
30 | while ((signed int)EPITCNT1 > stop); | 30 | while ((signed int)EPITCNT1 > stop); |
31 | } | 31 | } |
32 | 32 | ||
33 | #define __dbg_hw_info(...) 0 | ||
34 | #define __dbg_ports(...) 0 | ||
35 | |||
36 | void system_prepare_fw_start(void); | 33 | void system_prepare_fw_start(void); |
37 | void tick_stop(void); | 34 | void tick_stop(void); |
38 | void kernel_device_init(void); | 35 | void kernel_device_init(void); |