Changeset 42291


Ignore:
Timestamp:
2014-08-25T18:31:05+02:00 (3 years ago)
Author:
blogic
Message:

ralink: fix mt7620 ohci 3.14

the ohci phy was not reset properly

Signed-off-by: John Crispin <blogic@…>

Location:
trunk/target/linux/ramips/patches-3.14
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/patches-3.14/0037-USB-phy-add-ralink-SoC-driver.patch

    r42040 r42291  
    1212 create mode 100644 drivers/usb/phy/ralink-phy.c 
    1313 
    14 diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig 
    15 index 7d1451d..fc04d76 100644 
    16 --- a/drivers/usb/phy/Kconfig 
    17 +++ b/drivers/usb/phy/Kconfig 
    18 @@ -251,6 +251,14 @@ config USB_RCAR_GEN2_PHY 
     14Index: linux-3.14.16/drivers/usb/phy/Kconfig 
     15=================================================================== 
     16--- linux-3.14.16.orig/drivers/usb/phy/Kconfig  2014-08-08 01:50:59.000000000 +0200 
     17+++ linux-3.14.16/drivers/usb/phy/Kconfig       2014-08-24 12:39:21.094371467 +0200 
     18@@ -251,6 +251,14 @@ 
    1919          To compile this driver as a module, choose M here: the 
    2020          module will be called phy-rcar-gen2-usb. 
     
    3131        bool "Generic ULPI Transceiver Driver" 
    3232        depends on ARM 
    33 diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile 
    34 index be58ada..52d59c1 100644 
    35 --- a/drivers/usb/phy/Makefile 
    36 +++ b/drivers/usb/phy/Makefile 
    37 @@ -33,3 +33,4 @@ obj-$(CONFIG_USB_RCAR_GEN2_PHY)               += phy-rcar-gen2-usb.o 
     33Index: linux-3.14.16/drivers/usb/phy/Makefile 
     34=================================================================== 
     35--- linux-3.14.16.orig/drivers/usb/phy/Makefile 2014-08-08 01:50:59.000000000 +0200 
     36+++ linux-3.14.16/drivers/usb/phy/Makefile      2014-08-24 12:39:21.094371467 +0200 
     37@@ -33,3 +33,4 @@ 
    3838 obj-$(CONFIG_USB_ULPI)                 += phy-ulpi.o 
    3939 obj-$(CONFIG_USB_ULPI_VIEWPORT)                += phy-ulpi-viewport.o 
    4040 obj-$(CONFIG_KEYSTONE_USB_PHY)         += phy-keystone.o 
    4141+obj-$(CONFIG_RALINK_USBPHY)            += ralink-phy.o 
    42 diff --git a/drivers/usb/phy/ralink-phy.c b/drivers/usb/phy/ralink-phy.c 
    43 new file mode 100644 
    44 index 0000000..28046e5 
    45 --- /dev/null 
    46 +++ b/drivers/usb/phy/ralink-phy.c 
    47 @@ -0,0 +1,190 @@ 
     42Index: linux-3.14.16/drivers/usb/phy/ralink-phy.c 
     43=================================================================== 
     44--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     45+++ linux-3.14.16/drivers/usb/phy/ralink-phy.c  2014-08-24 14:28:35.886531881 +0200 
     46@@ -0,0 +1,191 @@ 
    4847+/* 
    4948+ * Copyright (C) 2013 John Crispin <blogic@openwrt.org> 
     
    7675+ 
    7776+#define MT7620_CLKCFG1_UPHY0_CLK_EN    BIT(25) 
     77+#define MT7620_CLKCFG1_UPHY1_CLK_EN    BIT(22) 
    7878+#define RT_CLKCFG1_UPHY1_CLK_EN        BIT(20) 
    7979+#define RT_CLKCFG1_UPHY0_CLK_EN        BIT(18) 
     
    159159+static const struct of_device_id ralink_usbphy_dt_match[] = { 
    160160+       { .compatible = "ralink,rt3xxx-usbphy", .data = (void *) (RT_CLKCFG1_UPHY1_CLK_EN | RT_CLKCFG1_UPHY0_CLK_EN) }, 
    161 +       { .compatible = "ralink,mt7620a-usbphy", .data = (void *) MT7620_CLKCFG1_UPHY0_CLK_EN }, 
     161+       { .compatible = "ralink,mt7620a-usbphy", .data = (void *) (MT7620_CLKCFG1_UPHY1_CLK_EN | MT7620_CLKCFG1_UPHY0_CLK_EN) }, 
    162162+       {}, 
    163163+}; 
     
    236236+MODULE_DESCRIPTION("Ralink USB phy"); 
    237237+MODULE_AUTHOR("John Crispin <blogic@openwrt.org>"); 
    238 --  
    239 1.7.10.4 
    240  
  • trunk/target/linux/ramips/patches-3.14/0038-USB-add-OHCI-EHCI-OF-binding.patch

    r42040 r42291  
    1313 3 files changed, 50 insertions(+), 11 deletions(-) 
    1414 
    15 diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile 
    16 index 1ae2bf3..aaa15d9 100644 
    17 --- a/drivers/usb/Makefile 
    18 +++ b/drivers/usb/Makefile 
    19 @@ -11,6 +11,8 @@ obj-$(CONFIG_USB_DWC2)                += dwc2/ 
     15Index: linux-3.14.16/drivers/usb/Makefile 
     16=================================================================== 
     17--- linux-3.14.16.orig/drivers/usb/Makefile     2014-08-08 01:50:59.000000000 +0200 
     18+++ linux-3.14.16/drivers/usb/Makefile  2014-08-24 14:33:57.590539754 +0200 
     19@@ -11,6 +11,8 @@ 
    2020  
    2121 obj-$(CONFIG_USB_MON)          += mon/ 
     
    2626 obj-$(CONFIG_USB_EHCI_HCD)     += host/ 
    2727 obj-$(CONFIG_USB_ISP116X_HCD)  += host/ 
    28 @@ -41,7 +43,6 @@ obj-$(CONFIG_USB_TMC)         += class/ 
     28@@ -41,7 +43,6 @@ 
    2929 obj-$(CONFIG_USB_STORAGE)      += storage/ 
    3030 obj-$(CONFIG_USB)              += storage/ 
     
    3434  
    3535 obj-$(CONFIG_USB_SERIAL)       += serial/ 
    36 diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c 
    37 index 01536cf..1b9a8f4 100644 
    38 --- a/drivers/usb/host/ehci-platform.c 
    39 +++ b/drivers/usb/host/ehci-platform.c 
     36Index: linux-3.14.16/drivers/usb/host/ehci-platform.c 
     37=================================================================== 
     38--- linux-3.14.16.orig/drivers/usb/host/ehci-platform.c 2014-08-24 12:39:18.806371411 +0200 
     39+++ linux-3.14.16/drivers/usb/host/ehci-platform.c      2014-08-24 12:39:21.102371467 +0200 
    4040@@ -29,6 +29,8 @@ 
    4141 #include <linux/usb.h> 
     
    4747 #include "ehci.h" 
    4848  
    49 @@ -123,6 +125,15 @@ static int ehci_platform_probe(struct platform_device *dev) 
     49@@ -124,6 +126,15 @@ 
    5050        hcd->rsrc_start = res_mem->start; 
    5151        hcd->rsrc_len = resource_size(res_mem); 
     
    6363        if (IS_ERR(hcd->regs)) { 
    6464                err = PTR_ERR(hcd->regs); 
    65 @@ -160,6 +171,9 @@ static int ehci_platform_remove(struct platform_device *dev) 
     65@@ -161,6 +172,9 @@ 
    6666        if (pdata == &ehci_platform_defaults) 
    6767                dev->dev.platform_data = NULL; 
     
    7373 } 
    7474  
    75 @@ -204,9 +218,8 @@ static int ehci_platform_resume(struct device *dev) 
     75@@ -205,9 +219,8 @@ 
    7676 #define ehci_platform_resume   NULL 
    7777 #endif /* CONFIG_PM */ 
     
    8585 }; 
    8686  
    87 @@ -230,7 +243,7 @@ static struct platform_driver ehci_platform_driver = { 
     87@@ -231,7 +244,7 @@ 
    8888                .owner  = THIS_MODULE, 
    8989                .name   = "ehci-platform", 
     
    9494 }; 
    9595  
    96 diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c 
    97 index 68f674c..2a73fed 100644 
    98 --- a/drivers/usb/host/ohci-platform.c 
    99 +++ b/drivers/usb/host/ohci-platform.c 
    100 @@ -23,17 +23,20 @@ 
     96Index: linux-3.14.16/drivers/usb/host/ohci-platform.c 
     97=================================================================== 
     98--- linux-3.14.16.orig/drivers/usb/host/ohci-platform.c 2014-08-08 01:50:59.000000000 +0200 
     99+++ linux-3.14.16/drivers/usb/host/ohci-platform.c      2014-08-24 12:41:51.422375146 +0200 
     100@@ -22,18 +22,22 @@ 
     101 #include <linux/platform_device.h> 
    101102 #include <linux/usb/ohci_pdriver.h> 
    102103 #include <linux/usb.h> 
     104+#include <linux/usb/phy.h> 
    103105 #include <linux/usb/hcd.h> 
    104106+#include <linux/dma-mapping.h> 
     
    116118        struct platform_device *pdev = to_platform_device(hcd->self.controller); 
    117119-       struct usb_ohci_pdata *pdata = dev_get_platdata(&pdev->dev); 
    118 +       struct usb_ohci_pdata *pdata; 
     120+       struct usb_ohci_pdata *pdata = dev_get_platdata(&pdev->dev);; 
    119121        struct ohci_hcd *ohci = hcd_to_ohci(hcd); 
    120122  
    121123        if (pdata->big_endian_desc) 
    122 @@ -63,11 +66,18 @@ static int ohci_platform_probe(struct platform_device *dev) 
     124@@ -63,11 +67,18 @@ 
    123125        int irq; 
    124126        int err = -ENOMEM; 
     
    128130-               return -ENODEV; 
    129131-       } 
    130 - 
    131132+       /* 
    132133+        * use reasonable defaults so platforms don't have to provide these. 
     
    139140+       if (!dev->dev.coherent_dma_mask) 
    140141+               dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 
    141 + 
     142  
    142143+       pdata = dev->dev.platform_data; 
    143144        if (usb_disabled()) 
    144145                return -ENODEV; 
    145146  
    146 @@ -99,6 +109,12 @@ static int ohci_platform_probe(struct platform_device *dev) 
     147@@ -99,6 +110,12 @@ 
    147148        hcd->rsrc_start = res_mem->start; 
    148149        hcd->rsrc_len = resource_size(res_mem); 
     
    157158        if (IS_ERR(hcd->regs)) { 
    158159                err = PTR_ERR(hcd->regs); 
    159 @@ -134,6 +150,9 @@ static int ohci_platform_remove(struct platform_device *dev) 
     160@@ -134,6 +151,9 @@ 
    160161        if (pdata->power_off) 
    161162                pdata->power_off(dev); 
     
    167168 } 
    168169  
    169 @@ -180,6 +199,11 @@ static int ohci_platform_resume(struct device *dev) 
     170@@ -180,6 +200,11 @@ 
    170171 #define ohci_platform_resume   NULL 
    171172 #endif /* CONFIG_PM */ 
     
    179180        { "ohci-platform", 0 }, 
    180181        { } 
    181 @@ -200,6 +224,7 @@ static struct platform_driver ohci_platform_driver = { 
     182@@ -200,6 +225,7 @@ 
    182183                .owner  = THIS_MODULE, 
    183184                .name   = "ohci-platform", 
     
    187188 }; 
    188189  
    189 --  
    190 1.7.10.4 
    191  
Note: See TracChangeset for help on using the changeset viewer.