aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-ssb.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-08-11 03:36:51 -0400
committerJiri Kosina <jkosina@suse.cz>2010-08-11 03:36:51 -0400
commit6396fc3b3ff3f6b942992b653a62df11dcef9bea (patch)
treedb3c7cbe833b43c653adc99f70941431c5ff7c4e /drivers/usb/host/ohci-ssb.c
parent4785879e4d340e24e54f6de2ccfc42728b912808 (diff)
parent3d30701b58970425e1d45994d6cb82f828924fdd (diff)
Merge branch 'master' into for-next
Conflicts: fs/exofs/inode.c
Diffstat (limited to 'drivers/usb/host/ohci-ssb.c')
-rw-r--r--drivers/usb/host/ohci-ssb.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/drivers/usb/host/ohci-ssb.c b/drivers/usb/host/ohci-ssb.c
index 23fd6a886bdd..48ee6943bf35 100644
--- a/drivers/usb/host/ohci-ssb.c
+++ b/drivers/usb/host/ohci-ssb.c
@@ -93,8 +93,11 @@ static void ssb_ohci_detach(struct ssb_device *dev)
93{ 93{
94 struct usb_hcd *hcd = ssb_get_drvdata(dev); 94 struct usb_hcd *hcd = ssb_get_drvdata(dev);
95 95
96 if (hcd->driver->shutdown)
97 hcd->driver->shutdown(hcd);
96 usb_remove_hcd(hcd); 98 usb_remove_hcd(hcd);
97 iounmap(hcd->regs); 99 iounmap(hcd->regs);
100 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
98 usb_put_hcd(hcd); 101 usb_put_hcd(hcd);
99 ssb_device_disable(dev, 0); 102 ssb_device_disable(dev, 0);
100} 103}
@@ -106,10 +109,52 @@ static int ssb_ohci_attach(struct ssb_device *dev)
106 int err = -ENOMEM; 109 int err = -ENOMEM;
107 u32 tmp, flags = 0; 110 u32 tmp, flags = 0;
108 111
109 if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV) 112 if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
110 flags |= SSB_OHCI_TMSLOW_HOSTMODE; 113 dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
114 return -EOPNOTSUPP;
111 115
112 ssb_device_enable(dev, flags); 116 if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV) {
117 /* Put the device into host-mode. */
118 flags |= SSB_OHCI_TMSLOW_HOSTMODE;
119 ssb_device_enable(dev, flags);
120 } else if (dev->id.coreid == SSB_DEV_USB20_HOST) {
121 /*
122 * USB 2.0 special considerations:
123 *
124 * In addition to the standard SSB reset sequence, the Host
125 * Control Register must be programmed to bring the USB core
126 * and various phy components out of reset.
127 */
128 ssb_device_enable(dev, 0);
129 ssb_write32(dev, 0x200, 0x7ff);
130
131 /* Change Flush control reg */
132 tmp = ssb_read32(dev, 0x400);
133 tmp &= ~8;
134 ssb_write32(dev, 0x400, tmp);
135 tmp = ssb_read32(dev, 0x400);
136
137 /* Change Shim control reg */
138 tmp = ssb_read32(dev, 0x304);
139 tmp &= ~0x100;
140 ssb_write32(dev, 0x304, tmp);
141 tmp = ssb_read32(dev, 0x304);
142
143 udelay(1);
144
145 /* Work around for 5354 failures */
146 if (dev->id.revision == 2 && dev->bus->chip_id == 0x5354) {
147 /* Change syn01 reg */
148 tmp = 0x00fe00fe;
149 ssb_write32(dev, 0x894, tmp);
150
151 /* Change syn03 reg */
152 tmp = ssb_read32(dev, 0x89c);
153 tmp |= 0x1;
154 ssb_write32(dev, 0x89c, tmp);
155 }
156 } else
157 ssb_device_enable(dev, 0);
113 158
114 hcd = usb_create_hcd(&ssb_ohci_hc_driver, dev->dev, 159 hcd = usb_create_hcd(&ssb_ohci_hc_driver, dev->dev,
115 dev_name(dev->dev)); 160 dev_name(dev->dev));
@@ -200,6 +245,7 @@ static int ssb_ohci_resume(struct ssb_device *dev)
200static const struct ssb_device_id ssb_ohci_table[] = { 245static const struct ssb_device_id ssb_ohci_table[] = {
201 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV), 246 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV),
202 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV), 247 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV),
248 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV),
203 SSB_DEVTABLE_END 249 SSB_DEVTABLE_END
204}; 250};
205MODULE_DEVICE_TABLE(ssb, ssb_ohci_table); 251MODULE_DEVICE_TABLE(ssb, ssb_ohci_table);