diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-09-27 14:53:57 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-09-27 14:53:57 +0000 |
commit | b831ebdde9436985379528b986cbb7908090d748 (patch) | |
tree | a525dbd47b3986dc2892dd430dbf959e9c46cfab /target/linux/ar71xx | |
parent | ef54e937124c72ecf877426684a670070e170746 (diff) | |
download | upstream-b831ebdde9436985379528b986cbb7908090d748.tar.gz upstream-b831ebdde9436985379528b986cbb7908090d748.tar.bz2 upstream-b831ebdde9436985379528b986cbb7908090d748.zip |
ar71xx: AR724[12] requires different USB setup
SVN-Revision: 23135
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/dev-usb.c | 35 | ||||
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h | 3 |
2 files changed, 27 insertions, 11 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-usb.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-usb.c index fb006c7052..f7788b5702 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-usb.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-usb.c @@ -128,16 +128,26 @@ static void __init ar7240_usb_setup(void) /* WAR for HW bug. Here it adjusts the duration between two SOFS */ ar71xx_usb_ctrl_wr(USB_CTRL_REG_FLADJ, 0x3); - if (ar71xx_soc == AR71XX_SOC_AR7241 || ar71xx_soc == AR71XX_SOC_AR7242) { - ar71xx_ehci_data.is_ar91xx = 1; - ar71xx_ehci_device.resource = ar7240_ohci_resources; - ar71xx_ehci_device.num_resources = ARRAY_SIZE(ar7240_ohci_resources); - platform_device_register(&ar71xx_ehci_device); - } else { - ar71xx_ohci_device.resource = ar7240_ohci_resources; - ar71xx_ohci_device.num_resources = ARRAY_SIZE(ar7240_ohci_resources); - platform_device_register(&ar71xx_ohci_device); - } + ar71xx_ohci_device.resource = ar7240_ohci_resources; + ar71xx_ohci_device.num_resources = ARRAY_SIZE(ar7240_ohci_resources); + platform_device_register(&ar71xx_ohci_device); +} + +static void __init ar7241_usb_setup(void) +{ + ar71xx_device_start(AR724X_RESET_USBSUS_OVERRIDE); + mdelay(10); + + ar71xx_device_start(AR724X_RESET_USB_HOST); + mdelay(10); + + ar71xx_device_start(AR724X_RESET_USB_PHY); + mdelay(10); + + ar71xx_ehci_data.is_ar91xx = 1; + ar71xx_ehci_device.resource = ar7240_ohci_resources; + ar71xx_ehci_device.num_resources = ARRAY_SIZE(ar7240_ohci_resources); + platform_device_register(&ar71xx_ehci_device); } static void __init ar91xx_usb_setup(void) @@ -159,9 +169,12 @@ void __init ar71xx_add_device_usb(void) { switch (ar71xx_soc) { case AR71XX_SOC_AR7240: + ar7240_usb_setup(); + break; + case AR71XX_SOC_AR7241: case AR71XX_SOC_AR7242: - ar7240_usb_setup(); + ar7241_usb_setup(); break; case AR71XX_SOC_AR7130: diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h index c6a5a40995..ce9523d3fa 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h @@ -432,6 +432,9 @@ void ar71xx_ddr_flush(u32 reg); #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) #define AR724X_RESET_PCIE_PHY BIT(7) #define AR724X_RESET_PCIE BIT(6) +#define AR724X_RESET_USB_HOST BIT(5) +#define AR724X_RESET_USB_PHY BIT(4) +#define AR724X_RESET_USBSUS_OVERRIDE BIT(3) #define REV_ID_MAJOR_MASK 0xfff0 #define REV_ID_MAJOR_AR71XX 0x00a0 |