Commit 72053353583230952c4b187e110e9da00dfc3afb

Authored by Andrew Lunn
Committed by Olof Johansson
1 parent b065403710

ARM: orion: Fix USB phy for orion5x.

The patch "ARM: orion: Consolidate USB platform setup code.", commit
4fcd3f374a928081d391cd9a570afe3b2c692fdc broke USB on TS-7800 and
other orion5x boards, because the wrong type of PHY was being passed
to the EHCI driver in the platform data. Orion5x needs EHCI_PHY_ORION
and all the others want EHCI_PHY_NA.

Allow the mach- code to tell the generic plat-orion code which USB PHY
enum to place into the platform data.

Version 2: Rebase to v3.3-rc2.

Reported-by: Ambroz Bizjak <ambrop7@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Ambroz Bizjak <ambrop7@gmail.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>

Showing 6 changed files with 15 additions and 10 deletions Side-by-side Diff

arch/arm/mach-dove/common.c
... ... @@ -28,6 +28,7 @@
28 28 #include <asm/mach/arch.h>
29 29 #include <linux/irq.h>
30 30 #include <plat/time.h>
  31 +#include <plat/ehci-orion.h>
31 32 #include <plat/common.h>
32 33 #include <plat/addr-map.h>
33 34 #include "common.h"
... ... @@ -71,7 +72,7 @@
71 72 ****************************************************************************/
72 73 void __init dove_ehci0_init(void)
73 74 {
74   - orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0);
  75 + orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0, EHCI_PHY_NA);
75 76 }
76 77  
77 78 /*****************************************************************************
arch/arm/mach-kirkwood/common.c
... ... @@ -27,6 +27,7 @@
27 27 #include <plat/cache-feroceon-l2.h>
28 28 #include <plat/mvsdio.h>
29 29 #include <plat/orion_nand.h>
  30 +#include <plat/ehci-orion.h>
30 31 #include <plat/common.h>
31 32 #include <plat/time.h>
32 33 #include <plat/addr-map.h>
... ... @@ -73,7 +74,7 @@
73 74 void __init kirkwood_ehci_init(void)
74 75 {
75 76 kirkwood_clk_ctrl |= CGC_USB0;
76   - orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB);
  77 + orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB, EHCI_PHY_NA);
77 78 }
78 79  
79 80  
arch/arm/mach-mv78xx0/common.c
... ... @@ -19,6 +19,7 @@
19 19 #include <mach/mv78xx0.h>
20 20 #include <mach/bridge-regs.h>
21 21 #include <plat/cache-feroceon-l2.h>
  22 +#include <plat/ehci-orion.h>
22 23 #include <plat/orion_nand.h>
23 24 #include <plat/time.h>
24 25 #include <plat/common.h>
... ... @@ -169,7 +170,7 @@
169 170 ****************************************************************************/
170 171 void __init mv78xx0_ehci0_init(void)
171 172 {
172   - orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0);
  173 + orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0, EHCI_PHY_NA);
173 174 }
174 175  
175 176  
arch/arm/mach-orion5x/common.c
... ... @@ -29,6 +29,7 @@
29 29 #include <mach/hardware.h>
30 30 #include <mach/orion5x.h>
31 31 #include <plat/orion_nand.h>
  32 +#include <plat/ehci-orion.h>
32 33 #include <plat/time.h>
33 34 #include <plat/common.h>
34 35 #include <plat/addr-map.h>
... ... @@ -72,7 +73,8 @@
72 73 ****************************************************************************/
73 74 void __init orion5x_ehci0_init(void)
74 75 {
75   - orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL);
  76 + orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL,
  77 + EHCI_PHY_ORION);
76 78 }
77 79  
78 80  
arch/arm/plat-orion/common.c
... ... @@ -789,10 +789,7 @@
789 789 /*****************************************************************************
790 790 * EHCI
791 791 ****************************************************************************/
792   -static struct orion_ehci_data orion_ehci_data = {
793   - .phy_version = EHCI_PHY_NA,
794   -};
795   -
  792 +static struct orion_ehci_data orion_ehci_data;
796 793 static u64 ehci_dmamask = DMA_BIT_MASK(32);
797 794  
798 795  
799 796  
... ... @@ -812,8 +809,10 @@
812 809 };
813 810  
814 811 void __init orion_ehci_init(unsigned long mapbase,
815   - unsigned long irq)
  812 + unsigned long irq,
  813 + enum orion_ehci_phy_ver phy_version)
816 814 {
  815 + orion_ehci_data.phy_version = phy_version;
817 816 fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
818 817 irq);
819 818  
arch/arm/plat-orion/include/plat/common.h
... ... @@ -89,7 +89,8 @@
89 89 unsigned long irq_1);
90 90  
91 91 void __init orion_ehci_init(unsigned long mapbase,
92   - unsigned long irq);
  92 + unsigned long irq,
  93 + enum orion_ehci_phy_ver phy_version);
93 94  
94 95 void __init orion_ehci_1_init(unsigned long mapbase,
95 96 unsigned long irq);