1 From 77190e21ed262397eb924e6d48e12ecf3e9f6316 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 26 Nov 2011 21:36:50 +0100
4 Subject: [PATCH 21/30] USB: OHCI: remove old SSB OHCI driver
6 This is now replaced by the new ssb USB driver, which also supports
7 devices with an EHCI controller.
9 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 drivers/usb/host/Kconfig | 13 --
12 drivers/usb/host/ohci-hcd.c | 19 ---
13 drivers/usb/host/ohci-ssb.c | 260 -------------------------------------------
14 3 files changed, 0 insertions(+), 292 deletions(-)
15 delete mode 100644 drivers/usb/host/ohci-ssb.c
17 --- a/drivers/usb/host/Kconfig
18 +++ b/drivers/usb/host/Kconfig
19 @@ -351,19 +351,6 @@ config USB_OHCI_HCD_PCI
20 Enables support for PCI-bus plug-in USB controller cards.
23 -config USB_OHCI_HCD_SSB
24 - bool "OHCI support for Broadcom SSB OHCI core"
25 - depends on USB_OHCI_HCD && (SSB = y || SSB = USB_OHCI_HCD) && EXPERIMENTAL
28 - Support for the Sonics Silicon Backplane (SSB) attached
29 - Broadcom USB OHCI core.
31 - This device is present in some embedded devices with
32 - Broadcom based SSB bus.
37 bool "OHCI support for SuperH USB controller"
38 depends on USB_OHCI_HCD && SUPERH
39 --- a/drivers/usb/host/ohci-hcd.c
40 +++ b/drivers/usb/host/ohci-hcd.c
41 @@ -1076,11 +1076,6 @@ MODULE_LICENSE ("GPL");
42 #define PS3_SYSTEM_BUS_DRIVER ps3_ohci_driver
45 -#ifdef CONFIG_USB_OHCI_HCD_SSB
46 -#include "ohci-ssb.c"
47 -#define SSB_OHCI_DRIVER ssb_ohci_driver
50 #ifdef CONFIG_MFD_SM501
51 #include "ohci-sm501.c"
52 #define SM501_OHCI_DRIVER ohci_hcd_sm501_driver
53 @@ -1130,7 +1125,6 @@ MODULE_LICENSE ("GPL");
54 !defined(PS3_SYSTEM_BUS_DRIVER) && \
55 !defined(SM501_OHCI_DRIVER) && \
56 !defined(TMIO_OHCI_DRIVER) && \
57 - !defined(SSB_OHCI_DRIVER) && \
58 !defined(PLATFORM_OHCI_DRIVER)
59 #error "missing bus glue for ohci-hcd"
61 @@ -1197,12 +1191,6 @@ static int __init ohci_hcd_mod_init(void
65 -#ifdef SSB_OHCI_DRIVER
66 - retval = ssb_driver_register(&SSB_OHCI_DRIVER);
71 #ifdef SM501_OHCI_DRIVER
72 retval = platform_driver_register(&SM501_OHCI_DRIVER);
74 @@ -1236,10 +1224,6 @@ static int __init ohci_hcd_mod_init(void
75 platform_driver_unregister(&SM501_OHCI_DRIVER);
78 -#ifdef SSB_OHCI_DRIVER
79 - ssb_driver_unregister(&SSB_OHCI_DRIVER);
83 pci_unregister_driver(&PCI_DRIVER);
85 @@ -1290,9 +1274,6 @@ static void __exit ohci_hcd_mod_exit(voi
86 #ifdef SM501_OHCI_DRIVER
87 platform_driver_unregister(&SM501_OHCI_DRIVER);
89 -#ifdef SSB_OHCI_DRIVER
90 - ssb_driver_unregister(&SSB_OHCI_DRIVER);
93 pci_unregister_driver(&PCI_DRIVER);
95 --- a/drivers/usb/host/ohci-ssb.c
99 - * Sonics Silicon Backplane
100 - * Broadcom USB-core OHCI driver
102 - * Copyright 2007 Michael Buesch <m@bues.ch>
104 - * Derived from the OHCI-PCI driver
105 - * Copyright 1999 Roman Weissgaerber
106 - * Copyright 2000-2002 David Brownell
107 - * Copyright 1999 Linus Torvalds
108 - * Copyright 1999 Gregory P. Smith
110 - * Derived from the USBcore related parts of Broadcom-SB
111 - * Copyright 2005 Broadcom Corporation
113 - * Licensed under the GNU/GPL. See COPYING for details.
115 -#include <linux/ssb/ssb.h>
118 -#define SSB_OHCI_TMSLOW_HOSTMODE (1 << 29)
120 -struct ssb_ohci_device {
121 - struct ohci_hcd ohci; /* _must_ be at the beginning. */
127 -struct ssb_ohci_device *hcd_to_ssb_ohci(struct usb_hcd *hcd)
129 - return (struct ssb_ohci_device *)(hcd->hcd_priv);
133 -static int ssb_ohci_reset(struct usb_hcd *hcd)
135 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
136 - struct ohci_hcd *ohci = &ohcidev->ohci;
139 - ohci_hcd_init(ohci);
140 - err = ohci_init(ohci);
145 -static int ssb_ohci_start(struct usb_hcd *hcd)
147 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
148 - struct ohci_hcd *ohci = &ohcidev->ohci;
151 - err = ohci_run(ohci);
153 - ohci_err(ohci, "can't start\n");
160 -static const struct hc_driver ssb_ohci_hc_driver = {
161 - .description = "ssb-usb-ohci",
162 - .product_desc = "SSB OHCI Controller",
163 - .hcd_priv_size = sizeof(struct ssb_ohci_device),
166 - .flags = HCD_MEMORY | HCD_USB11,
168 - .reset = ssb_ohci_reset,
169 - .start = ssb_ohci_start,
171 - .shutdown = ohci_shutdown,
173 - .urb_enqueue = ohci_urb_enqueue,
174 - .urb_dequeue = ohci_urb_dequeue,
175 - .endpoint_disable = ohci_endpoint_disable,
177 - .get_frame_number = ohci_get_frame,
179 - .hub_status_data = ohci_hub_status_data,
180 - .hub_control = ohci_hub_control,
182 - .bus_suspend = ohci_bus_suspend,
183 - .bus_resume = ohci_bus_resume,
186 - .start_port_reset = ohci_start_port_reset,
189 -static void ssb_ohci_detach(struct ssb_device *dev)
191 - struct usb_hcd *hcd = ssb_get_drvdata(dev);
193 - if (hcd->driver->shutdown)
194 - hcd->driver->shutdown(hcd);
195 - usb_remove_hcd(hcd);
196 - iounmap(hcd->regs);
197 - release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
199 - ssb_device_disable(dev, 0);
202 -static int ssb_ohci_attach(struct ssb_device *dev)
204 - struct ssb_ohci_device *ohcidev;
205 - struct usb_hcd *hcd;
207 - u32 tmp, flags = 0;
209 - if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
210 - dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
211 - return -EOPNOTSUPP;
213 - if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV) {
214 - /* Put the device into host-mode. */
215 - flags |= SSB_OHCI_TMSLOW_HOSTMODE;
216 - ssb_device_enable(dev, flags);
217 - } else if (dev->id.coreid == SSB_DEV_USB20_HOST) {
219 - * USB 2.0 special considerations:
221 - * In addition to the standard SSB reset sequence, the Host
222 - * Control Register must be programmed to bring the USB core
223 - * and various phy components out of reset.
225 - ssb_device_enable(dev, 0);
226 - ssb_write32(dev, 0x200, 0x7ff);
228 - /* Change Flush control reg */
229 - tmp = ssb_read32(dev, 0x400);
231 - ssb_write32(dev, 0x400, tmp);
232 - tmp = ssb_read32(dev, 0x400);
234 - /* Change Shim control reg */
235 - tmp = ssb_read32(dev, 0x304);
237 - ssb_write32(dev, 0x304, tmp);
238 - tmp = ssb_read32(dev, 0x304);
242 - /* Work around for 5354 failures */
243 - if (dev->id.revision == 2 && dev->bus->chip_id == 0x5354) {
244 - /* Change syn01 reg */
246 - ssb_write32(dev, 0x894, tmp);
248 - /* Change syn03 reg */
249 - tmp = ssb_read32(dev, 0x89c);
251 - ssb_write32(dev, 0x89c, tmp);
254 - ssb_device_enable(dev, 0);
256 - hcd = usb_create_hcd(&ssb_ohci_hc_driver, dev->dev,
257 - dev_name(dev->dev));
259 - goto err_dev_disable;
260 - ohcidev = hcd_to_ssb_ohci(hcd);
261 - ohcidev->enable_flags = flags;
263 - tmp = ssb_read32(dev, SSB_ADMATCH0);
264 - hcd->rsrc_start = ssb_admatch_base(tmp);
265 - hcd->rsrc_len = ssb_admatch_size(tmp);
266 - hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
269 - err = usb_add_hcd(hcd, dev->irq, IRQF_SHARED);
273 - ssb_set_drvdata(dev, hcd);
278 - iounmap(hcd->regs);
282 - ssb_device_disable(dev, flags);
286 -static int ssb_ohci_probe(struct ssb_device *dev,
287 - const struct ssb_device_id *id)
292 - /* USBcores are only connected on embedded devices. */
293 - chipid_top = (dev->bus->chip_id & 0xFF00);
294 - if (chipid_top != 0x4700 && chipid_top != 0x5300)
297 - /* TODO: Probably need checks here; is the core connected? */
299 - if (usb_disabled())
302 - /* We currently always attach SSB_DEV_USB11_HOSTDEV
303 - * as HOST OHCI. If we want to attach it as Client device,
304 - * we must branch here and call into the (yet to
305 - * be written) Client mode driver. Same for remove(). */
307 - err = ssb_ohci_attach(dev);
312 -static void ssb_ohci_remove(struct ssb_device *dev)
314 - ssb_ohci_detach(dev);
319 -static int ssb_ohci_suspend(struct ssb_device *dev, pm_message_t state)
321 - ssb_device_disable(dev, 0);
326 -static int ssb_ohci_resume(struct ssb_device *dev)
328 - struct usb_hcd *hcd = ssb_get_drvdata(dev);
329 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
331 - ssb_device_enable(dev, ohcidev->enable_flags);
333 - ohci_finish_controller_resume(hcd);
337 -#else /* !CONFIG_PM */
338 -#define ssb_ohci_suspend NULL
339 -#define ssb_ohci_resume NULL
340 -#endif /* CONFIG_PM */
342 -static const struct ssb_device_id ssb_ohci_table[] = {
343 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV),
344 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV),
345 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV),
348 -MODULE_DEVICE_TABLE(ssb, ssb_ohci_table);
350 -static struct ssb_driver ssb_ohci_driver = {
351 - .name = KBUILD_MODNAME,
352 - .id_table = ssb_ohci_table,
353 - .probe = ssb_ohci_probe,
354 - .remove = ssb_ohci_remove,
355 - .suspend = ssb_ohci_suspend,
356 - .resume = ssb_ohci_resume,