aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-03-09 18:22:18 +0100
committerFelix Fietkau <nbd@nbd.name>2018-03-09 18:25:57 +0100
commitfa22714181de40648d9680f6d5d9d4f03547ccc1 (patch)
tree206628858521527c9fd29571b36678d63a55177a /target
parent643850f568a5393f6635aca54580d61d7f37e3ff (diff)
downloadupstream-fa22714181de40648d9680f6d5d9d4f03547ccc1.tar.gz
upstream-fa22714181de40648d9680f6d5d9d4f03547ccc1.tar.bz2
upstream-fa22714181de40648d9680f6d5d9d4f03547ccc1.zip
ar71xx: fix double registration of usb host mode devices, add usb client support for qca955x
Only register the chipidea usb device if the strapping option indicates device mode. If not, use the regular ehci platform driver. Add qca955x device mode support, tested on 8devices Rambutan. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/patches-4.9/920-usb-chipidea-AR933x-platform-support.patch43
1 files changed, 26 insertions, 17 deletions
diff --git a/target/linux/ar71xx/patches-4.9/920-usb-chipidea-AR933x-platform-support.patch b/target/linux/ar71xx/patches-4.9/920-usb-chipidea-AR933x-platform-support.patch
index 740ffec4ac..fc6a088932 100644
--- a/target/linux/ar71xx/patches-4.9/920-usb-chipidea-AR933x-platform-support.patch
+++ b/target/linux/ar71xx/patches-4.9/920-usb-chipidea-AR933x-platform-support.patch
@@ -29,7 +29,7 @@
#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>
-@@ -170,6 +173,67 @@ static void __init ar913x_usb_setup(void
+@@ -170,6 +173,64 @@ static void __init ar913x_usb_setup(void
&ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
}
@@ -46,7 +46,7 @@
+ iounmap(usb_ctrl_base);
+}
+
-+static void __init ar9xxx_ci_usb_setup(void)
++static void __init ar9xxx_ci_usb_setup(int irq)
+{
+ struct ci_hdrc_platform_data ci_pdata;
+ enum usb_dr_mode dr_mode;
@@ -79,25 +79,22 @@
+ platform_device_register_simple("usb_phy_generic",
+ PLATFORM_DEVID_AUTO, NULL, 0);
+
-+ ath79_usb_register("ci_hdrc", -1,
-+ AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
-+ ATH79_CPU_IRQ(3),
-+ &ci_pdata, sizeof(ci_pdata));
-+
+ if (!host_mode)
-+ return;
-+
-+ ath79_usb_register("ehci-platform", -1,
-+ AR934X_EHCI_BASE, AR934X_EHCI_SIZE,
-+ ATH79_CPU_IRQ(3),
-+ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
++ ath79_usb_register("ci_hdrc", -1,
++ AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
++ irq, &ci_pdata, sizeof(ci_pdata));
++ else
++ ath79_usb_register("ehci-platform", -1,
++ AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
++ irq, &ath79_ehci_pdata_v2,
++ sizeof(ath79_ehci_pdata_v2));
+
+}
+
static void __init ar933x_usb_setup(void)
{
ath79_device_reset_set(AR933X_RESET_USBSUS_OVERRIDE);
-@@ -181,10 +245,7 @@ static void __init ar933x_usb_setup(void
+@@ -181,10 +242,7 @@ static void __init ar933x_usb_setup(void
ath79_device_reset_clear(AR933X_RESET_USB_PHY);
mdelay(10);
@@ -105,11 +102,11 @@
- AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
- ATH79_CPU_IRQ(3),
- &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
-+ ar9xxx_ci_usb_setup();
++ ar9xxx_ci_usb_setup(ATH79_CPU_IRQ(3));
}
static void enable_tx_tx_idp_violation_fix(unsigned base)
-@@ -230,10 +291,7 @@ static void __init ar934x_usb_setup(void
+@@ -230,10 +288,7 @@ static void __init ar934x_usb_setup(void
if (ath79_soc_rev >= 3)
ath79_ehci_pdata_v2.reset_notifier = ar934x_usb_reset_notifier;
@@ -117,7 +114,19 @@
- AR934X_EHCI_BASE, AR934X_EHCI_SIZE,
- ATH79_CPU_IRQ(3),
- &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
-+ ar9xxx_ci_usb_setup();
++ ar9xxx_ci_usb_setup(ATH79_CPU_IRQ(3));
}
static void __init qca953x_usb_setup(void)
+@@ -285,10 +340,7 @@ static void __init qca955x_usb_setup(voi
+ {
+ ath79_ehci_pdata_v2.reset_notifier = qca955x_usb_reset_notifier;
+
+- ath79_usb_register("ehci-platform", 0,
+- QCA955X_EHCI0_BASE, QCA955X_EHCI_SIZE,
+- ATH79_IP3_IRQ(0),
+- &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
++ ar9xxx_ci_usb_setup(ATH79_IP3_IRQ(0));
+
+ ath79_usb_register("ehci-platform", 1,
+ QCA955X_EHCI1_BASE, QCA955X_EHCI_SIZE,