24 static void ps3_ehci_setup_insnreg(
struct ehci_hcd *ehci)
28 enum ps3_ehci_hc_insnreg {
29 ps3_ehci_hc_insnreg01 = 0x084,
30 ps3_ehci_hc_insnreg02 = 0x088,
31 ps3_ehci_hc_insnreg03 = 0x08c,
44 ps3_ehci_hc_insnreg01);
49 ps3_ehci_hc_insnreg03);
52 static int ps3_ehci_hc_reset(
struct usb_hcd *hcd)
55 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
58 ehci->
caps = hcd->regs;
60 result = ehci_setup(hcd);
64 ps3_ehci_setup_insnreg(ehci);
69 static const struct hc_driver ps3_ehci_hc_driver = {
70 .description = hcd_name,
71 .product_desc =
"PS3 EHCI Host Controller",
72 .hcd_priv_size =
sizeof(
struct ehci_hcd),
74 .flags = HCD_MEMORY | HCD_USB2,
75 .reset = ps3_ehci_hc_reset,
78 .shutdown = ehci_shutdown,
79 .urb_enqueue = ehci_urb_enqueue,
80 .urb_dequeue = ehci_urb_dequeue,
81 .endpoint_disable = ehci_endpoint_disable,
82 .endpoint_reset = ehci_endpoint_reset,
83 .get_frame_number = ehci_get_frame,
84 .hub_status_data = ehci_hub_status_data,
85 .hub_control = ehci_hub_control,
86 #if defined(CONFIG_PM)
90 .relinquish_port = ehci_relinquish_port,
91 .port_handed_over = ehci_port_handed_over,
93 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
111 dev_dbg(&dev->
core,
"%s:%d: ps3_open_hv_device failed\n",
119 dev_dbg(&dev->
core,
"%s:%d: ps3_dma_region_create failed: "
120 "(%d)\n", __func__, __LINE__, result);
121 BUG_ON(
"check region type");
122 goto fail_dma_region;
128 dev_dbg(&dev->
core,
"%s:%d: ps3_map_mmio_region failed\n",
131 goto fail_mmio_region;
134 dev_dbg(&dev->
core,
"%s:%d: mmio mapped_addr %lxh\n", __func__,
135 __LINE__, dev->
m_region->lpar_addr);
140 dev_dbg(&dev->
core,
"%s:%d: ps3_construct_io_irq(%d) failed.\n",
141 __func__, __LINE__, virq);
146 dev->
core.dma_mask = &dummy_mask;
151 dev_dbg(&dev->
core,
"%s:%d: usb_create_hcd failed\n", __func__,
154 goto fail_create_hcd;
157 hcd->rsrc_start = dev->
m_region->lpar_addr;
161 dev_dbg(&dev->
core,
"%s:%d: request_mem_region failed\n",
167 dev_dbg(&dev->
core,
"%s:%d: ioremap failed\n", __func__,
173 dev_dbg(&dev->
core,
"%s:%d: hcd->rsrc_start %lxh\n", __func__, __LINE__,
174 (
unsigned long)hcd->rsrc_start);
175 dev_dbg(&dev->
core,
"%s:%d: hcd->rsrc_len %lxh\n", __func__, __LINE__,
176 (
unsigned long)hcd->rsrc_len);
177 dev_dbg(&dev->
core,
"%s:%d: hcd->regs %lxh\n", __func__, __LINE__,
178 (
unsigned long)hcd->regs);
179 dev_dbg(&dev->
core,
"%s:%d: virq %lu\n", __func__, __LINE__,
180 (
unsigned long)virq);
182 ps3_system_bus_set_drvdata(dev, hcd);
187 dev_dbg(&dev->
core,
"%s:%d: usb_add_hcd failed (%d)\n",
188 __func__, __LINE__, result);
215 struct usb_hcd *hcd = ps3_system_bus_get_drvdata(dev);
219 dev_dbg(&dev->
core,
"%s:%d: regs %p\n", __func__, __LINE__, hcd->regs);
220 dev_dbg(&dev->
core,
"%s:%d: irq %u\n", __func__, __LINE__, hcd->irq);
227 ps3_system_bus_set_drvdata(dev,
NULL);
246 return firmware_has_feature(FW_FEATURE_PS3_LV1)
253 if (firmware_has_feature(FW_FEATURE_PS3_LV1))
260 .core.name =
"ps3-ehci-driver",
263 .probe = ps3_ehci_probe,
264 .remove = ps3_ehci_remove,
265 .shutdown = ps3_ehci_remove,