summaryrefslogtreecommitdiff
path: root/firmware/target/arm/debug-pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/debug-pp.c')
-rw-r--r--firmware/target/arm/debug-pp.c117
1 files changed, 0 insertions, 117 deletions
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}