1 From 635d5a2ac8aa483c3a0635c60bff8ea8978ff6a7 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Sun, 11 Dec 2011 18:34:13 +0100
4 Subject: [PATCH 39/47] MIPS: ath79: add USB platform setup code for AR934X
6 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
8 arch/mips/ath79/dev-usb.c | 28 ++++++++++++++++++++++++
9 arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 7 ++++++
10 2 files changed, 35 insertions(+), 0 deletions(-)
12 --- a/arch/mips/ath79/dev-usb.c
13 +++ b/arch/mips/ath79/dev-usb.c
14 @@ -193,6 +193,32 @@ static void __init ar933x_usb_setup(void
15 platform_device_register(&ath79_ehci_device);
18 +static void __init ar934x_usb_setup(void)
22 + bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
23 + if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE)
26 + ath79_device_reset_set(AR934X_RESET_USBSUS_OVERRIDE);
29 + ath79_device_reset_clear(AR934X_RESET_USB_PHY);
32 + ath79_device_reset_clear(AR934X_RESET_USB_PHY_ANALOG);
35 + ath79_device_reset_clear(AR934X_RESET_USB_HOST);
38 + ath79_usb_init_resource(ath79_ehci_resources, AR934X_EHCI_BASE,
39 + AR934X_EHCI_SIZE, ATH79_CPU_IRQ_USB);
40 + ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
41 + platform_device_register(&ath79_ehci_device);
44 void __init ath79_register_usb(void)
47 @@ -205,6 +231,8 @@ void __init ath79_register_usb(void)
49 else if (soc_is_ar933x())
51 + else if (soc_is_ar934x())
56 --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
57 +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
60 #define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
61 #define AR934X_WMAC_SIZE 0x20000
62 +#define AR934X_EHCI_BASE 0x1b000000
63 +#define AR934X_EHCI_SIZE 0x1000
68 #define AR933X_RESET_USB_PHY BIT(4)
69 #define AR933X_RESET_USBSUS_OVERRIDE BIT(3)
71 +#define AR934X_RESET_USB_PHY_ANALOG BIT(11)
72 +#define AR934X_RESET_USB_HOST BIT(5)
73 +#define AR934X_RESET_USB_PHY BIT(4)
74 +#define AR934X_RESET_USBSUS_OVERRIDE BIT(3)
76 #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)
78 #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23)