aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-08-04 11:03:56 -0400
committerJohn Crispin <blogic@openwrt.org>2012-08-28 06:29:57 -0400
commit00ffed582fe8a3f7556593c0e8baaf3da3df85b0 (patch)
tree88912fae450552a2d4c05d25137193c687b1b377
parent8d3e03e186cb94a333d0176fe8b22a6df200fcc7 (diff)
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>
-rw-r--r--arch/mips/ath79/dev-usb.c28
-rw-r--r--arch/mips/include/asm/mach-ath79/ar71xx_regs.h7
2 files changed, 35 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)
193 platform_device_register(&ath79_ehci_device); 193 platform_device_register(&ath79_ehci_device);
194} 194}
195 195
196static void __init ar934x_usb_setup(void)
197{
198 u32 bootstrap;
199
200 bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
201 if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE)
202 return;
203
204 ath79_device_reset_set(AR934X_RESET_USBSUS_OVERRIDE);
205 udelay(1000);
206
207 ath79_device_reset_clear(AR934X_RESET_USB_PHY);
208 udelay(1000);
209
210 ath79_device_reset_clear(AR934X_RESET_USB_PHY_ANALOG);
211 udelay(1000);
212
213 ath79_device_reset_clear(AR934X_RESET_USB_HOST);
214 udelay(1000);
215
216 ath79_usb_init_resource(ath79_ehci_resources, AR934X_EHCI_BASE,
217 AR934X_EHCI_SIZE, ATH79_CPU_IRQ_USB);
218 ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
219 platform_device_register(&ath79_ehci_device);
220}
221
196void __init ath79_register_usb(void) 222void __init ath79_register_usb(void)
197{ 223{
198 if (soc_is_ar71xx()) 224 if (soc_is_ar71xx())
@@ -205,6 +231,8 @@ void __init ath79_register_usb(void)
205 ar913x_usb_setup(); 231 ar913x_usb_setup();
206 else if (soc_is_ar933x()) 232 else if (soc_is_ar933x())
207 ar933x_usb_setup(); 233 ar933x_usb_setup();
234 else if (soc_is_ar934x())
235 ar934x_usb_setup();
208 else 236 else
209 BUG(); 237 BUG();
210} 238}
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
index dde504477fac..3ccae12cc7b3 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -63,6 +63,8 @@
63 63
64#define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 64#define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
65#define AR934X_WMAC_SIZE 0x20000 65#define AR934X_WMAC_SIZE 0x20000
66#define AR934X_EHCI_BASE 0x1b000000
67#define AR934X_EHCI_SIZE 0x200
66 68
67/* 69/*
68 * DDR_CTRL block 70 * DDR_CTRL block
@@ -288,6 +290,11 @@
288#define AR933X_RESET_USB_PHY BIT(4) 290#define AR933X_RESET_USB_PHY BIT(4)
289#define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 291#define AR933X_RESET_USBSUS_OVERRIDE BIT(3)
290 292
293#define AR934X_RESET_USB_PHY_ANALOG BIT(11)
294#define AR934X_RESET_USB_HOST BIT(5)
295#define AR934X_RESET_USB_PHY BIT(4)
296#define AR934X_RESET_USBSUS_OVERRIDE BIT(3)
297
291#define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 298#define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)
292 299
293#define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) 300#define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23)