diff options
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/as3525/debug-as3525.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/as3525/debug-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/at91sam/lyre_proto1/debug-target.h | 4 | ||||
-rw-r--r-- | firmware/target/arm/debug-pp.c | 78 | ||||
-rw-r--r-- | firmware/target/arm/debug-target.h | 1 | ||||
-rw-r--r-- | firmware/target/arm/imx31/debug-imx31.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/debug-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/debug-s3c2440.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/debug-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/debug-s5l8700.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/debug-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tcc77x/debug-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tcc77x/debug-tcc77x.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/debug-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/debug-tcc780x.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/debug-dm320.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/debug-target.h | 2 |
18 files changed, 98 insertions, 19 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c index 513295edcb..d18f2d70b2 100644 --- a/firmware/target/arm/as3525/debug-as3525.c +++ b/firmware/target/arm/as3525/debug-as3525.c @@ -248,7 +248,7 @@ static int calc_freq(int clk) } } -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { int line; #if CONFIG_CPU == AS3525 diff --git a/firmware/target/arm/as3525/debug-target.h b/firmware/target/arm/as3525/debug-target.h index a9e43550a8..1359e6a00e 100644 --- a/firmware/target/arm/as3525/debug-target.h +++ b/firmware/target/arm/as3525/debug-target.h @@ -24,6 +24,6 @@ #include <stdbool.h> #define DEBUG_CANCEL BUTTON_LEFT -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); #endif diff --git a/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c index 54a262a9ff..5277afc348 100644 --- a/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c +++ b/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c @@ -23,12 +23,12 @@ #include <stdbool.h> #include "debug-target.h" -bool __dbg_ports(void) +bool dbg_ports(void) { return false; } -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { return false; } diff --git a/firmware/target/arm/at91sam/lyre_proto1/debug-target.h b/firmware/target/arm/at91sam/lyre_proto1/debug-target.h index 140feafe67..59dd58cb32 100644 --- a/firmware/target/arm/at91sam/lyre_proto1/debug-target.h +++ b/firmware/target/arm/at91sam/lyre_proto1/debug-target.h @@ -21,6 +21,6 @@ #include <stdbool.h> -bool __dbg_ports(void); -bool __dbg_hw_info(void); +bool dbg_ports(void); +bool dbg_hw_info(void); diff --git a/firmware/target/arm/debug-pp.c b/firmware/target/arm/debug-pp.c index 3b9250c0fb..080e0ed631 100644 --- a/firmware/target/arm/debug-pp.c +++ b/firmware/target/arm/debug-pp.c @@ -28,8 +28,43 @@ #include "powermgmt.h" #include "adc.h" #include "iap.h" +#include "hwcompat.h" #include "debug-target.h" +static int perfcheck(void) +{ + int result; + + asm ( + "mrs r2, CPSR \n" + "orr r0, r2, #0xc0 \n" /* disable IRQ and FIQ */ + "msr CPSR_c, r0 \n" + "mov %[res], #0 \n" + "ldr r0, [%[timr]] \n" + "add r0, r0, %[tmo] \n" + "1: \n" + "add %[res], %[res], #1 \n" + "ldr r1, [%[timr]] \n" + "cmp r1, r0 \n" + "bmi 1b \n" + "msr CPSR_c, r2 \n" /* reset IRQ and FIQ state */ + : + [res]"=&r"(result) + : + [timr]"r"(&USEC_TIMER), + [tmo]"r"( +#if CONFIG_CPU == PP5002 + 16000 +#else /* PP5020/5022/5024 */ + 10226 +#endif + ) + : + "r0", "r1", "r2" + ); + return result; +} + bool dbg_ports(void) { int line; @@ -152,3 +187,46 @@ bool dbg_ports(void) } return false; } + +bool dbg_hw_info(void) +{ + int line = 0; +#if defined(CPU_PP502x) + char pp_version[] = { (PP_VER2 >> 24) & 0xff, (PP_VER2 >> 16) & 0xff, + (PP_VER2 >> 8) & 0xff, (PP_VER2) & 0xff, + (PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff, + (PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' }; +#elif CONFIG_CPU == PP5002 + char pp_version[] = { (PP_VER4 >> 8) & 0xff, PP_VER4 & 0xff, + (PP_VER3 >> 8) & 0xff, PP_VER3 & 0xff, + (PP_VER2 >> 8) & 0xff, PP_VER2 & 0xff, + (PP_VER1 >> 8) & 0xff, PP_VER1 & 0xff, '\0' }; +#endif + + lcd_setfont(FONT_SYSFIXED); + lcd_clear_display(); + + lcd_puts(0, line++, "[Hardware info]"); + +#ifdef IPOD_ARCH + lcd_putsf(0, line++, "HW rev: 0x%08lx", IPOD_HW_REVISION); +#endif + +#ifdef IPOD_COLOR + extern int lcd_type; /* Defined in lcd-colornano.c */ + + lcd_putsf(0, line++, "LCD type: %d", lcd_type); +#endif + + lcd_putsf(0, line++, "PP version: %s", pp_version); + + lcd_putsf(0, line++, "Est. clock (kHz): %d", perfcheck()); + + lcd_update(); + + /* wait for exit */ + while (button_get_w_tmo(HZ/10) != (DEBUG_CANCEL|BUTTON_REL)); + + lcd_setfont(FONT_UI); + return false; +} diff --git a/firmware/target/arm/debug-target.h b/firmware/target/arm/debug-target.h index 4408acf5da..28f95327ad 100644 --- a/firmware/target/arm/debug-target.h +++ b/firmware/target/arm/debug-target.h @@ -47,3 +47,4 @@ # define DEBUG_CANCEL BUTTON_CANCEL #endif bool dbg_ports(void); +bool dbg_hw_info(void); diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c index f8dacbedd5..92884fe8aa 100644 --- a/firmware/target/arm/imx31/debug-imx31.c +++ b/firmware/target/arm/imx31/debug-imx31.c @@ -31,7 +31,7 @@ #include "dvfs_dptc-imx31.h" #include <stdio.h> -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { int line; unsigned int pllref; diff --git a/firmware/target/arm/imx31/debug-target.h b/firmware/target/arm/imx31/debug-target.h index ca02ab84de..25fd5d872b 100644 --- a/firmware/target/arm/imx31/debug-target.h +++ b/firmware/target/arm/imx31/debug-target.h @@ -22,7 +22,7 @@ #define DEBUG_TARGET_H #define DEBUG_CANCEL BUTTON_BACK -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); bool __dbg_dvfs_dptc(void); diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c index e552f12c2b..99ab8e4306 100644 --- a/firmware/target/arm/s3c2440/debug-s3c2440.c +++ b/firmware/target/arm/s3c2440/debug-s3c2440.c @@ -29,7 +29,7 @@ #include "font.h" #include "debug-target.h" -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { return false; } diff --git a/firmware/target/arm/s3c2440/debug-target.h b/firmware/target/arm/s3c2440/debug-target.h index dc274b9f06..9e83da6f48 100644 --- a/firmware/target/arm/s3c2440/debug-target.h +++ b/firmware/target/arm/s3c2440/debug-target.h @@ -25,6 +25,6 @@ #define DEBUG_CANCEL BUTTON_MENU #endif -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); diff --git a/firmware/target/arm/s5l8700/debug-s5l8700.c b/firmware/target/arm/s5l8700/debug-s5l8700.c index 28bb9b2050..3631a474ed 100644 --- a/firmware/target/arm/s5l8700/debug-s5l8700.c +++ b/firmware/target/arm/s5l8700/debug-s5l8700.c @@ -41,7 +41,7 @@ extern int lcd_type; extern uint32_t nand_type[4]; -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { int line; int i; @@ -127,7 +127,7 @@ bool __dbg_hw_info(void) } #else - _DEBUG_PRINTF("__dbg_hw_info"); + _DEBUG_PRINTF("dbg_hw_info"); #endif lcd_update(); diff --git a/firmware/target/arm/s5l8700/debug-target.h b/firmware/target/arm/s5l8700/debug-target.h index 351468fb50..95f2f94795 100644 --- a/firmware/target/arm/s5l8700/debug-target.h +++ b/firmware/target/arm/s5l8700/debug-target.h @@ -26,7 +26,7 @@ #define DEBUG_CANCEL BUTTON_MENU -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); #endif /* _DEBUG_TARGET_H_ */ diff --git a/firmware/target/arm/tcc77x/debug-target.h b/firmware/target/arm/tcc77x/debug-target.h index 6cf93cc5a4..c985751a23 100644 --- a/firmware/target/arm/tcc77x/debug-target.h +++ b/firmware/target/arm/tcc77x/debug-target.h @@ -19,6 +19,6 @@ * ****************************************************************************/ -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); diff --git a/firmware/target/arm/tcc77x/debug-tcc77x.c b/firmware/target/arm/tcc77x/debug-tcc77x.c index 88b0722a4e..250afb46c7 100644 --- a/firmware/target/arm/tcc77x/debug-tcc77x.c +++ b/firmware/target/arm/tcc77x/debug-tcc77x.c @@ -36,7 +36,7 @@ bool dbg_ports(void) return false; } -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { int line = 0, i, button, oldline; bool done=false; diff --git a/firmware/target/arm/tcc780x/debug-target.h b/firmware/target/arm/tcc780x/debug-target.h index 6cf93cc5a4..c985751a23 100644 --- a/firmware/target/arm/tcc780x/debug-target.h +++ b/firmware/target/arm/tcc780x/debug-target.h @@ -19,6 +19,6 @@ * ****************************************************************************/ -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); diff --git a/firmware/target/arm/tcc780x/debug-tcc780x.c b/firmware/target/arm/tcc780x/debug-tcc780x.c index d527e2b045..22de868639 100644 --- a/firmware/target/arm/tcc780x/debug-tcc780x.c +++ b/firmware/target/arm/tcc780x/debug-tcc780x.c @@ -40,7 +40,7 @@ bool dbg_ports(void) return false; } -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { int line = 0, i, oldline; diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c index 26f34a4f5f..de17d54843 100644 --- a/firmware/target/arm/tms320dm320/debug-dm320.c +++ b/firmware/target/arm/tms320dm320/debug-dm320.c @@ -121,7 +121,7 @@ bool dbg_ports(void) return false; } -bool __dbg_hw_info(void) +bool dbg_hw_info(void) { int line = 0, oldline; int button; diff --git a/firmware/target/arm/tms320dm320/debug-target.h b/firmware/target/arm/tms320dm320/debug-target.h index bcf9d688cd..5fc0c98ce0 100644 --- a/firmware/target/arm/tms320dm320/debug-target.h +++ b/firmware/target/arm/tms320dm320/debug-target.h @@ -19,5 +19,5 @@ * ****************************************************************************/ -bool __dbg_hw_info(void); +bool dbg_hw_info(void); bool dbg_ports(void); |