19 #define USB_CTRL_MODE_STREAM_DISABLE 0x10
22 #define USB_CTRL_FIFO_THRESH 0x00300000
25 #define USB_EHCI_REG_USB_MODE 0x68
28 #define USB_EHCI_REG_USB_FIFO 0x24
31 #define USB_EHCI_REG_USB_STATUS 0x44
34 #define USB_EHCI_REG_BIT_STAT_STS (1<<29)
37 #define MSP_PIN_USB0_HOST_DEV 49
40 #define MSP_PIN_USB1_HOST_DEV 50
43 static void usb_hcd_tdi_set_mode(
struct ehci_hcd *ehci)
57 val = ehci_readl(ehci, (
u32 *)base);
62 val = ehci_readl(ehci, (
u32 *)statreg);
64 ehci_writel(ehci, val, (
u32 *)statreg);
71 #ifdef CONFIG_MSP_HAS_DUAL_USB
77 static int ehci_msp_setup(
struct usb_hcd *hcd)
79 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
85 ehci->
caps = hcd->regs;
88 retval = ehci_setup(hcd);
92 usb_hcd_tdi_set_mode(ehci);
93 ehci_port_power(ehci, 0);
114 res_len = resource_size(res);
130 res_len = resource_size(res);
144 res_len = resource_size(res);
150 res_len = resource_size(res);
152 dev_err(&pdev->
dev,
"Failed to map non-EHCI regs.\n");
179 pr_debug(
"No IOMEM resource info for %s.\n", dev->
name);
183 hcd->rsrc_start = res->
start;
184 hcd->rsrc_len = resource_size(res);
208 ehci = hcd_to_ehci(hcd);
250 #ifdef CONFIG_MSP_HAS_DUAL_USB
256 static irqreturn_t ehci_msp_irq(
struct usb_hcd *hcd)
259 struct device *dev = hcd->self.controller;
262 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
268 int_src = ehci_readl(ehci, &mdev->
mab_regs->int_stat);
269 if (int_src & (1 << pdev->
id))
270 return ehci_irq(hcd);
277 static const struct hc_driver ehci_msp_hc_driver = {
278 .description = hcd_name,
279 .product_desc =
"PMC MSP EHCI",
280 .hcd_priv_size =
sizeof(
struct ehci_hcd),
285 #ifdef CONFIG_MSP_HAS_DUAL_USB
290 .flags = HCD_MEMORY | HCD_USB2,
295 .reset = ehci_msp_setup,
297 .shutdown = ehci_shutdown,
304 .urb_enqueue = ehci_urb_enqueue,
305 .urb_dequeue = ehci_urb_dequeue,
306 .endpoint_disable = ehci_endpoint_disable,
307 .endpoint_reset = ehci_endpoint_reset,
312 .get_frame_number = ehci_get_frame,
317 .hub_status_data = ehci_hub_status_data,
318 .hub_control = ehci_hub_control,
321 .relinquish_port = ehci_relinquish_port,
322 .port_handed_over = ehci_port_handed_over,
324 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
331 pr_debug(
"In ehci_hcd_msp_drv_probe");
337 #ifdef CONFIG_MSP_HAS_DUAL_USB
348 struct usb_hcd *hcd = platform_get_drvdata(pdev);
354 #ifdef CONFIG_MSP_HAS_DUAL_USB
364 .probe = ehci_hcd_msp_drv_probe,
365 .remove = ehci_hcd_msp_drv_remove,
367 .name =
"pmcmsp-ehci",