aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch')
-rw-r--r--target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch73
1 files changed, 42 insertions, 31 deletions
diff --git a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch
index 25b0df5dc2..85abad4d30 100644
--- a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch
+++ b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch
@@ -46,16 +46,16 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
val = bcm_mpi_readl(MPI_CSBASE_REG(0));
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
-@@ -133,6 +133,8 @@ static void enetsw_set(struct clk *clk,
- CKCTL_6368_SWPKT_USB_EN |
- CKCTL_6368_SWPKT_SAR_EN,
- enable);
-+ else if (BCMCPU_IS_63268())
+@@ -168,6 +168,8 @@ static void enetsw_set(struct clk *clk,
+ clk_disable_unlocked(&clk_swpkt_sar);
+ }
+ bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable);
++ } else if (BCMCPU_IS_63268()) {
+ bcm_hwclock_set(CKCTL_63268_ROBOSW_EN, enable);
- else
+ } else {
return;
-
-@@ -177,6 +179,8 @@ static void usbh_set(struct clk *clk, in
+ }
+@@ -213,6 +215,8 @@ static void usbh_set(struct clk *clk, in
bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
else if (BCMCPU_IS_6368())
bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
@@ -64,7 +64,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
else
return;
-@@ -199,6 +203,8 @@ static void usbd_set(struct clk *clk, in
+@@ -235,6 +239,8 @@ static void usbd_set(struct clk *clk, in
bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
else if (BCMCPU_IS_6368())
bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
@@ -73,7 +73,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
else
return;
-@@ -225,9 +231,13 @@ static void spi_set(struct clk *clk, int
+@@ -261,9 +267,13 @@ static void spi_set(struct clk *clk, int
mask = CKCTL_6358_SPI_EN;
else if (BCMCPU_IS_6362())
mask = CKCTL_6362_SPI_EN;
@@ -89,7 +89,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
bcm_hwclock_set(mask, enable);
}
-@@ -246,6 +256,8 @@ static void hsspi_set(struct clk *clk, i
+@@ -282,6 +292,8 @@ static void hsspi_set(struct clk *clk, i
mask = CKCTL_6328_HSSPI_EN;
else if (BCMCPU_IS_6362())
mask = CKCTL_6362_HSSPI_EN;
@@ -98,7 +98,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
else
return;
-@@ -307,6 +319,8 @@ static void pcie_set(struct clk *clk, in
+@@ -351,6 +363,8 @@ static void pcie_set(struct clk *clk, in
bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
else if (BCMCPU_IS_6362())
bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable);
@@ -107,28 +107,39 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
}
static struct clk clk_pcie = {
-@@ -389,9 +403,11 @@ struct clk *clk_get(struct device *dev,
- return &clk_periph;
- if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
- return &clk_pcm;
-- if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
-+ if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) &&
-+ !strcmp(id, "ipsec"))
- return &clk_ipsec;
-- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
-+ if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) &&
-+ !strcmp(id, "pcie"))
- return &clk_pcie;
- return ERR_PTR(-ENOENT);
- }
-@@ -414,6 +430,7 @@ static int __init bcm63xx_clk_init(void)
- clk_hsspi.rate = HSSPI_PLL_HZ_6328;
+@@ -532,6 +546,21 @@ static struct clk_lookup bcm6368_clks[]
+ CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
+ };
+
++static struct clk_lookup bcm63268_clks[] = {
++ /* fixed rate clocks */
++ CLKDEV_INIT(NULL, "periph", &clk_periph),
++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
++ /* gated clocks */
++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
++ CLKDEV_INIT(NULL, "usbh", &clk_usbh),
++ CLKDEV_INIT(NULL, "usbd", &clk_usbd),
++ CLKDEV_INIT(NULL, "spi", &clk_spi),
++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
++ CLKDEV_INIT(NULL, "pcie", &clk_pcie),
++};
++
+ #define HSSPI_PLL_HZ_6328 133333333
+ #define HSSPI_PLL_HZ_6362 400000000
+
+@@ -564,6 +593,10 @@ static int __init bcm63xx_clk_init(void)
+ case BCM6368_CPU_ID:
+ clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks));
break;
- case BCM6362_CPU_ID:
+ case BCM63268_CPU_ID:
- clk_hsspi.rate = HSSPI_PLL_HZ_6362;
- break;
++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362;
++ clkdev_add_table(bcm63268_clks, ARRAY_SIZE(bcm63268_clks));
++ break;
}
+
+ return 0;
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -101,6 +101,15 @@ static const int bcm6368_irqs[] = {