1 --- a/drivers/usb/host/Kconfig
2 +++ b/drivers/usb/host/Kconfig
3 @@ -352,10 +352,15 @@ config USB_OHCI_HCD_PCI
6 config USB_OHCI_HCD_SSB
7 - bool "OHCI support for Broadcom SSB OHCI core"
8 + bool "OHCI support for Broadcom SSB OHCI core (DEPRECATED)"
9 depends on USB_OHCI_HCD && (SSB = y || SSB = USB_OHCI_HCD) && EXPERIMENTAL
11 + select USB_OHCI_HCD_PLATFORM
14 + This option is deprecated now and the driver was removed, use
15 + USB_HCD_SSB and USB_OHCI_HCD_PLATFORM instead.
17 Support for the Sonics Silicon Backplane (SSB) attached
18 Broadcom USB OHCI core.
20 --- a/drivers/usb/host/ohci-hcd.c
21 +++ b/drivers/usb/host/ohci-hcd.c
22 @@ -1076,11 +1076,6 @@ MODULE_LICENSE ("GPL");
23 #define PS3_SYSTEM_BUS_DRIVER ps3_ohci_driver
26 -#ifdef CONFIG_USB_OHCI_HCD_SSB
27 -#include "ohci-ssb.c"
28 -#define SSB_OHCI_DRIVER ssb_ohci_driver
31 #ifdef CONFIG_MFD_SM501
32 #include "ohci-sm501.c"
33 #define SM501_OHCI_DRIVER ohci_hcd_sm501_driver
34 @@ -1129,8 +1124,7 @@ MODULE_LICENSE ("GPL");
35 !defined(SA1111_DRIVER) && \
36 !defined(PS3_SYSTEM_BUS_DRIVER) && \
37 !defined(SM501_OHCI_DRIVER) && \
38 - !defined(TMIO_OHCI_DRIVER) && \
39 - !defined(SSB_OHCI_DRIVER)
40 + !defined(TMIO_OHCI_DRIVER)
41 #error "missing bus glue for ohci-hcd"
44 @@ -1196,12 +1190,6 @@ static int __init ohci_hcd_mod_init(void
48 -#ifdef SSB_OHCI_DRIVER
49 - retval = ssb_driver_register(&SSB_OHCI_DRIVER);
54 #ifdef SM501_OHCI_DRIVER
55 retval = platform_driver_register(&SM501_OHCI_DRIVER);
57 @@ -1225,10 +1213,6 @@ static int __init ohci_hcd_mod_init(void
58 platform_driver_unregister(&SM501_OHCI_DRIVER);
61 -#ifdef SSB_OHCI_DRIVER
62 - ssb_driver_unregister(&SSB_OHCI_DRIVER);
66 pci_unregister_driver(&PCI_DRIVER);
68 @@ -1276,9 +1260,6 @@ static void __exit ohci_hcd_mod_exit(voi
69 #ifdef SM501_OHCI_DRIVER
70 platform_driver_unregister(&SM501_OHCI_DRIVER);
72 -#ifdef SSB_OHCI_DRIVER
73 - ssb_driver_unregister(&SSB_OHCI_DRIVER);
76 pci_unregister_driver(&PCI_DRIVER);
78 --- a/drivers/usb/host/ohci-ssb.c
82 - * Sonics Silicon Backplane
83 - * Broadcom USB-core OHCI driver
85 - * Copyright 2007 Michael Buesch <m@bues.ch>
87 - * Derived from the OHCI-PCI driver
88 - * Copyright 1999 Roman Weissgaerber
89 - * Copyright 2000-2002 David Brownell
90 - * Copyright 1999 Linus Torvalds
91 - * Copyright 1999 Gregory P. Smith
93 - * Derived from the USBcore related parts of Broadcom-SB
94 - * Copyright 2005 Broadcom Corporation
96 - * Licensed under the GNU/GPL. See COPYING for details.
98 -#include <linux/ssb/ssb.h>
101 -#define SSB_OHCI_TMSLOW_HOSTMODE (1 << 29)
103 -struct ssb_ohci_device {
104 - struct ohci_hcd ohci; /* _must_ be at the beginning. */
110 -struct ssb_ohci_device *hcd_to_ssb_ohci(struct usb_hcd *hcd)
112 - return (struct ssb_ohci_device *)(hcd->hcd_priv);
116 -static int ssb_ohci_reset(struct usb_hcd *hcd)
118 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
119 - struct ohci_hcd *ohci = &ohcidev->ohci;
122 - ohci_hcd_init(ohci);
123 - err = ohci_init(ohci);
128 -static int ssb_ohci_start(struct usb_hcd *hcd)
130 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
131 - struct ohci_hcd *ohci = &ohcidev->ohci;
134 - err = ohci_run(ohci);
136 - ohci_err(ohci, "can't start\n");
143 -static const struct hc_driver ssb_ohci_hc_driver = {
144 - .description = "ssb-usb-ohci",
145 - .product_desc = "SSB OHCI Controller",
146 - .hcd_priv_size = sizeof(struct ssb_ohci_device),
149 - .flags = HCD_MEMORY | HCD_USB11,
151 - .reset = ssb_ohci_reset,
152 - .start = ssb_ohci_start,
154 - .shutdown = ohci_shutdown,
156 - .urb_enqueue = ohci_urb_enqueue,
157 - .urb_dequeue = ohci_urb_dequeue,
158 - .endpoint_disable = ohci_endpoint_disable,
160 - .get_frame_number = ohci_get_frame,
162 - .hub_status_data = ohci_hub_status_data,
163 - .hub_control = ohci_hub_control,
165 - .bus_suspend = ohci_bus_suspend,
166 - .bus_resume = ohci_bus_resume,
169 - .start_port_reset = ohci_start_port_reset,
172 -static void ssb_ohci_detach(struct ssb_device *dev)
174 - struct usb_hcd *hcd = ssb_get_drvdata(dev);
176 - if (hcd->driver->shutdown)
177 - hcd->driver->shutdown(hcd);
178 - usb_remove_hcd(hcd);
179 - iounmap(hcd->regs);
180 - release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
182 - ssb_device_disable(dev, 0);
185 -static int ssb_ohci_attach(struct ssb_device *dev)
187 - struct ssb_ohci_device *ohcidev;
188 - struct usb_hcd *hcd;
190 - u32 tmp, flags = 0;
192 - if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
193 - dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
194 - return -EOPNOTSUPP;
196 - if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV) {
197 - /* Put the device into host-mode. */
198 - flags |= SSB_OHCI_TMSLOW_HOSTMODE;
199 - ssb_device_enable(dev, flags);
200 - } else if (dev->id.coreid == SSB_DEV_USB20_HOST) {
202 - * USB 2.0 special considerations:
204 - * In addition to the standard SSB reset sequence, the Host
205 - * Control Register must be programmed to bring the USB core
206 - * and various phy components out of reset.
208 - ssb_device_enable(dev, 0);
209 - ssb_write32(dev, 0x200, 0x7ff);
211 - /* Change Flush control reg */
212 - tmp = ssb_read32(dev, 0x400);
214 - ssb_write32(dev, 0x400, tmp);
215 - tmp = ssb_read32(dev, 0x400);
217 - /* Change Shim control reg */
218 - tmp = ssb_read32(dev, 0x304);
220 - ssb_write32(dev, 0x304, tmp);
221 - tmp = ssb_read32(dev, 0x304);
225 - /* Work around for 5354 failures */
226 - if (dev->id.revision == 2 && dev->bus->chip_id == 0x5354) {
227 - /* Change syn01 reg */
229 - ssb_write32(dev, 0x894, tmp);
231 - /* Change syn03 reg */
232 - tmp = ssb_read32(dev, 0x89c);
234 - ssb_write32(dev, 0x89c, tmp);
237 - ssb_device_enable(dev, 0);
239 - hcd = usb_create_hcd(&ssb_ohci_hc_driver, dev->dev,
240 - dev_name(dev->dev));
242 - goto err_dev_disable;
243 - ohcidev = hcd_to_ssb_ohci(hcd);
244 - ohcidev->enable_flags = flags;
246 - tmp = ssb_read32(dev, SSB_ADMATCH0);
247 - hcd->rsrc_start = ssb_admatch_base(tmp);
248 - hcd->rsrc_len = ssb_admatch_size(tmp);
249 - hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
252 - err = usb_add_hcd(hcd, dev->irq, IRQF_SHARED);
256 - ssb_set_drvdata(dev, hcd);
261 - iounmap(hcd->regs);
265 - ssb_device_disable(dev, flags);
269 -static int ssb_ohci_probe(struct ssb_device *dev,
270 - const struct ssb_device_id *id)
275 - /* USBcores are only connected on embedded devices. */
276 - chipid_top = (dev->bus->chip_id & 0xFF00);
277 - if (chipid_top != 0x4700 && chipid_top != 0x5300)
280 - /* TODO: Probably need checks here; is the core connected? */
282 - if (usb_disabled())
285 - /* We currently always attach SSB_DEV_USB11_HOSTDEV
286 - * as HOST OHCI. If we want to attach it as Client device,
287 - * we must branch here and call into the (yet to
288 - * be written) Client mode driver. Same for remove(). */
290 - err = ssb_ohci_attach(dev);
295 -static void ssb_ohci_remove(struct ssb_device *dev)
297 - ssb_ohci_detach(dev);
302 -static int ssb_ohci_suspend(struct ssb_device *dev, pm_message_t state)
304 - ssb_device_disable(dev, 0);
309 -static int ssb_ohci_resume(struct ssb_device *dev)
311 - struct usb_hcd *hcd = ssb_get_drvdata(dev);
312 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
314 - ssb_device_enable(dev, ohcidev->enable_flags);
316 - ohci_finish_controller_resume(hcd);
320 -#else /* !CONFIG_PM */
321 -#define ssb_ohci_suspend NULL
322 -#define ssb_ohci_resume NULL
323 -#endif /* CONFIG_PM */
325 -static const struct ssb_device_id ssb_ohci_table[] = {
326 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV),
327 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV),
328 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV),
331 -MODULE_DEVICE_TABLE(ssb, ssb_ohci_table);
333 -static struct ssb_driver ssb_ohci_driver = {
334 - .name = KBUILD_MODNAME,
335 - .id_table = ssb_ohci_table,
336 - .probe = ssb_ohci_probe,
337 - .remove = ssb_ohci_remove,
338 - .suspend = ssb_ohci_suspend,
339 - .resume = ssb_ohci_resume,