diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-08-04 19:03:56 +0400 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2012-08-28 14:29:57 +0400 |
commit | 00ffed582fe8a3f7556593c0e8baaf3da3df85b0 (patch) | |
tree | 88912fae450552a2d4c05d25137193c687b1b377 /arch/mips/ath79/dev-usb.c | |
parent | 8d3e03e186cb94a333d0176fe8b22a6df200fcc7 (diff) | |
download | linux-00ffed582fe8a3f7556593c0e8baaf3da3df85b0.tar.xz |
MIPS: ath79: add USB platform setup code for AR934X
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/4172/
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/ath79/dev-usb.c')
-rw-r--r-- | arch/mips/ath79/dev-usb.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/mips/ath79/dev-usb.c b/arch/mips/ath79/dev-usb.c index 87fe48e8e301..072bb9be2304 100644 --- a/arch/mips/ath79/dev-usb.c +++ b/arch/mips/ath79/dev-usb.c @@ -193,6 +193,32 @@ static void __init ar933x_usb_setup(void) platform_device_register(&ath79_ehci_device); } +static void __init ar934x_usb_setup(void) +{ + u32 bootstrap; + + bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP); + if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE) + return; + + ath79_device_reset_set(AR934X_RESET_USBSUS_OVERRIDE); + udelay(1000); + + ath79_device_reset_clear(AR934X_RESET_USB_PHY); + udelay(1000); + + ath79_device_reset_clear(AR934X_RESET_USB_PHY_ANALOG); + udelay(1000); + + ath79_device_reset_clear(AR934X_RESET_USB_HOST); + udelay(1000); + + ath79_usb_init_resource(ath79_ehci_resources, AR934X_EHCI_BASE, + AR934X_EHCI_SIZE, ATH79_CPU_IRQ_USB); + ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2; + platform_device_register(&ath79_ehci_device); +} + void __init ath79_register_usb(void) { if (soc_is_ar71xx()) @@ -205,6 +231,8 @@ void __init ath79_register_usb(void) ar913x_usb_setup(); else if (soc_is_ar933x()) ar933x_usb_setup(); + else if (soc_is_ar934x()) + ar934x_usb_setup(); else BUG(); } |