xloader: Panda - add led flashing debug code
authorAndy Green <andy.green@linaro.org>
Wed, 9 Feb 2011 14:44:47 +0000 (14:44 +0000)
committerAnand Gadiyar <gadiyar@ti.com>
Mon, 14 Mar 2011 07:17:02 +0000 (12:47 +0530)
I found this useful during debugging failure of xloader before
serial had come up on Panda.

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
board/omap4430panda/omap4430panda.c

index f26627e..0f95c39 100644 (file)
@@ -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