TPL: TM2: usb3: Use usb3 drd phy configuration from Linux kernel
authorLukasz Majewski <l.majewski@samsung.com>
Thu, 12 May 2016 11:20:56 +0000 (13:20 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:38:37 +0000 (13:38 +0900)
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/usb/dwc3/samsung_usb_phy.c

index 6770614..7f4a3a7 100644 (file)
@@ -8,11 +8,15 @@
  */
 
 #include <common.h>
+#ifdef CONFIG_TPL_TM2
+#include <asm/io.h>
+#endif
 #include <asm/arch/power.h>
 #include <asm/arch/xhci-exynos.h>
 
 void exynos5_usb3_phy_init(struct exynos_usb3_phy *phy)
 {
+#ifndef CONFIG_TPL_TM2
        u32 reg;
 
        /* Reset USB 3.0 PHY */
@@ -74,4 +78,25 @@ void exynos5_usb3_phy_init(struct exynos_usb3_phy *phy)
 
        reg &= ~PHYCLKRST_PORTRESET;
        writel(reg, &phy->phy_clk_rst);
+#else
+       void *base = phy;
+       /* copied from Linux kernel register dump */
+       writel(0x0, base + 0x14);
+       writel(0x0, base + 0x34);
+       writel(0x8000040, base + 0x4);
+       writel(0x24d466e4, base + 0x1c);
+       writel(0x4, base + 0x30);
+       writel(0x24d466e4, base + 0x1c);
+       writel(0x3fff81c, base + 0x20);
+       writel(0x40, base + 0x8);
+       writel(0x0, base + 0x28);
+       writel(0xc41805bf, base + 0x10);
+       udelay(10);
+       writel(0xc41805bd, base + 0x10);
+       writel(0x3fff81c, base + 0x20);
+       writel(0x0, base + 0x28);
+       writel(0xc41b40bf, base + 0x10);
+       udelay(10);
+       writel(0xc41b40bd, base + 0x10);
+#endif /* CONFIG_TPL_TM2 */
 }