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