16 #include <mach/hardware.h>
22 #error "This file is SA-1111 bus glue. CONFIG_SA1111 must be defined."
25 #define USB_STATUS 0x0118
26 #define USB_RESET 0x011c
27 #define USB_IRQTEST 0x0120
29 #define USB_RESET_FORCEIFRESET (1 << 0)
30 #define USB_RESET_FORCEHCRESET (1 << 1)
31 #define USB_RESET_CLKGENRESET (1 << 2)
32 #define USB_RESET_SIMSCALEDOWN (1 << 3)
33 #define USB_RESET_USBINTTEST (1 << 4)
34 #define USB_RESET_SLEEPSTBYEN (1 << 5)
35 #define USB_RESET_PWRSENSELOW (1 << 6)
36 #define USB_RESET_PWRCTRLLOW (1 << 7)
38 #define USB_STATUS_IRQHCIRMTWKUP (1 << 7)
39 #define USB_STATUS_IRQHCIBUFFACC (1 << 8)
40 #define USB_STATUS_NIRQHCIM (1 << 9)
41 #define USB_STATUS_NHCIMFCLR (1 << 10)
42 #define USB_STATUS_USBPWRSENSE (1 << 11)
45 static void dump_hci_status(
struct usb_hcd *hcd,
const char *
label)
58 static int ohci_sa1111_reset(
struct usb_hcd *hcd)
63 return ohci_init(ohci);
66 static int __devinit ohci_sa1111_start(
struct usb_hcd *hcd)
79 static const struct hc_driver ohci_sa1111_hc_driver = {
80 .description = hcd_name,
81 .product_desc =
"SA-1111 OHCI",
82 .hcd_priv_size =
sizeof(
struct ohci_hcd),
88 .flags = HCD_USB11 | HCD_MEMORY,
93 .reset = ohci_sa1111_reset,
94 .start = ohci_sa1111_start,
96 .shutdown = ohci_shutdown,
101 .urb_enqueue = ohci_urb_enqueue,
102 .urb_dequeue = ohci_urb_dequeue,
103 .endpoint_disable = ohci_endpoint_disable,
108 .get_frame_number = ohci_get_frame,
113 .hub_status_data = ohci_hub_status_data,
114 .hub_control = ohci_hub_control,
116 .bus_suspend = ohci_bus_suspend,
117 .bus_resume = ohci_bus_resume,
124 unsigned int usb_rst = 0;
127 dev_dbg(&dev->
dev,
"starting SA-1111 OHCI USB Controller\n");
129 if (machine_is_xp860() ||
131 machine_is_pfs168() ||
155 static void sa1111_stop_hc(
struct sa1111_dev *dev)
157 unsigned int usb_rst;
159 dev_dbg(&dev->
dev,
"stopping SA-1111 OHCI USB Controller\n");
180 static int ohci_hcd_sa1111_probe(
struct sa1111_dev *dev)
192 hcd->rsrc_start = dev->
res.start;
193 hcd->rsrc_len = resource_size(&dev->
res);
196 dev_dbg(&dev->
dev,
"request_mem_region failed\n");
203 ret = sa1111_start_hc(dev);
226 static int ohci_hcd_sa1111_remove(
struct sa1111_dev *dev)
238 static void ohci_hcd_sa1111_shutdown(
struct sa1111_dev *dev)
242 if (
test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
243 hcd->driver->shutdown(hcd);
250 .name =
"sa1111-ohci",
254 .probe = ohci_hcd_sa1111_probe,
255 .remove = ohci_hcd_sa1111_remove,
256 .shutdown = ohci_hcd_sa1111_shutdown,