X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/aedeeb1874e872189927c3c73cc039a2eb250586..8a891d72ed376dd5c3ca251ec4e29c8d8b1c6c08:/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c index ae1f41fe5..909875d07 100644 --- a/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c +++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c @@ -49,7 +49,9 @@ static void enet_misc_set(struct clk *clk, int enable) { u32 mask; - if (BCMCPU_IS_6348()) + if (BCMCPU_IS_6338()) + mask = CKCTL_6338_ENET_EN; + else if (BCMCPU_IS_6348()) mask = CKCTL_6348_ENET_EN; else /* BCMCPU_IS_6358 */ @@ -136,6 +138,26 @@ static struct clk clk_usbh = { .set = usbh_set, }; +/* + * USB slave clock + */ +static void usbs_set(struct clk *clk, int enable) +{ + u32 mask; + + switch(bcm63xx_get_cpu_id()) { + case BCM6338_CPU_ID: mask = CKCTL_6338_USBS_EN; break; + case BCM6348_CPU_ID: mask = CKCTL_6348_USBS_EN; break; + default: + return; + } + bcm_hwclock_set(mask, enable); +} + +static struct clk clk_usbs = { + .set = usbs_set, +}; + /* * SPI clock */ @@ -143,7 +165,9 @@ static void spi_set(struct clk *clk, int enable) { u32 mask; - if (BCMCPU_IS_6348()) + if (BCMCPU_IS_6338()) + mask = CKCTL_6338_SPI_EN; + else if (BCMCPU_IS_6348()) mask = CKCTL_6348_SPI_EN; else /* BCMCPU_IS_6358 */ @@ -202,6 +226,8 @@ struct clk *clk_get(struct device *dev, const char *id) return &clk_ephy; if (!strcmp(id, "usbh")) return &clk_usbh; + if (!strcmp(id, "usbs")) + return &clk_usbs; if (!strcmp(id, "spi")) return &clk_spi; if (!strcmp(id, "periph"))