summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2014-01-14 05:23:39 +0000
committerFlorian Fainelli <florian@openwrt.org>2014-01-14 05:23:39 +0000
commit0ecdc42f60397cd015ba8cb57f6835eb59950e45 (patch)
treef42f84094d9976da85e0dc49cce05612ed131bab /target
parent7951993efd6a76426ec2c86f503c1744d4d23462 (diff)
downloadmtk-20170518-0ecdc42f60397cd015ba8cb57f6835eb59950e45.zip
mtk-20170518-0ecdc42f60397cd015ba8cb57f6835eb59950e45.tar.gz
mtk-20170518-0ecdc42f60397cd015ba8cb57f6835eb59950e45.tar.bz2
brcm63xx: improve BCM6318 support
Provide clock toggling for the USB host and slave controller as well as for the Ethernet Switch. The bcm63xx_enetsw driver is changed not to use request_mem_region() as the Roboswitch register overlaps with the Roboswitch IUDMA channels, hence making the driver return -EBUSY. A future fix might be to use variable size RSET_ENETSW sizes depending on the chip we are targetting. Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 39282
Diffstat (limited to 'target')
-rw-r--r--target/linux/brcm63xx/patches-3.10/341-MIPS-BCM63XX-add-support-for-BCM6318.patch67
-rw-r--r--target/linux/brcm63xx/patches-3.10/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch50
-rw-r--r--target/linux/brcm63xx/patches-3.10/424-bcm63xx_enet_no_request_mem_region.patch15
3 files changed, 131 insertions, 1 deletions
diff --git a/target/linux/brcm63xx/patches-3.10/341-MIPS-BCM63XX-add-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-3.10/341-MIPS-BCM63XX-add-support-for-BCM6318.patch
index 7402843..d334386 100644
--- a/target/linux/brcm63xx/patches-3.10/341-MIPS-BCM63XX-add-support-for-BCM6318.patch
+++ b/target/linux/brcm63xx/patches-3.10/341-MIPS-BCM63XX-add-support-for-BCM6318.patch
@@ -343,7 +343,7 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318
+#define BCM_6318_SPI_BASE (0xdeadbeef)
+#define BCM_6318_HSSPI_BASE (0xb0003000)
+#define BCM_6318_UDC0_BASE (0xdeadbeef)
-+#define BCM_6318_USBDMA_BASE (0xdeadbeef)
++#define BCM_6318_USBDMA_BASE (0xb0006800)
+#define BCM_6318_OHCI0_BASE (0xb0005100)
+#define BCM_6318_OHCI_PRIV_BASE (0xdeadbeef)
+#define BCM_6318_USBH_PRIV_BASE (0xb0005200)
@@ -601,3 +601,68 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318
return -ENODEV;
spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI);
+--- a/arch/mips/bcm63xx/dev-usb-usbd.c
++++ b/arch/mips/bcm63xx/dev-usb-usbd.c
+@@ -41,7 +41,7 @@ int __init bcm63xx_usbd_register(const s
+ IRQ_USBD_RXDMA2, IRQ_USBD_TXDMA2 };
+ int i;
+
+- if (!BCMCPU_IS_6328() && !BCMCPU_IS_6368())
++ if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6368())
+ return 0;
+
+ usbd_resources[0].start = bcm63xx_regset_address(RSET_USBD);
+--- a/arch/mips/bcm63xx/dev-enet.c
++++ b/arch/mips/bcm63xx/dev-enet.c
+@@ -176,7 +176,8 @@ static int __init register_shared(void)
+ else
+ shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
+
+- if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
++ if (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6362() ||
++ BCMCPU_IS_6368())
+ chan_count = 32;
+ else if (BCMCPU_IS_6345())
+ chan_count = 8;
+@@ -276,7 +277,8 @@ bcm63xx_enetsw_register(const struct bcm
+ {
+ int ret;
+
+- if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
++ if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6362() &&
++ !BCMCPU_IS_6368())
+ return -ENODEV;
+
+ ret = register_shared();
+@@ -293,7 +295,7 @@ bcm63xx_enetsw_register(const struct bcm
+
+ memcpy(bcm63xx_enetsw_device.dev.platform_data, pd, sizeof(*pd));
+
+- if (BCMCPU_IS_6328())
++ if (BCMCPU_IS_6318() || BCMCPU_IS_6328())
+ enetsw_pd.num_ports = ENETSW_PORTS_6328;
+ else if (BCMCPU_IS_6362() || BCMCPU_IS_6368())
+ enetsw_pd.num_ports = ENETSW_PORTS_6368;
+--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
+@@ -9,6 +9,8 @@ int __init bcm63xx_gpio_init(void);
+ static inline unsigned long bcm63xx_gpio_count(void)
+ {
+ switch (bcm63xx_get_cpu_id()) {
++ case BCM6318_CPU_ID:
++ return 50;
+ case BCM6328_CPU_ID:
+ return 32;
+ case BCM3368_CPU_ID:
+--- a/arch/mips/bcm63xx/dev-usb-ehci.c
++++ b/arch/mips/bcm63xx/dev-usb-ehci.c
+@@ -81,7 +81,8 @@ static struct platform_device bcm63xx_eh
+
+ int __init bcm63xx_ehci_register(void)
+ {
+- if (!BCMCPU_IS_6328() && !BCMCPU_IS_6358() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
++ if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() &&
++ !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
+ return 0;
+
+ ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
diff --git a/target/linux/brcm63xx/patches-3.10/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch b/target/linux/brcm63xx/patches-3.10/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch
new file mode 100644
index 0000000..8876f26
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.10/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch
@@ -0,0 +1,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);
diff --git a/target/linux/brcm63xx/patches-3.10/424-bcm63xx_enet_no_request_mem_region.patch b/target/linux/brcm63xx/patches-3.10/424-bcm63xx_enet_no_request_mem_region.patch
new file mode 100644
index 0000000..e0271b2
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.10/424-bcm63xx_enet_no_request_mem_region.patch
@@ -0,0 +1,15 @@
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -2787,12 +2787,6 @@ static int bcm_enetsw_probe(struct platf
+ if (ret)
+ goto out;
+
+- if (!request_mem_region(res_mem->start, resource_size(res_mem),
+- "bcm63xx_enetsw")) {
+- ret = -EBUSY;
+- goto out;
+- }
+-
+ priv->base = ioremap(res_mem->start, resource_size(res_mem));
+ if (priv->base == NULL) {
+ ret = -ENOMEM;