xloader: Panda - kill OTG and reset PHY in case ROM started them
authorAndy Green <andy.green@linaro.org>
Wed, 9 Feb 2011 14:46:03 +0000 (14:46 +0000)
committerAnand Gadiyar <gadiyar@ti.com>
Mon, 14 Mar 2011 07:17:12 +0000 (12:47 +0530)
It'd be better if we didn't let the OS or next bootloader
see that the ROM set things up differently than usual.

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

index ce45e6d..4cedd8f 100644 (file)
@@ -527,6 +527,26 @@ static void ddr_init(void)
  *****************************************/
 int board_init(void)
 {
+       unsigned int v;
+
+       /*
+        * If the ROM has started the OTG stuff, stop it and
+        * make it look as if uninitialized for Linux or U-Boot
+        */
+
+       /* hold OTG phy in reset */
+
+       v = __raw_readl(OMAP44XX_GPIO_BASE2 + 0x134);
+       __raw_writel((v & ~(0x01 << 30)), OMAP44XX_GPIO_BASE2 + 0x134);
+
+       v = __raw_readl(OMAP44XX_GPIO_BASE2 + 0x13c);
+       __raw_writel((v & ~(0x01 << 30)), OMAP44XX_GPIO_BASE2 + 0x13c);
+
+       /* kill USB PLL */
+
+       v = __raw_readl(0x4a008100 + 0x80);
+       __raw_writel((v & ~(7 << 0)) | 1, 0x4a008100 + 0x80);
+
        return 0;
 }