mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Move dbg_hw_info() into target tree. FS#11735 by me
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29964 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dace72166e
commit
dceceef052
26 changed files with 536 additions and 387 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,3 +47,4 @@
|
|||
# define DEBUG_CANCEL BUTTON_CANCEL
|
||||
#endif
|
||||
bool dbg_ports(void);
|
||||
bool dbg_hw_info(void);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "font.h"
|
||||
#include "debug-target.h"
|
||||
|
||||
bool __dbg_hw_info(void)
|
||||
bool dbg_hw_info(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@
|
|||
#define DEBUG_CANCEL BUTTON_MENU
|
||||
#endif
|
||||
|
||||
bool __dbg_hw_info(void);
|
||||
bool dbg_hw_info(void);
|
||||
bool dbg_ports(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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_ */
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool __dbg_hw_info(void);
|
||||
bool dbg_hw_info(void);
|
||||
bool dbg_ports(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool __dbg_hw_info(void);
|
||||
bool dbg_hw_info(void);
|
||||
bool dbg_ports(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -19,5 +19,5 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool __dbg_hw_info(void);
|
||||
bool dbg_hw_info(void);
|
||||
bool dbg_ports(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue