summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx/patches-3.10/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch
blob: 8876f26cbe6da8b46deeee570c3612c93c2cae26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -136,7 +136,11 @@ static struct clk clk_ephy = {
  */
 static void enetsw_set(struct clk *clk, int enable)
 {
-	if (BCMCPU_IS_6328())
+	if (BCMCPU_IS_6318()) {
+		bcm_hwclock_set(CKCTL_6318_ROBOSW250_EN |
+				CKCTL_6318_ROBOSW025_EN, enable);
+		bcm_ub_hwclock_set(UB_CKCTL_6318_ROBOSW_EN, enable);
+	} else if (BCMCPU_IS_6328())
 		bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable);
 	else if (BCMCPU_IS_6362())
 		bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable);
@@ -179,11 +183,22 @@ static struct clk clk_pcm = {
 };
 
 /*
+ * 6318 USB host & slave clock
+ */
+static void bcm_6318_usb_clock_set(int enable)
+{
+	bcm_hwclock_set(CKCTL_6318_USB_EN, enable);
+	bcm_ub_hwclock_set(UB_CKCTL_6318_USB_EN, enable);
+}
+
+/*
  * USB host clock
  */
 static void usbh_set(struct clk *clk, int enable)
 {
-	if (BCMCPU_IS_6328())
+	if (BCMCPU_IS_6318())
+		bcm_6318_usb_clock_set(enable);
+	else if (BCMCPU_IS_6328())
 		bcm_hwclock_set(CKCTL_6328_USBH_EN, enable);
 	else if (BCMCPU_IS_6348())
 		bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
@@ -209,7 +224,9 @@ static struct clk clk_usbh = {
  */
 static void usbd_set(struct clk *clk, int enable)
 {
-	if (BCMCPU_IS_6328())
+	if (BCMCPU_IS_6318())
+		bcm_6318_usb_clock_set(enable);
+	else if (BCMCPU_IS_6328())
 		bcm_hwclock_set(CKCTL_6328_USBD_EN, enable);
 	else if (BCMCPU_IS_6362())
 		bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);