forked from len0rd/rockbox
Add more information to the battery debug screen for Nano2G
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24723 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b3c18aeb4d
commit
e5c815272d
11 changed files with 94 additions and 58 deletions
|
@ -1648,6 +1648,28 @@ static bool view_battery(void)
|
||||||
#elif defined(IPOD_NANO2G)
|
#elif defined(IPOD_NANO2G)
|
||||||
y = pmu_read_battery_current();
|
y = pmu_read_battery_current();
|
||||||
lcd_putsf(0, 2, "Battery current: %d mA", y);
|
lcd_putsf(0, 2, "Battery current: %d mA", y);
|
||||||
|
lcd_putsf(0, 3, "PWRCON: %8x", PWRCON);
|
||||||
|
lcd_putsf(0, 4, "PWRCONEXT: %8x", PWRCONEXT);
|
||||||
|
x = pmu_read(0x1b) & 0xf;
|
||||||
|
y = pmu_read(0x1a) * 25 + 625;
|
||||||
|
lcd_putsf(0, 5, "AUTO: %x / %d mV", x, y);
|
||||||
|
x = pmu_read(0x1f) & 0xf;
|
||||||
|
y = pmu_read(0x1e) * 25 + 625;
|
||||||
|
lcd_putsf(0, 6, "DOWN1: %x / %d mV", x, y);
|
||||||
|
x = pmu_read(0x23) & 0xf;
|
||||||
|
y = pmu_read(0x22) * 25 + 625;
|
||||||
|
lcd_putsf(0, 7, "DOWN2: %x / %d mV", x, y);
|
||||||
|
x = pmu_read(0x27) & 0xf;
|
||||||
|
y = pmu_read(0x26) * 100 + 900;
|
||||||
|
lcd_putsf(0, 8, "MEMLDO: %x / %d mV", x, y);
|
||||||
|
for (i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
x = pmu_read(0x2e + (i << 1)) & 0xf;
|
||||||
|
y = pmu_read(0x2d + (i << 1)) * 100 + 900;
|
||||||
|
lcd_putsf(0, 9 + i, "LDO%d: %x / %d mV", i + 1, x, y);
|
||||||
|
}
|
||||||
|
lcd_putsf(0, 15, "CLKCON: %8x", CLKCON);
|
||||||
|
lcd_putsf(17, 15, "PLL0: %6x", PLL0PMS);
|
||||||
#else
|
#else
|
||||||
lcd_putsf(0, 3, "Charger: %s",
|
lcd_putsf(0, 3, "Charger: %s",
|
||||||
charger_inserted() ? "present" : "absent");
|
charger_inserted() ? "present" : "absent");
|
||||||
|
|
|
@ -179,3 +179,14 @@ md5sum.c
|
||||||
#ifdef USB_ENABLE_HID
|
#ifdef USB_ENABLE_HID
|
||||||
remote_control.c
|
remote_control.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
test_codec.c
|
||||||
|
test_core_jpeg.c
|
||||||
|
test_disk.c
|
||||||
|
test_fps.c
|
||||||
|
test_gfx.c
|
||||||
|
test_mem_jpeg.c
|
||||||
|
test_resize.c
|
||||||
|
test_sampr.c
|
||||||
|
test_scanrate.c
|
||||||
|
test_viewports.c
|
||||||
|
|
|
@ -30,7 +30,7 @@ PLUGIN_HEADER
|
||||||
#define EV_EXIT 1337
|
#define EV_EXIT 1337
|
||||||
|
|
||||||
/* seems to work with 1300, but who knows... */
|
/* seems to work with 1300, but who knows... */
|
||||||
#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE + 0x200
|
#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE + 0x1200
|
||||||
|
|
||||||
#if CONFIG_KEYPAD == RECORDER_PAD
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
DOOMSRCDIR := $(APPSDIR)/plugins/doom
|
DOOMSRCDIR := $(APPSDIR)/plugins/doom
|
||||||
DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom
|
DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom
|
||||||
|
|
||||||
ROCKS += $(DOOMBUILDDIR)/doom.rock
|
#ROCKS += $(DOOMBUILDDIR)/doom.rock
|
||||||
|
|
||||||
DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES)
|
DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES)
|
||||||
DOOM_SRC += $(ROOTDIR)/firmware/common/sscanf.c
|
DOOM_SRC += $(ROOTDIR)/firmware/common/sscanf.c
|
||||||
|
|
|
@ -142,8 +142,8 @@ OUTPUT_FORMAT(elf32-littlemips)
|
||||||
|
|
||||||
#elif CONFIG_CPU==S5L8700
|
#elif CONFIG_CPU==S5L8700
|
||||||
#define DRAMORIG 0x08000000
|
#define DRAMORIG 0x08000000
|
||||||
#define IRAMORIG (0x00000000 + (64*1024))
|
#define IRAMORIG (0x00000000 + (128*1024))
|
||||||
#define IRAMSIZE (64*1024)
|
#define IRAMSIZE (128*1024)
|
||||||
|
|
||||||
#elif CONFIG_CPU==S5L8701
|
#elif CONFIG_CPU==S5L8701
|
||||||
#define DRAMORIG 0x08000000
|
#define DRAMORIG 0x08000000
|
||||||
|
|
|
@ -84,8 +84,8 @@ void fatal_error(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* aes_decrypt() and readfw() functions taken from iloader - (C)
|
/* aes_decrypt() and readfw() functions taken from iLoader.
|
||||||
Michael Sparmann and licenced under GPL v2 or later.
|
(C) Michael Sparmann and licenced under GPL v2 or later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void aes_decrypt(void* data, uint32_t size)
|
static void aes_decrypt(void* data, uint32_t size)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
static char panic_buf[128];
|
static char panic_buf[128];
|
||||||
#define LINECHARS (LCD_WIDTH/SYSFONT_WIDTH)
|
#define LINECHARS (LCD_WIDTH/SYSFONT_WIDTH) - 2
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "Dude. This is pretty fucked-up, right here."
|
* "Dude. This is pretty fucked-up, right here."
|
||||||
|
|
|
@ -28,7 +28,7 @@ STARTUP(target/arm/s5l8700/crt0.o)
|
||||||
#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE)
|
#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE)
|
||||||
#define CODECORIG (ENDAUDIOADDR)
|
#define CODECORIG (ENDAUDIOADDR)
|
||||||
#if CONFIG_CPU==S5L8700
|
#if CONFIG_CPU==S5L8700
|
||||||
#define IRAMSIZE (64*1024) /* 128KB total - 64KB for core, 64KB for plugins */
|
#define IRAMSIZE (128*1024) /* 256KB total - 128KB for core, 128KB for plugins */
|
||||||
#else /* S5L8701 */
|
#else /* S5L8701 */
|
||||||
#define IRAMSIZE (96*1024) /* 176KB total - 96KB for core, 80KB for plugins */
|
#define IRAMSIZE (96*1024) /* 176KB total - 96KB for core, 80KB for plugins */
|
||||||
#endif
|
#endif
|
||||||
|
@ -108,7 +108,7 @@ SECTIONS
|
||||||
stackbegin = .;
|
stackbegin = .;
|
||||||
_stackbegin = .;
|
_stackbegin = .;
|
||||||
#ifdef IPOD_NANO2G
|
#ifdef IPOD_NANO2G
|
||||||
. += 0x4000;
|
. += 0x2000;
|
||||||
#endif
|
#endif
|
||||||
. += 0x2000;
|
. += 0x2000;
|
||||||
stackend = .;
|
stackend = .;
|
||||||
|
|
|
@ -260,64 +260,64 @@ start_loc:
|
||||||
|
|
||||||
#if defined(MEIZU_M6SP) || defined(MEIZU_M3)
|
#if defined(MEIZU_M6SP) || defined(MEIZU_M3)
|
||||||
/* setup SDRAM for Meizu M6SP */
|
/* setup SDRAM for Meizu M6SP */
|
||||||
ldr r1, =0x38200000
|
ldr r1, =0x38200000
|
||||||
// configure SDR drive strength and pad settings
|
// configure SDR drive strength and pad settings
|
||||||
mov r0, #SDR_DSS_SEL_B
|
mov r0, #SDR_DSS_SEL_B
|
||||||
str r0, [r1, #0x4C] // MIU_DSS_SEL_B
|
str r0, [r1, #0x4C] // MIU_DSS_SEL_B
|
||||||
mov r0, #SDR_DSS_SEL_O
|
mov r0, #SDR_DSS_SEL_O
|
||||||
str r0, [r1, #0x50] // MIU_DSS_SEL_O
|
str r0, [r1, #0x50] // MIU_DSS_SEL_O
|
||||||
mov r0, #SDR_DSS_SEL_C
|
mov r0, #SDR_DSS_SEL_C
|
||||||
str r0, [r1, #0x54] // MIU_DSS_SEL_C
|
str r0, [r1, #0x54] // MIU_DSS_SEL_C
|
||||||
mov r0, #2
|
mov r0, #2
|
||||||
str r0, [r1, #0x60] // SSTL2_PAD_ON
|
str r0, [r1, #0x60] // SSTL2_PAD_ON
|
||||||
// select SDR mode
|
// select SDR mode
|
||||||
ldr r0, [r1, #0x40]
|
ldr r0, [r1, #0x40]
|
||||||
mov r2, #0xFFFDFFFF
|
mov r2, #0xFFFDFFFF
|
||||||
and r0, r0, r2
|
and r0, r0, r2
|
||||||
orr r0, r0, #1
|
orr r0, r0, #1
|
||||||
str r0, [r1, #0x40] // MIUORG
|
str r0, [r1, #0x40] // MIUORG
|
||||||
// set controller configuration
|
// set controller configuration
|
||||||
mov r0, #SDR_CONFIG
|
mov r0, #SDR_CONFIG
|
||||||
str r0, [r1] // MIUCON
|
str r0, [r1] // MIUCON
|
||||||
// set SDRAM timing
|
// set SDRAM timing
|
||||||
ldr r0, =SDR_TIMING
|
ldr r0, =SDR_TIMING
|
||||||
str r0, [r1, #0x10] // MIUSDPARA
|
str r0, [r1, #0x10] // MIUSDPARA
|
||||||
// set refresh rate
|
// set refresh rate
|
||||||
mov r0, #0x1080
|
mov r0, #0x1080
|
||||||
str r0, [r1, #0x08] // MIUAREF
|
str r0, [r1, #0x08] // MIUAREF
|
||||||
// initialise SDRAM
|
// initialise SDRAM
|
||||||
mov r0, #0x003
|
mov r0, #0x003
|
||||||
str r0, [r1, #0x04] // MIUCOM = nop
|
str r0, [r1, #0x04] // MIUCOM = nop
|
||||||
ldr r0, =0x203
|
ldr r0, =0x203
|
||||||
str r0, [r1, #0x04] // MIUCOM = precharge all banks
|
str r0, [r1, #0x04] // MIUCOM = precharge all banks
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
ldr r0, =0x303
|
ldr r0, =0x303
|
||||||
str r0, [r1, #0x04] // MIUCOM = auto-refresh
|
str r0, [r1, #0x04] // MIUCOM = auto-refresh
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
str r0, [r1, #0x04] // MIUCOM = auto-refresh
|
str r0, [r1, #0x04] // MIUCOM = auto-refresh
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
str r0, [r1, #0x04] // MIUCOM = auto-refresh
|
str r0, [r1, #0x04] // MIUCOM = auto-refresh
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
// set mode register
|
// set mode register
|
||||||
mov r0, #SDR_MRS
|
mov r0, #SDR_MRS
|
||||||
str r0, [r1, #0x0C] // MIUMRS
|
str r0, [r1, #0x0C] // MIUMRS
|
||||||
ldr r0, =0x103
|
ldr r0, =0x103
|
||||||
str r0, [r1, #0x04] // MIUCOM = mode register set
|
str r0, [r1, #0x04] // MIUCOM = mode register set
|
||||||
ldr r0, =SDR_EMRS
|
ldr r0, =SDR_EMRS
|
||||||
str r0, [r1, #0x0C] // MIUMRS
|
str r0, [r1, #0x0C] // MIUMRS
|
||||||
ldr r0, =0x103
|
ldr r0, =0x103
|
||||||
str r0, [r1, #0x04] // MIUCOM = mode register set
|
str r0, [r1, #0x04] // MIUCOM = mode register set
|
||||||
#endif /* MEIZU_M6SP */
|
#endif /* MEIZU_M6SP */
|
||||||
|
|
||||||
mov r1, #0x1
|
mov r1, #0x1
|
||||||
|
|
|
@ -92,6 +92,9 @@ bool __dbg_ports(void)
|
||||||
_DEBUG_PRINTF("GPIO 11: %08x",(unsigned int)PDAT11);
|
_DEBUG_PRINTF("GPIO 11: %08x",(unsigned int)PDAT11);
|
||||||
_DEBUG_PRINTF("GPIO 13: %08x",(unsigned int)PDAT13);
|
_DEBUG_PRINTF("GPIO 13: %08x",(unsigned int)PDAT13);
|
||||||
_DEBUG_PRINTF("GPIO 14: %08x",(unsigned int)PDAT14);
|
_DEBUG_PRINTF("GPIO 14: %08x",(unsigned int)PDAT14);
|
||||||
|
_DEBUG_PRINTF("5USEC : %08x",(unsigned int)FIVE_USEC_TIMER);
|
||||||
|
_DEBUG_PRINTF("USEC : %08x",(unsigned int)USEC_TIMER);
|
||||||
|
_DEBUG_PRINTF("USECREG: %08x",(unsigned int)(*(REG32_PTR_T)(0x3C700084)));
|
||||||
|
|
||||||
lcd_update();
|
lcd_update();
|
||||||
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
||||||
|
|
|
@ -48,7 +48,7 @@ void power_off(void)
|
||||||
|
|
||||||
void power_init(void)
|
void power_init(void)
|
||||||
{
|
{
|
||||||
/* TODO */
|
pmu_write(0x1e, 15); /* Vcore = 1.000V */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue