From b9556acd21ac8abfd66d2d93305c75ca7ad97031 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 20 Jun 2011 21:26:10 +0200 Subject: [PATCH] --- yaml --- r: 284723 b: refs/heads/master c: c279b7759602d4ef97d45f3eb2cdf36a713eb99a h: refs/heads/master i: 284721: a54a7abd2938847e5322b7a50bad2a96109d5779 284719: 96ec873d2d056f071b14f438aa3e398c9af59712 v: v3 --- [refs] | 2 +- trunk/arch/mips/ath79/Kconfig | 1 + trunk/arch/mips/ath79/dev-usb.c | 19 +++++++++++++++++++ .../mips/include/asm/mach-ath79/ar71xx_regs.h | 7 +++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ffc40a5ee17c..1b737fc0d639 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d6b204f93cfeb7ec5e6ec499aca43d2c1d6da3f +refs/heads/master: c279b7759602d4ef97d45f3eb2cdf36a713eb99a diff --git a/trunk/arch/mips/ath79/Kconfig b/trunk/arch/mips/ath79/Kconfig index 90edf27609e8..c3680c83a102 100644 --- a/trunk/arch/mips/ath79/Kconfig +++ b/trunk/arch/mips/ath79/Kconfig @@ -42,6 +42,7 @@ config SOC_AR913X def_bool n config SOC_AR933X + select USB_ARCH_HAS_EHCI def_bool n config ATH79_DEV_AR913X_WMAC diff --git a/trunk/arch/mips/ath79/dev-usb.c b/trunk/arch/mips/ath79/dev-usb.c index c3f1999c761b..002d6d2afe04 100644 --- a/trunk/arch/mips/ath79/dev-usb.c +++ b/trunk/arch/mips/ath79/dev-usb.c @@ -163,6 +163,23 @@ static void __init ar913x_usb_setup(void) platform_device_register(&ath79_ehci_device); } +static void __init ar933x_usb_setup(void) +{ + ath79_device_reset_set(AR933X_RESET_USBSUS_OVERRIDE); + mdelay(10); + + ath79_device_reset_clear(AR933X_RESET_USB_HOST); + mdelay(10); + + ath79_device_reset_clear(AR933X_RESET_USB_PHY); + mdelay(10); + + ath79_ehci_resources[0].start = AR933X_EHCI_BASE; + ath79_ehci_resources[0].end = AR933X_EHCI_BASE + AR933X_EHCI_SIZE - 1; + ath79_ehci_device.name = "ar933x-ehci"; + platform_device_register(&ath79_ehci_device); +} + void __init ath79_register_usb(void) { if (soc_is_ar71xx()) @@ -173,6 +190,8 @@ void __init ath79_register_usb(void) ar724x_usb_setup(); else if (soc_is_ar913x()) ar913x_usb_setup(); + else if (soc_is_ar933x()) + ar933x_usb_setup(); else BUG(); } diff --git a/trunk/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/trunk/arch/mips/include/asm/mach-ath79/ar71xx_regs.h index e65c10dd159b..733bacace778 100644 --- a/trunk/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/trunk/arch/mips/include/asm/mach-ath79/ar71xx_regs.h @@ -56,6 +56,9 @@ #define AR933X_UART_BASE (AR71XX_APB_BASE + 0x00020000) #define AR933X_UART_SIZE 0x14 +#define AR933X_EHCI_BASE 0x1b000000 +#define AR933X_EHCI_SIZE 0x1000 + /* * DDR_CTRL block */ @@ -230,6 +233,10 @@ #define AR913X_RESET_USB_HOST BIT(5) #define AR913X_RESET_USB_PHY BIT(4) +#define AR933X_RESET_USB_HOST BIT(5) +#define AR933X_RESET_USB_PHY BIT(4) +#define AR933X_RESET_USBSUS_OVERRIDE BIT(3) + #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) #define REV_ID_MAJOR_MASK 0xfff0