diff options
author | Manjunath Goudar <manjunath.goudar@linaro.org> | 2013-04-02 12:23:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-08 12:33:40 -0400 |
commit | a76dd463c58efa5dfd72c3dd41f5a76b196f7ab1 (patch) | |
tree | b73a75fe1cfceeea319a128fe0f24b5d18f461b0 | |
parent | 58f8b6c4fa5a13cb2ddb400e26e9e65766d71e38 (diff) |
USB: EHCI: make ehci-orion a separate driver
Separate the Orion host controller driver from ehci-hcd host
code into its own driver module because of following reason.
With the multiplatform changes in arm-soc tree, it becomes
possible to enable the mvebu platform (which uses
ehci-orion) at the same time as other platforms that require
a conflicting EHCI bus glue. At the moment, this results
in a warning like
drivers/usb/host/ehci-hcd.c:1297:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
drivers/usb/host/ehci-hcd.c:1277:0: note: this is the location of the previous definition
drivers/usb/host/ehci-orion.c:334:31: warning: 'ehci_orion_driver' defined but not used [-Wunused-variable]
and an ehci driver that only works on one of them.
With the infrastructure added by Alan Stern in patch 3e0232039
"USB: EHCI: prepare to make ehci-hcd a library module", we can
avoid this problem by turning a bus glue into a separate
module, as we do here for the orion bus glue.
An earlier version of this patch was included in 3.9 but caused
a regression there, which has subsequently been fixed.
While we are here, use the opportunity to disabiguate the two
Marvell EHCI controller implementations in Kconfig.
In V4 (arnd):
- Improve Kconfig text
In V3:
- More detail provided in commit message regarding this patch.
- Replaced hcd_name string "ehci-orion" into "orion-ehci".
- MODULE_LICENSE is GPL v2.
- In ehci_init_driver calling second argument passed as NULL instead of
ehci_orion_overrides because ehci_orion_overrides is removed.
In V2:
- Tegra patch related changes removed from this patch.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/Kconfig | 17 | ||||
-rw-r--r-- | drivers/usb/host/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 82 |
4 files changed, 53 insertions, 53 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index f7af0984743b..c49a0b5da1f4 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -163,6 +163,17 @@ config USB_EHCI_HCD_OMAP | |||
163 | Enables support for the on-chip EHCI controller on | 163 | Enables support for the on-chip EHCI controller on |
164 | OMAP3 and later chips. | 164 | OMAP3 and later chips. |
165 | 165 | ||
166 | config USB_EHCI_HCD_ORION | ||
167 | tristate "Support for Marvell EBU on-chip EHCI USB controller" | ||
168 | depends on USB_EHCI_HCD && PLAT_ORION | ||
169 | default y | ||
170 | ---help--- | ||
171 | Enables support for the on-chip EHCI controller on Marvell's | ||
172 | embedded ARM SoCs, including Orion, Kirkwood, Dove, Armada XP, | ||
173 | Armada 370. This is different from the EHCI implementation | ||
174 | on Marvell's mobile PXA and MMP SoC, see "EHCI support for | ||
175 | Marvell PXA/MMP USB controller" for those. | ||
176 | |||
166 | config USB_EHCI_MSM | 177 | config USB_EHCI_MSM |
167 | bool "Support for MSM on-chip EHCI USB controller" | 178 | bool "Support for MSM on-chip EHCI USB controller" |
168 | depends on USB_EHCI_HCD && ARCH_MSM | 179 | depends on USB_EHCI_HCD && ARCH_MSM |
@@ -207,13 +218,17 @@ config USB_EHCI_S5P | |||
207 | Enable support for the S5P SOC's on-chip EHCI controller. | 218 | Enable support for the S5P SOC's on-chip EHCI controller. |
208 | 219 | ||
209 | config USB_EHCI_MV | 220 | config USB_EHCI_MV |
210 | bool "EHCI support for Marvell on-chip controller" | 221 | bool "EHCI support for Marvell PXA/MMP USB controller" |
211 | depends on USB_EHCI_HCD && (ARCH_PXA || ARCH_MMP) | 222 | depends on USB_EHCI_HCD && (ARCH_PXA || ARCH_MMP) |
212 | select USB_EHCI_ROOT_HUB_TT | 223 | select USB_EHCI_ROOT_HUB_TT |
213 | ---help--- | 224 | ---help--- |
214 | Enables support for Marvell (including PXA and MMP series) on-chip | 225 | Enables support for Marvell (including PXA and MMP series) on-chip |
215 | USB SPH and OTG controller. SPH is a single port host, and it can | 226 | USB SPH and OTG controller. SPH is a single port host, and it can |
216 | only be EHCI host. OTG is controller that can switch to host mode. | 227 | only be EHCI host. OTG is controller that can switch to host mode. |
228 | Note that this driver will not work on Marvell's other EHCI | ||
229 | controller used by the EBU-type SoCs including Orion, Kirkwood, | ||
230 | Dova, Armada 370 and Armada XP. See "Support for Marvell EBU | ||
231 | on-chip EHCI USB controller" for those. | ||
217 | 232 | ||
218 | config USB_W90X900_EHCI | 233 | config USB_W90X900_EHCI |
219 | bool "W90X900(W90P910) EHCI support" | 234 | bool "W90X900(W90P910) EHCI support" |
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 56de4106c8b3..9492f50ea2f8 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile | |||
@@ -28,6 +28,7 @@ obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o | |||
28 | obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o | 28 | obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o |
29 | obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o | 29 | obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o |
30 | obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o | 30 | obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o |
31 | obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o | ||
31 | 32 | ||
32 | obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o | 33 | obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o |
33 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o | 34 | obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index b12b97d2ccaf..1f97268bb5d6 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1249,11 +1249,6 @@ MODULE_LICENSE ("GPL"); | |||
1249 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver | 1249 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver |
1250 | #endif | 1250 | #endif |
1251 | 1251 | ||
1252 | #ifdef CONFIG_PLAT_ORION | ||
1253 | #include "ehci-orion.c" | ||
1254 | #define PLATFORM_DRIVER ehci_orion_driver | ||
1255 | #endif | ||
1256 | |||
1257 | #ifdef CONFIG_USB_W90X900_EHCI | 1252 | #ifdef CONFIG_USB_W90X900_EHCI |
1258 | #include "ehci-w90x900.c" | 1253 | #include "ehci-w90x900.c" |
1259 | #define PLATFORM_DRIVER ehci_hcd_w90x900_driver | 1254 | #define PLATFORM_DRIVER ehci_hcd_w90x900_driver |
@@ -1319,6 +1314,7 @@ MODULE_LICENSE ("GPL"); | |||
1319 | !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ | 1314 | !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ |
1320 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ | 1315 | !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ |
1321 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \ | 1316 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \ |
1317 | !IS_ENABLED(CONFIG_USB_EHCI_HCD_ORION) && \ | ||
1322 | !defined(PLATFORM_DRIVER) && \ | 1318 | !defined(PLATFORM_DRIVER) && \ |
1323 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ | 1319 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ |
1324 | !defined(OF_PLATFORM_DRIVER) && \ | 1320 | !defined(OF_PLATFORM_DRIVER) && \ |
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 38c45fb3357e..54c579485150 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -17,6 +17,12 @@ | |||
17 | #include <linux/of.h> | 17 | #include <linux/of.h> |
18 | #include <linux/of_device.h> | 18 | #include <linux/of_device.h> |
19 | #include <linux/of_irq.h> | 19 | #include <linux/of_irq.h> |
20 | #include <linux/usb.h> | ||
21 | #include <linux/usb/hcd.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/dma-mapping.h> | ||
24 | |||
25 | #include "ehci.h" | ||
20 | 26 | ||
21 | #define rdl(off) __raw_readl(hcd->regs + (off)) | 27 | #define rdl(off) __raw_readl(hcd->regs + (off)) |
22 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) | 28 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) |
@@ -34,6 +40,12 @@ | |||
34 | #define USB_PHY_IVREF_CTRL 0x440 | 40 | #define USB_PHY_IVREF_CTRL 0x440 |
35 | #define USB_PHY_TST_GRP_CTRL 0x450 | 41 | #define USB_PHY_TST_GRP_CTRL 0x450 |
36 | 42 | ||
43 | #define DRIVER_DESC "EHCI orion driver" | ||
44 | |||
45 | static const char hcd_name[] = "ehci-orion"; | ||
46 | |||
47 | static struct hc_driver __read_mostly ehci_orion_hc_driver; | ||
48 | |||
37 | /* | 49 | /* |
38 | * Implement Orion USB controller specification guidelines | 50 | * Implement Orion USB controller specification guidelines |
39 | */ | 51 | */ |
@@ -104,51 +116,6 @@ static void orion_usb_phy_v1_setup(struct usb_hcd *hcd) | |||
104 | wrl(USB_MODE, 0x13); | 116 | wrl(USB_MODE, 0x13); |
105 | } | 117 | } |
106 | 118 | ||
107 | static const struct hc_driver ehci_orion_hc_driver = { | ||
108 | .description = hcd_name, | ||
109 | .product_desc = "Marvell Orion EHCI", | ||
110 | .hcd_priv_size = sizeof(struct ehci_hcd), | ||
111 | |||
112 | /* | ||
113 | * generic hardware linkage | ||
114 | */ | ||
115 | .irq = ehci_irq, | ||
116 | .flags = HCD_MEMORY | HCD_USB2, | ||
117 | |||
118 | /* | ||
119 | * basic lifecycle operations | ||
120 | */ | ||
121 | .reset = ehci_setup, | ||
122 | .start = ehci_run, | ||
123 | .stop = ehci_stop, | ||
124 | .shutdown = ehci_shutdown, | ||
125 | |||
126 | /* | ||
127 | * managing i/o requests and associated device resources | ||
128 | */ | ||
129 | .urb_enqueue = ehci_urb_enqueue, | ||
130 | .urb_dequeue = ehci_urb_dequeue, | ||
131 | .endpoint_disable = ehci_endpoint_disable, | ||
132 | .endpoint_reset = ehci_endpoint_reset, | ||
133 | |||
134 | /* | ||
135 | * scheduling support | ||
136 | */ | ||
137 | .get_frame_number = ehci_get_frame, | ||
138 | |||
139 | /* | ||
140 | * root hub support | ||
141 | */ | ||
142 | .hub_status_data = ehci_hub_status_data, | ||
143 | .hub_control = ehci_hub_control, | ||
144 | .bus_suspend = ehci_bus_suspend, | ||
145 | .bus_resume = ehci_bus_resume, | ||
146 | .relinquish_port = ehci_relinquish_port, | ||
147 | .port_handed_over = ehci_port_handed_over, | ||
148 | |||
149 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
150 | }; | ||
151 | |||
152 | static void | 119 | static void |
153 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | 120 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, |
154 | const struct mbus_dram_target_info *dram) | 121 | const struct mbus_dram_target_info *dram) |
@@ -323,8 +290,6 @@ static int ehci_orion_drv_remove(struct platform_device *pdev) | |||
323 | return 0; | 290 | return 0; |
324 | } | 291 | } |
325 | 292 | ||
326 | MODULE_ALIAS("platform:orion-ehci"); | ||
327 | |||
328 | static const struct of_device_id ehci_orion_dt_ids[] = { | 293 | static const struct of_device_id ehci_orion_dt_ids[] = { |
329 | { .compatible = "marvell,orion-ehci", }, | 294 | { .compatible = "marvell,orion-ehci", }, |
330 | {}, | 295 | {}, |
@@ -341,3 +306,26 @@ static struct platform_driver ehci_orion_driver = { | |||
341 | .of_match_table = of_match_ptr(ehci_orion_dt_ids), | 306 | .of_match_table = of_match_ptr(ehci_orion_dt_ids), |
342 | }, | 307 | }, |
343 | }; | 308 | }; |
309 | |||
310 | static int __init ehci_orion_init(void) | ||
311 | { | ||
312 | if (usb_disabled()) | ||
313 | return -ENODEV; | ||
314 | |||
315 | pr_info("%s: " DRIVER_DESC "\n", hcd_name); | ||
316 | |||
317 | ehci_init_driver(&ehci_orion_hc_driver, NULL); | ||
318 | return platform_driver_register(&ehci_orion_driver); | ||
319 | } | ||
320 | module_init(ehci_orion_init); | ||
321 | |||
322 | static void __exit ehci_orion_cleanup(void) | ||
323 | { | ||
324 | platform_driver_unregister(&ehci_orion_driver); | ||
325 | } | ||
326 | module_exit(ehci_orion_cleanup); | ||
327 | |||
328 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
329 | MODULE_ALIAS("platform:orion-ehci"); | ||
330 | MODULE_AUTHOR("Tzachi Perelstein"); | ||
331 | MODULE_LICENSE("GPL v2"); | ||