1 From 2d832612094b5592641364773c5ab2a3658f7120 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 31/35] MIPS: ath79: add USB platform setup code for AR934X
6 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
7 Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
9 arch/mips/ath79/dev-usb.c | 28 +++++++++++++++++++
10 arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 35 ++++++++++++++++++++++++
11 2 files changed, 63 insertions(+), 0 deletions(-)
13 --- a/arch/mips/ath79/dev-usb.c
14 +++ b/arch/mips/ath79/dev-usb.c
15 @@ -180,6 +180,32 @@ static void __init ar933x_usb_setup(void
16 platform_device_register(&ath79_ehci_device);
19 +static void __init ar934x_usb_setup(void)
23 + bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
24 + if (bootstrap & AR934X_BOOTSTRAP_USB_MODE_DEVICE)
27 + ath79_device_reset_clear(AR934X_RESET_USBSUS_OVERRIDE);
30 + ath79_device_reset_set(AR934X_RESET_USB_PHY);
33 + ath79_device_reset_set(AR934X_RESET_USB_PHY_ANALOG);
36 + ath79_device_reset_set(AR934X_RESET_USB_HOST);
39 + ath79_ehci_resources[0].start = AR934X_EHCI_BASE;
40 + ath79_ehci_resources[0].end = AR934X_EHCI_BASE + AR934X_EHCI_SIZE - 1;
41 + ath79_ehci_device.name = "ar934x-ehci";
42 + platform_device_register(&ath79_ehci_device);
45 void __init ath79_register_usb(void)
48 @@ -192,6 +218,8 @@ void __init ath79_register_usb(void)
50 else if (soc_is_ar933x())
52 + else if (soc_is_ar934x())
57 --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
58 +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
61 #define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
62 #define AR934X_WMAC_SIZE 0x20000
63 +#define AR934X_EHCI_BASE 0x1b000000
64 +#define AR934X_EHCI_SIZE 0x1000
69 #define AR933X_RESET_USB_PHY BIT(4)
70 #define AR933X_RESET_USBSUS_OVERRIDE BIT(3)
72 +#define AR934X_RESET_HOST BIT(31)
73 +#define AR934X_RESET_SLIC BIT(30)
74 +#define AR934X_RESET_HDMA BIT(29)
75 +#define AR934X_RESET_EXTERNAL BIT(28)
76 +#define AR934X_RESET_RTC BIT(27)
77 +#define AR934X_RESET_PCIE_EP_INT BIT(26)
78 +#define AR934X_RESET_CHKSUM_ACC BIT(25)
79 +#define AR934X_RESET_FULL_CHIP BIT(24)
80 +#define AR934X_RESET_GE1_MDIO BIT(23)
81 +#define AR934X_RESET_GE0_MDIO BIT(22)
82 +#define AR934X_RESET_CPU_NMI BIT(21)
83 +#define AR934X_RESET_CPU_COLD BIT(20)
84 +#define AR934X_RESET_HOST_RESET_INT BIT(19)
85 +#define AR934X_RESET_PCIE_EP BIT(18)
86 +#define AR934X_RESET_UART1 BIT(17)
87 +#define AR934X_RESET_DDR BIT(16)
88 +#define AR934X_RESET_USB_PHY_PLL_PWD_EXT BIT(15)
89 +#define AR934X_RESET_NANDF BIT(14)
90 +#define AR934X_RESET_GE1_MAC BIT(13)
91 +#define AR934X_RESET_ETH_SWITCH_ANALOG BIT(12)
92 +#define AR934X_RESET_USB_PHY_ANALOG BIT(11)
93 +#define AR934X_RESET_HOST_DMA_INT BIT(10)
94 +#define AR934X_RESET_GE0_MAC BIT(9)
95 +#define AR934X_RESET_ETH_SIWTCH BIT(8)
96 +#define AR934X_RESET_PCIE_PHY BIT(7)
97 +#define AR934X_RESET_PCIE BIT(6)
98 +#define AR934X_RESET_USB_HOST BIT(5)
99 +#define AR934X_RESET_USB_PHY BIT(4)
100 +#define AR934X_RESET_USBSUS_OVERRIDE BIT(3)
101 +#define AR934X_RESET_LUT BIT(2)
102 +#define AR934X_RESET_MBOX BIT(1)
103 +#define AR934X_RESET_I2S BIT(0)
105 #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)
107 #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23)