diff options
author | Ronen Shitrit <rshitrit@marvell.com> | 2008-09-17 03:08:05 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-12-04 01:28:14 -0500 |
commit | fb6f552930e52699c8ac452c5a79ec3e97e6fc73 (patch) | |
tree | 77bbbfc5168695ec20c525eb53094d6d0b45e0ce | |
parent | 061e41fdb5047b1fb161e89664057835935ca1d2 (diff) |
[ARM] Orion: add the option to support different ehci phy initialization
The Orion ehci driver serves the Orion, kirkwood and DD Soc families.
Since each of those integrate a different USB phy we should have the
ability to use few initialization sequences or to leave the boot loader
phy settings as is.
Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/common.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/common.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/ehci-orion.h | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 17 |
5 files changed, 25 insertions, 3 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 0bb1fbd84ccb..b5c684d96e4e 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -57,6 +57,7 @@ void __init kirkwood_map_io(void) | |||
57 | ****************************************************************************/ | 57 | ****************************************************************************/ |
58 | static struct orion_ehci_data kirkwood_ehci_data = { | 58 | static struct orion_ehci_data kirkwood_ehci_data = { |
59 | .dram = &kirkwood_mbus_dram_info, | 59 | .dram = &kirkwood_mbus_dram_info, |
60 | .phy_version = EHCI_PHY_NA, | ||
60 | }; | 61 | }; |
61 | 62 | ||
62 | static u64 ehci_dmamask = 0xffffffffUL; | 63 | static u64 ehci_dmamask = 0xffffffffUL; |
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 238a2f8c2d52..b0e4e0d8f506 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -167,6 +167,7 @@ void __init mv78xx0_map_io(void) | |||
167 | ****************************************************************************/ | 167 | ****************************************************************************/ |
168 | static struct orion_ehci_data mv78xx0_ehci_data = { | 168 | static struct orion_ehci_data mv78xx0_ehci_data = { |
169 | .dram = &mv78xx0_mbus_dram_info, | 169 | .dram = &mv78xx0_mbus_dram_info, |
170 | .phy_version = EHCI_PHY_NA, | ||
170 | }; | 171 | }; |
171 | 172 | ||
172 | static u64 ehci_dmamask = 0xffffffffUL; | 173 | static u64 ehci_dmamask = 0xffffffffUL; |
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 437065c25c9c..0a623379789f 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -72,6 +72,7 @@ void __init orion5x_map_io(void) | |||
72 | ****************************************************************************/ | 72 | ****************************************************************************/ |
73 | static struct orion_ehci_data orion5x_ehci_data = { | 73 | static struct orion_ehci_data orion5x_ehci_data = { |
74 | .dram = &orion5x_mbus_dram_info, | 74 | .dram = &orion5x_mbus_dram_info, |
75 | .phy_version = EHCI_PHY_ORION, | ||
75 | }; | 76 | }; |
76 | 77 | ||
77 | static u64 ehci_dmamask = 0xffffffffUL; | 78 | static u64 ehci_dmamask = 0xffffffffUL; |
diff --git a/arch/arm/plat-orion/include/plat/ehci-orion.h b/arch/arm/plat-orion/include/plat/ehci-orion.h index 64343051095a..4ec668e77460 100644 --- a/arch/arm/plat-orion/include/plat/ehci-orion.h +++ b/arch/arm/plat-orion/include/plat/ehci-orion.h | |||
@@ -11,8 +11,16 @@ | |||
11 | 11 | ||
12 | #include <linux/mbus.h> | 12 | #include <linux/mbus.h> |
13 | 13 | ||
14 | enum orion_ehci_phy_ver { | ||
15 | EHCI_PHY_ORION, | ||
16 | EHCI_PHY_DD, | ||
17 | EHCI_PHY_KW, | ||
18 | EHCI_PHY_NA, | ||
19 | }; | ||
20 | |||
14 | struct orion_ehci_data { | 21 | struct orion_ehci_data { |
15 | struct mbus_dram_target_info *dram; | 22 | struct mbus_dram_target_info *dram; |
23 | enum orion_ehci_phy_ver phy_version; | ||
16 | }; | 24 | }; |
17 | 25 | ||
18 | 26 | ||
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 5416cf969005..9d487908012e 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -33,8 +33,9 @@ | |||
33 | /* | 33 | /* |
34 | * Implement Orion USB controller specification guidelines | 34 | * Implement Orion USB controller specification guidelines |
35 | */ | 35 | */ |
36 | static void orion_usb_setup(struct usb_hcd *hcd) | 36 | static void orion_usb_phy_v1_setup(struct usb_hcd *hcd) |
37 | { | 37 | { |
38 | /* The below GLs are according to the Orion Errata document */ | ||
38 | /* | 39 | /* |
39 | * Clear interrupt cause and mask | 40 | * Clear interrupt cause and mask |
40 | */ | 41 | */ |
@@ -258,9 +259,19 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev) | |||
258 | ehci_orion_conf_mbus_windows(hcd, pd->dram); | 259 | ehci_orion_conf_mbus_windows(hcd, pd->dram); |
259 | 260 | ||
260 | /* | 261 | /* |
261 | * setup Orion USB controller | 262 | * setup Orion USB controller. |
262 | */ | 263 | */ |
263 | orion_usb_setup(hcd); | 264 | switch (pd->phy_version) { |
265 | case EHCI_PHY_NA: /* dont change USB phy settings */ | ||
266 | break; | ||
267 | case EHCI_PHY_ORION: | ||
268 | orion_usb_phy_v1_setup(hcd); | ||
269 | break; | ||
270 | case EHCI_PHY_DD: | ||
271 | case EHCI_PHY_KW: | ||
272 | default: | ||
273 | printk(KERN_WARNING "Orion ehci -USB phy version isn't supported.\n"); | ||
274 | } | ||
264 | 275 | ||
265 | err = usb_add_hcd(hcd, irq, IRQF_SHARED | IRQF_DISABLED); | 276 | err = usb_add_hcd(hcd, irq, IRQF_SHARED | IRQF_DISABLED); |
266 | if (err) | 277 | if (err) |