diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-16 06:37:03 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-24 07:30:12 -0400 |
commit | 2213536d78a2ed96e870396b06ee53f4a54a1e42 (patch) | |
tree | 91e611020dd8046f108a9ff01807ffb8436d9c36 /drivers/usb | |
parent | ea8c00ac18198763bceb7ca53d26df4aa8d3c414 (diff) |
ARM: sa1111: move USB interface register definitions to ohci-sa1111.c
Move the USB interface register definitions into the driver, rather
than keeping them in a common place.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ohci-sa1111.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 48300080433c..585e53eabff6 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -22,6 +22,25 @@ | |||
22 | #error "This file is SA-1111 bus glue. CONFIG_SA1111 must be defined." | 22 | #error "This file is SA-1111 bus glue. CONFIG_SA1111 must be defined." |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #define USB_STATUS 0x0118 | ||
26 | #define USB_RESET 0x011c | ||
27 | #define USB_IRQTEST 0x0120 | ||
28 | |||
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) | ||
37 | |||
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) | ||
43 | |||
25 | extern int usb_disabled(void); | 44 | extern int usb_disabled(void); |
26 | 45 | ||
27 | /*-------------------------------------------------------------------------*/ | 46 | /*-------------------------------------------------------------------------*/ |
@@ -45,7 +64,7 @@ static int sa1111_start_hc(struct sa1111_dev *dev) | |||
45 | * host controller in reset. | 64 | * host controller in reset. |
46 | */ | 65 | */ |
47 | sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, | 66 | sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, |
48 | dev->mapbase + SA1111_USB_RESET); | 67 | dev->mapbase + USB_RESET); |
49 | 68 | ||
50 | /* | 69 | /* |
51 | * Now, carefully enable the USB clock, and take | 70 | * Now, carefully enable the USB clock, and take |
@@ -54,7 +73,7 @@ static int sa1111_start_hc(struct sa1111_dev *dev) | |||
54 | ret = sa1111_enable_device(dev); | 73 | ret = sa1111_enable_device(dev); |
55 | if (ret == 0) { | 74 | if (ret == 0) { |
56 | udelay(11); | 75 | udelay(11); |
57 | sa1111_writel(usb_rst, dev->mapbase + SA1111_USB_RESET); | 76 | sa1111_writel(usb_rst, dev->mapbase + USB_RESET); |
58 | } | 77 | } |
59 | 78 | ||
60 | return ret; | 79 | return ret; |
@@ -69,9 +88,9 @@ static void sa1111_stop_hc(struct sa1111_dev *dev) | |||
69 | /* | 88 | /* |
70 | * Put the USB host controller into reset. | 89 | * Put the USB host controller into reset. |
71 | */ | 90 | */ |
72 | usb_rst = sa1111_readl(dev->mapbase + SA1111_USB_RESET); | 91 | usb_rst = sa1111_readl(dev->mapbase + USB_RESET); |
73 | sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, | 92 | sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, |
74 | dev->mapbase + SA1111_USB_RESET); | 93 | dev->mapbase + USB_RESET); |
75 | 94 | ||
76 | /* | 95 | /* |
77 | * Stop the USB clock. | 96 | * Stop the USB clock. |
@@ -85,7 +104,7 @@ static void sa1111_stop_hc(struct sa1111_dev *dev) | |||
85 | #if 0 | 104 | #if 0 |
86 | static void dump_hci_status(struct usb_hcd *hcd, const char *label) | 105 | static void dump_hci_status(struct usb_hcd *hcd, const char *label) |
87 | { | 106 | { |
88 | unsigned long status = sa1111_readl(hcd->regs + SA1111_USB_STATUS); | 107 | unsigned long status = sa1111_readl(hcd->regs + USB_STATUS); |
89 | 108 | ||
90 | dbg ("%s USB_STATUS = { %s%s%s%s%s}", label, | 109 | dbg ("%s USB_STATUS = { %s%s%s%s%s}", label, |
91 | ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""), | 110 | ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""), |