diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 37 |
2 files changed, 35 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 46ee7f4c0912..85074cb36f38 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1033,7 +1033,7 @@ MODULE_LICENSE ("GPL"); | |||
1033 | #define OF_PLATFORM_DRIVER ehci_hcd_ppc_of_driver | 1033 | #define OF_PLATFORM_DRIVER ehci_hcd_ppc_of_driver |
1034 | #endif | 1034 | #endif |
1035 | 1035 | ||
1036 | #ifdef CONFIG_ARCH_ORION | 1036 | #ifdef CONFIG_PLAT_ORION |
1037 | #include "ehci-orion.c" | 1037 | #include "ehci-orion.c" |
1038 | #define PLATFORM_DRIVER ehci_orion_driver | 1038 | #define PLATFORM_DRIVER ehci_orion_driver |
1039 | #endif | 1039 | #endif |
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index e129981f139f..d187d0313742 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -11,15 +11,18 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <asm/arch/orion.h> | 14 | #include <linux/mbus.h> |
15 | #include <asm/plat-orion/ehci-orion.h> | ||
15 | 16 | ||
16 | #define rdl(off) __raw_readl(hcd->regs + (off)) | 17 | #define rdl(off) __raw_readl(hcd->regs + (off)) |
17 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) | 18 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) |
18 | 19 | ||
19 | #define USB_CAUSE 0x310 | ||
20 | #define USB_MASK 0x314 | ||
21 | #define USB_CMD 0x140 | 20 | #define USB_CMD 0x140 |
22 | #define USB_MODE 0x1a8 | 21 | #define USB_MODE 0x1a8 |
22 | #define USB_CAUSE 0x310 | ||
23 | #define USB_MASK 0x314 | ||
24 | #define USB_WINDOW_CTRL(i) (0x320 + ((i) << 4)) | ||
25 | #define USB_WINDOW_BASE(i) (0x324 + ((i) << 4)) | ||
23 | #define USB_IPG 0x360 | 26 | #define USB_IPG 0x360 |
24 | #define USB_PHY_PWR_CTRL 0x400 | 27 | #define USB_PHY_PWR_CTRL 0x400 |
25 | #define USB_PHY_TX_CTRL 0x420 | 28 | #define USB_PHY_TX_CTRL 0x420 |
@@ -162,8 +165,30 @@ static const struct hc_driver ehci_orion_hc_driver = { | |||
162 | .bus_resume = ehci_bus_resume, | 165 | .bus_resume = ehci_bus_resume, |
163 | }; | 166 | }; |
164 | 167 | ||
168 | static void __init | ||
169 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | ||
170 | struct mbus_dram_target_info *dram) | ||
171 | { | ||
172 | int i; | ||
173 | |||
174 | for (i = 0; i < 4; i++) { | ||
175 | wrl(USB_WINDOW_CTRL(i), 0); | ||
176 | wrl(USB_WINDOW_BASE(i), 0); | ||
177 | } | ||
178 | |||
179 | for (i = 0; i < dram->num_cs; i++) { | ||
180 | struct mbus_dram_window *cs = dram->cs + i; | ||
181 | |||
182 | wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) | | ||
183 | (cs->mbus_attr << 8) | | ||
184 | (dram->mbus_dram_target_id << 4) | 1); | ||
185 | wrl(USB_WINDOW_BASE(i), cs->base); | ||
186 | } | ||
187 | } | ||
188 | |||
165 | static int __init ehci_orion_drv_probe(struct platform_device *pdev) | 189 | static int __init ehci_orion_drv_probe(struct platform_device *pdev) |
166 | { | 190 | { |
191 | struct orion_ehci_data *pd = pdev->dev.platform_data; | ||
167 | struct resource *res; | 192 | struct resource *res; |
168 | struct usb_hcd *hcd; | 193 | struct usb_hcd *hcd; |
169 | struct ehci_hcd *ehci; | 194 | struct ehci_hcd *ehci; |
@@ -227,6 +252,12 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev) | |||
227 | ehci->sbrn = 0x20; | 252 | ehci->sbrn = 0x20; |
228 | 253 | ||
229 | /* | 254 | /* |
255 | * (Re-)program MBUS remapping windows if we are asked to. | ||
256 | */ | ||
257 | if (pd != NULL && pd->dram != NULL) | ||
258 | ehci_orion_conf_mbus_windows(hcd, pd->dram); | ||
259 | |||
260 | /* | ||
230 | * setup Orion USB controller | 261 | * setup Orion USB controller |
231 | */ | 262 | */ |
232 | orion_usb_setup(hcd); | 263 | orion_usb_setup(hcd); |