summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2008-02-17 17:58:56 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2008-02-17 17:58:56 +0000
commita999556e849884cbcfdf932d88eb738fcb614a91 (patch)
treea1e8ca5a0783fa73c229a8d11ee273fe4961c405
parentd085ead3ba6f437ab9be3167d820509f49e36e31 (diff)
downloadrockbox-a999556e849884cbcfdf932d88eb738fcb614a91.tar.gz
rockbox-a999556e849884cbcfdf932d88eb738fcb614a91.zip
revert my work, suggested by amiconn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16328 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/debug_menu.c68
-rw-r--r--firmware/target/arm/debug-pp.c117
-rw-r--r--firmware/target/arm/debug-target.h35
3 files changed, 67 insertions, 153 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 1cedaf2b9b..b3df043609 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -92,7 +92,7 @@
92#include "pcf50605.h" 92#include "pcf50605.h"
93#endif 93#endif
94 94
95#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 || defined(CPU_PP) 95#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801
96#include "debug-target.h" 96#include "debug-target.h"
97#endif 97#endif
98 98
@@ -562,6 +562,72 @@ static bool dbg_hw_info(void)
562 lcd_update(); 562 lcd_update();
563 563
564 while (!(action_userabort(TIMEOUT_BLOCK))); 564 while (!(action_userabort(TIMEOUT_BLOCK)));
565
566#elif defined(CPU_PP502x)
567 int line = 0;
568 char buf[32];
569 char pp_version[] = { (PP_VER2 >> 24) & 0xff, (PP_VER2 >> 16) & 0xff,
570 (PP_VER2 >> 8) & 0xff, (PP_VER2) & 0xff,
571 (PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff,
572 (PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' };
573
574 lcd_setmargins(0, 0);
575 lcd_setfont(FONT_SYSFIXED);
576 lcd_clear_display();
577
578 lcd_puts(0, line++, "[Hardware info]");
579
580#ifdef IPOD_ARCH
581 snprintf(buf, sizeof(buf), "HW rev: 0x%08lx", IPOD_HW_REVISION);
582 lcd_puts(0, line++, buf);
583#endif
584
585#ifdef IPOD_COLOR
586 extern int lcd_type; /* Defined in lcd-colornano.c */
587
588 snprintf(buf, sizeof(buf), "LCD type: %d", lcd_type);
589 lcd_puts(0, line++, buf);
590#endif
591
592 snprintf(buf, sizeof(buf), "PP version: %s", pp_version);
593 lcd_puts(0, line++, buf);
594
595 snprintf(buf, sizeof(buf), "Est. clock (kHz): %d", perfcheck());
596 lcd_puts(0, line++, buf);
597
598 lcd_update();
599
600 while (!(action_userabort(TIMEOUT_BLOCK)));
601
602#elif CONFIG_CPU == PP5002
603 int line = 0;
604 char buf[32];
605 char pp_version[] = { (PP_VER4 >> 8) & 0xff, PP_VER4 & 0xff,
606 (PP_VER3 >> 8) & 0xff, PP_VER3 & 0xff,
607 (PP_VER2 >> 8) & 0xff, PP_VER2 & 0xff,
608 (PP_VER1 >> 8) & 0xff, PP_VER1 & 0xff, '\0' };
609
610
611 lcd_setmargins(0, 0);
612 lcd_setfont(FONT_SYSFIXED);
613 lcd_clear_display();
614
615 lcd_puts(0, line++, "[Hardware info]");
616
617#ifdef IPOD_ARCH
618 snprintf(buf, sizeof(buf), "HW rev: 0x%08lx", IPOD_HW_REVISION);
619 lcd_puts(0, line++, buf);
620#endif
621
622 snprintf(buf, sizeof(buf), "PP version: %s", pp_version);
623 lcd_puts(0, line++, buf);
624
625 snprintf(buf, sizeof(buf), "Est. clock (kHz): %d", perfcheck());
626 lcd_puts(0, line++, buf);
627
628 lcd_update();
629
630 while (!(action_userabort(TIMEOUT_BLOCK)));
565#else 631#else
566 /* Define this function in your target tree */ 632 /* Define this function in your target tree */
567 return __dbg_hw_info(); 633 return __dbg_hw_info();
diff --git a/firmware/target/arm/debug-pp.c b/firmware/target/arm/debug-pp.c
deleted file mode 100644
index 7e4537ad71..0000000000
--- a/firmware/target/arm/debug-pp.c
+++ /dev/null
@@ -1,117 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: debug-tcc780x.c 16316 2008-02-15 12:37:36Z christian $
9 *
10 * Copyright (C) 2002 Heikki Hannikainen
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 "system.h"
22#include "string.h"
23#include <stdbool.h>
24#include "button.h"
25#include "lcd.h"
26#include "sprintf.h"
27#include "font.h"
28#include "debug-target.h"
29
30#ifdef IPOD_ARCH
31#include "hwcompat.h" /* needed for IPOD_HW_REVISION */
32#endif
33
34static int perfcheck(void)
35{
36 int result;
37
38 asm (
39 "mrs r2, CPSR \n"
40 "orr r0, r2, #0xc0 \n" /* disable IRQ and FIQ */
41 "msr CPSR_c, r0 \n"
42 "mov %[res], #0 \n"
43 "ldr r0, [%[timr]] \n"
44 "add r0, r0, %[tmo] \n"
45 "1: \n"
46 "add %[res], %[res], #1 \n"
47 "ldr r1, [%[timr]] \n"
48 "cmp r1, r0 \n"
49 "bmi 1b \n"
50 "msr CPSR_c, r2 \n" /* reset IRQ and FIQ state */
51 :
52 [res]"=&r"(result)
53 :
54 [timr]"r"(&USEC_TIMER),
55 [tmo]"r"(
56#if CONFIG_CPU == PP5002
57 16000
58#else /* PP5020/5022/5024 */
59 10226
60#endif
61 )
62 :
63 "r0", "r1", "r2"
64 );
65 return result;
66}
67
68bool __dbg_hw_info(void)
69{
70 int line = 0;
71 char buf[32];
72
73#if defined(CPU_PP502x)
74 char pp_version[] = { (PP_VER2 >> 24) & 0xff, (PP_VER2 >> 16) & 0xff,
75 (PP_VER2 >> 8) & 0xff, (PP_VER2) & 0xff,
76 (PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff,
77 (PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' };
78
79#elif CONFIG_CPU == PP5002
80 char pp_version[] = { (PP_VER4 >> 8) & 0xff, PP_VER4 & 0xff,
81 (PP_VER3 >> 8) & 0xff, PP_VER3 & 0xff,
82 (PP_VER2 >> 8) & 0xff, PP_VER2 & 0xff,
83 (PP_VER1 >> 8) & 0xff, PP_VER1 & 0xff, '\0' };
84#endif
85
86 lcd_setmargins(0, 0);
87 lcd_setfont(FONT_SYSFIXED);
88 lcd_clear_display();
89
90 lcd_puts(0, line++, "[Hardware info]");
91
92#ifdef IPOD_ARCH
93 snprintf(buf, sizeof(buf), "HW rev: 0x%08lx", IPOD_HW_REVISION);
94 lcd_puts(0, line++, buf);
95#endif
96
97#ifdef IPOD_COLOR
98 extern int lcd_type; /* Defined in lcd-colornano.c */
99
100 snprintf(buf, sizeof(buf), "LCD type: %d", lcd_type);
101 lcd_puts(0, line++, buf);
102#endif
103
104 snprintf(buf, sizeof(buf), "PP version: %s", pp_version);
105 lcd_puts(0, line++, buf);
106
107 snprintf(buf, sizeof(buf), "Est. clock (kHz): %d", perfcheck());
108 lcd_puts(0, line++, buf);
109
110 lcd_update();
111
112 while (1) {
113 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) {
114 return false;
115 }
116 }
117}
diff --git a/firmware/target/arm/debug-target.h b/firmware/target/arm/debug-target.h
deleted file mode 100644
index eced9d5a95..0000000000
--- a/firmware/target/arm/debug-target.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: debug-tcc780x.c 16316 2008-02-15 12:37:36Z christian $
9 *
10 * Copyright (C) 2002 Heikki Hannikainen
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/* key definitions */
21#if (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \
22 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
23 (CONFIG_KEYPAD == IPOD_4G_PAD)
24# define DEBUG_CANCEL BUTTON_MENU
25
26#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
27 (CONFIG_KEYPAD == MROBE100_PAD)
28# define DEBUG_CANCEL BUTTON_REW
29
30#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
31 (CONFIG_KEYPAD == SANSA_C200_PAD)
32# define DEBUG_CANCEL BUTTON_LEFT
33#endif
34
35bool __dbg_hw_info(void);