summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-11 15:49:48 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-11 15:49:48 +0000
commit57742e0ef7736cbc5c568baf0f3adb0719e3ff7b (patch)
tree40d9c2a48d542d69c3ebb7a4968cf81cd00c71e5
parent97e61198a5f549db9dc882a01b2b272292bd2805 (diff)
downloadrockbox-57742e0ef7736cbc5c568baf0f3adb0719e3ff7b.tar.gz
rockbox-57742e0ef7736cbc5c568baf0f3adb0719e3ff7b.zip
Add a "View I/O Ports" screen for imx31. Show all GPIO contents.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17072 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/debug_menu.c6
-rw-r--r--firmware/SOURCES1
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c91
-rw-r--r--firmware/target/arm/imx31/debug-target.h24
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/system-target.h3
5 files changed, 120 insertions, 5 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index d2d30ab675..e167b1f329 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -94,7 +94,8 @@
94#include "pcf50605.h" 94#include "pcf50605.h"
95#endif 95#endif
96 96
97#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 97#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 \
98 || CONFIG_CPU == IMX31L
98#include "debug-target.h" 99#include "debug-target.h"
99#endif 100#endif
100 101
@@ -2407,7 +2408,8 @@ static const struct the_menu_item menuitems[] = {
2407 (defined(CPU_PP) && !(defined(SANSA_E200) || defined(SANSA_C200))) 2408 (defined(CPU_PP) && !(defined(SANSA_E200) || defined(SANSA_C200)))
2408 { "Dump ROM contents", dbg_save_roms }, 2409 { "Dump ROM contents", dbg_save_roms },
2409#endif 2410#endif
2410#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) || CONFIG_CPU == S3C2440 2411#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \
2412 || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L
2411 { "View I/O ports", dbg_ports }, 2413 { "View I/O ports", dbg_ports },
2412#endif 2414#endif
2413 #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) 2415 #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 6d32e63be5..8229fecca0 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -642,6 +642,7 @@ target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
642#ifndef SIMULATOR 642#ifndef SIMULATOR
643target/arm/lcd-as-memframe.S 643target/arm/lcd-as-memframe.S
644target/arm/mmu-arm.c 644target/arm/mmu-arm.c
645target/arm/imx31/debug-imx31.c
645target/arm/imx31/gigabeat-s/adc-imx31.c 646target/arm/imx31/gigabeat-s/adc-imx31.c
646target/arm/imx31/gigabeat-s/ata-imx31.c 647target/arm/imx31/gigabeat-s/ata-imx31.c
647target/arm/imx31/gigabeat-s/avic-imx31.c 648target/arm/imx31/gigabeat-s/avic-imx31.c
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
28bool __dbg_hw_info(void)
29{
30 return false;
31}
32
33bool __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
21bool __dbg_hw_info(void);
22bool __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
36void system_prepare_fw_start(void); 33void system_prepare_fw_start(void);
37void tick_stop(void); 34void tick_stop(void);
38void kernel_device_init(void); 35void kernel_device_init(void);