From: Andy Green Date: Wed, 9 Feb 2011 14:44:47 +0000 (+0000) Subject: xloader: Panda - add led flashing debug code X-Git-Tag: v1.5.0~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=573fcc4b25833e295e047ae8e86f71a7035dc219;p=pandora-x-loader.git xloader: Panda - add led flashing debug code I found this useful during debugging failure of xloader before serial had come up on Panda. Signed-off-by: Andy Green Signed-off-by: Anand Gadiyar --- diff --git a/board/omap4430panda/omap4430panda.c b/board/omap4430panda/omap4430panda.c index f26627e..0f95c39 100644 --- a/board/omap4430panda/omap4430panda.c +++ b/board/omap4430panda/omap4430panda.c @@ -244,6 +244,24 @@ void reset_phy(unsigned int base) base + IODFT_TLGC); } +/* this flashes the Panda LEDs forever, if called after muxconf */ + +void spam_leds(void) +{ + unsigned int v = __raw_readl(OMAP44XX_GPIO_BASE1 + 0x134); + + /* set both LED gpio to output */ + __raw_writel((v & ~(0x03 << 7)), OMAP44XX_GPIO_BASE1 + 0x134); + + v = __raw_readl(OMAP44XX_GPIO_BASE1 + 0x13c); + while (1) { + __raw_writel((v & ~(0x03 << 7)), OMAP44XX_GPIO_BASE1 + 0x13c); + big_delay(3000000); + __raw_writel((v | (0x03 << 7)), OMAP44XX_GPIO_BASE1 + 0x13c); + big_delay(3000000); + } +} + /* TODO: FREQ update method is not working so shadow registers programming * is just for same of completeness. This would be safer if auto * trasnitions are working @@ -669,7 +687,6 @@ void s_init(void) sr32(0x4A30a110, 2, 2, 0x3); } } - } /******************************************************* @@ -709,6 +726,7 @@ int dram_init(void) } #define OMAP44XX_WKUP_CTRL_BASE 0x4A31E000 + #if 1 #define M0_SAFE M0 #define M1_SAFE M1