]> git.sur5r.net Git - u-boot/commitdiff
ARM: uniphier: enable clocks to MIO/STDMAC on LD11 if USB is enabled
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 27 Oct 2016 14:47:05 +0000 (23:47 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 29 Oct 2016 08:24:30 +0000 (17:24 +0900)
At the moment, the clk driver is not clever enough to automatically
enable parent clocks like Linux.  Enable the STDMAC clock explicitly
if USB is enabled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/mach-uniphier/clk/clk-ld11.c
arch/arm/mach-uniphier/sc64-regs.h

index 92a07338a81ec54f5d6165a872d46d4f0236057a..ca8737d2ff4db9447fcf8b8cba64625331d22691 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/io.h>
 
 #include "../init.h"
+#include "../sc64-regs.h"
 #include "../sg-regs.h"
 
 void uniphier_ld11_clk_init(void)
@@ -25,4 +26,14 @@ void uniphier_ld11_clk_init(void)
                writel(3, SG_ETPHYPSHUT);
                writel(7, SG_ETPHYCNT);
        }
+
+#ifdef CONFIG_USB_EHCI
+       {
+               /* FIXME: the current clk driver can not handle parents */
+               u32 tmp;
+               tmp = readl(SC_CLKCTRL4);
+               tmp |= SC_CLKCTRL4_MIO | SC_CLKCTRL4_STDMAC;
+               writel(tmp, SC_CLKCTRL4);
+       }
+#endif
 }
index b0a4281f441984162817e1863f2191de5aeb2f96..d3aa18530d97593bd0b43ce071f10363d59f09d6 100644 (file)
@@ -52,6 +52,8 @@
 #define SC_CLKCTRL             (SC_BASE_ADDR | 0x2100)
 #define SC_CLKCTRL3            (SC_BASE_ADDR | 0x2108)
 #define SC_CLKCTRL4            (SC_BASE_ADDR | 0x210c)
+#define   SC_CLKCTRL4_MIO              (1 << 10)
+#define   SC_CLKCTRL4_STDMAC           (1 << 8)
 #define   SC_CLKCTRL4_PERI             (1 << 7)
 #define   SC_CLKCTRL4_ETHER            (1 << 6)
 #define   SC_CLKCTRL4_NAND             (1 << 0)