From 5438614509d80bc0b1981b749e9cb688f1769dfb Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Mon, 19 Jan 2009 18:43:12 +0800 Subject: [PATCH] [ARM] pxa: make lubbock specific debugging stuffs back into lubbock.c This isn't perfect but at least solves the problem of pm.c's dependency on register definitions in , which doesn't make much sense. Signed-off-by: Eric Miao --- arch/arm/mach-pxa/include/mach/lubbock.h | 1 - arch/arm/mach-pxa/include/mach/pm.h | 10 ++++++++++ arch/arm/mach-pxa/lubbock.c | 7 +++++++ arch/arm/mach-pxa/pm.c | 13 +++---------- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h index 4cb24154a5a8..751b74811d0f 100644 --- a/arch/arm/mach-pxa/include/mach/lubbock.h +++ b/arch/arm/mach-pxa/include/mach/lubbock.h @@ -25,7 +25,6 @@ /* FPGA register virtual addresses */ #define LUB_WHOAMI __LUB_REG(LUBBOCK_FPGA_PHYS + 0x000) -#define LUB_HEXLED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x010) #define LUB_DISC_BLNK_LED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x040) #define LUB_CONF_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x050) #define LUB_USER_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x060) diff --git a/arch/arm/mach-pxa/include/mach/pm.h b/arch/arm/mach-pxa/include/mach/pm.h index 83342469acac..a6eeef8a075f 100644 --- a/arch/arm/mach-pxa/include/mach/pm.h +++ b/arch/arm/mach-pxa/include/mach/pm.h @@ -27,3 +27,13 @@ extern void pxa27x_cpu_suspend(unsigned int); extern void pxa_cpu_resume(void); extern int pxa_pm_enter(suspend_state_t state); + +/* NOTE: this is for PM debugging on Lubbock, it's really a big + * ugly, but let's keep the crap minimum here, instead of direct + * accessing the LUBBOCK CPLD registers in arch/arm/mach-pxa/pm.c + */ +#ifdef CONFIG_ARCH_LUBBOCK +extern void lubbock_set_hexled(uint32_t value); +#else +#define lubbock_set_hexled(x) +#endif diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 03a43ea148a9..f04c8333dff7 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -49,6 +49,7 @@ #include #include #include +#include #include "generic.h" #include "clock.h" @@ -112,8 +113,14 @@ static unsigned long lubbock_pin_config[] __initdata = { GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, }; +#define LUB_HEXLED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x010) #define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080) +void lubbock_set_hexled(uint32_t value) +{ + LUB_HEXLED = value; +} + void lubbock_set_misc_wr(unsigned int mask, unsigned int set) { unsigned long flags; diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index 164eb0bb6321..884b174c8ead 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c @@ -14,15 +14,8 @@ #include #include #include -#include -#include -#include -#include #include -#include -#include -#include struct pxa_cpu_pm_fns *pxa_cpu_pm_fns; static unsigned long *sleep_save; @@ -57,9 +50,9 @@ int pxa_pm_enter(suspend_state_t state) /* if invalid, display message and wait for a hardware reset */ if (checksum != sleep_save_checksum) { -#ifdef CONFIG_ARCH_LUBBOCK - LUB_HEXLED = 0xbadbadc5; -#endif + + lubbock_set_hexled(0xbadbadc5); + while (1) pxa_cpu_pm_fns->enter(state); } -- 2.39.5