Changeset 40841


Ignore:
Timestamp:
2014-05-24T10:01:42+02:00 (4 years ago)
Author:
nbd
Message:

ar71xx: enable usb quirks for all chipidea based devices

The most important one is qca_force_host_mode, which also sets the
'Stream Disable' bit in the usbmode register.

Fixes usb stability issues on AR933x and AR7241/AR7242

Signed-off-by: Felix Fietkau <nbd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/patches-3.10/525-MIPS-ath79-enable-qca-usb-quirks.patch

    r37214 r40841  
    11--- a/arch/mips/ath79/dev-usb.c 
    22+++ b/arch/mips/ath79/dev-usb.c 
    3 @@ -182,14 +182,34 @@ static void __init ar933x_usb_setup(void 
     3@@ -37,6 +37,8 @@ static struct usb_ehci_pdata ath79_ehci_ 
     4 static struct usb_ehci_pdata ath79_ehci_pdata_v2 = { 
     5        .caps_offset            = 0x100, 
     6        .has_tt                 = 1, 
     7+       .qca_force_host_mode    = 1, 
     8+       .qca_force_16bit_ptw    = 1, 
     9 }; 
     10  
     11 static void __init ath79_usb_register(const char *name, int id, 
     12@@ -182,14 +184,34 @@ static void __init ar933x_usb_setup(void 
    413                           &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2)); 
    514 } 
     
    1120+       void __iomem *phy_reg; 
    1221+       u32 t; 
    13 + 
     22  
     23-       bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP); 
     24-       if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE) 
    1425+       phy_reg = ioremap(base, 4); 
    1526+       if (!phy_reg) 
    16 +               return; 
    17 + 
     27                return; 
     28  
    1829+       t = ioread32(phy_reg); 
    1930+       t &= ~0xff; 
     
    2334+       iounmap(phy_reg); 
    2435+} 
    25   
    26 -       bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP); 
    27 -       if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE) 
     36+ 
    2837+static void ar934x_usb_reset_notifier(struct platform_device *pdev) 
    2938+{ 
    3039+       if (pdev->id != -1) 
    31                 return; 
    32   
     40+               return; 
     41+ 
    3342+       enable_tx_tx_idp_violation_fix(0x18116c94); 
    3443+       dev_info(&pdev->dev, "TX-TX IDP fix enabled\n"); 
     
    4049        udelay(1000); 
    4150  
    42 @@ -202,14 +222,44 @@ static void __init ar934x_usb_setup(void 
     51@@ -202,14 +224,40 @@ static void __init ar934x_usb_setup(void 
    4352        ath79_device_reset_clear(AR934X_RESET_USB_HOST); 
    4453        udelay(1000); 
    4554  
    46 +       ath79_ehci_pdata_v2.qca_force_host_mode = 1; 
    47 +       ath79_ehci_pdata_v2.qca_force_16bit_ptw = 1; 
    4855+       if (ath79_soc_rev >= 3) 
    4956+               ath79_ehci_pdata_v2.reset_notifier = ar934x_usb_reset_notifier; 
     
    7885 static void __init qca955x_usb_setup(void) 
    7986 { 
    80 +       ath79_ehci_pdata_v2.qca_force_host_mode = 1; 
    81 +       ath79_ehci_pdata_v2.qca_force_16bit_ptw = 1; 
    8287+       ath79_ehci_pdata_v2.reset_notifier = qca955x_usb_reset_notifier; 
    8388+ 
Note: See TracChangeset for help on using the changeset viewer.