From 88e506e321e83df578834b3b1475392e1155d334 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 19 May 2013 22:49:09 +0000 Subject: [PATCH] ar71xx: add an external reset callback for ar913x and use it in ath9k should reduce the frequency of DMA stop failures Backport of r36530 Signed-off-by: Felix Fietkau SVN-Revision: 36664 --- .../556-ath9k_ar913x_external_reset.patch | 28 +++++++++++++++++ .../480-ar913x_wmac_external_reset.patch | 31 +++++++++++++++++++ ...-mac-argument-to-ath79_register_wmac.patch | 4 +-- ...ath79-add-ath79_gpio_function_select.patch | 2 +- ...S-ath79-enable-UART-for-early_serial.patch | 2 +- .../606-MIPS-ath79-pb44-fixes.patch | 2 +- .../620-MIPS-ath79-OTP-support.patch | 2 +- ...add-ath79_wmac_disable_25ghz-helpers.patch | 2 +- .../650-MIPS-ath79-fix-ar933x-reset.patch | 2 +- 9 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 package/mac80211/patches/556-ath9k_ar913x_external_reset.patch create mode 100644 target/linux/ar71xx/patches-3.3/480-ar913x_wmac_external_reset.patch diff --git a/package/mac80211/patches/556-ath9k_ar913x_external_reset.patch b/package/mac80211/patches/556-ath9k_ar913x_external_reset.patch new file mode 100644 index 0000000000..c95f391478 --- /dev/null +++ b/package/mac80211/patches/556-ath9k_ar913x_external_reset.patch @@ -0,0 +1,28 @@ +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -1374,7 +1374,10 @@ static bool ath9k_hw_set_reset(struct at + + REGWRITE_BUFFER_FLUSH(ah); + +- udelay(50); ++ if (AR_SREV_9100(ah)) ++ mdelay(10); ++ else ++ udelay(50); + + REG_WRITE(ah, AR_RTC_RC, 0); + if (!ath9k_hw_wait(ah, AR_RTC_RC, AR_RTC_RC_M, 0, AH_WAIT_TIMEOUT)) { +@@ -1385,8 +1388,12 @@ static bool ath9k_hw_set_reset(struct at + if (!AR_SREV_9100(ah)) + REG_WRITE(ah, AR_RC, 0); + +- if (AR_SREV_9100(ah)) ++ if (AR_SREV_9100(ah) && type != ATH9K_RESET_WARM) { ++ if (ah->external_reset) ++ ah->external_reset(); ++ + udelay(50); ++ } + + return true; + } diff --git a/target/linux/ar71xx/patches-3.3/480-ar913x_wmac_external_reset.patch b/target/linux/ar71xx/patches-3.3/480-ar913x_wmac_external_reset.patch new file mode 100644 index 0000000000..376652a3d9 --- /dev/null +++ b/target/linux/ar71xx/patches-3.3/480-ar913x_wmac_external_reset.patch @@ -0,0 +1,31 @@ +--- a/arch/mips/ath79/dev-wmac.c ++++ b/arch/mips/ath79/dev-wmac.c +@@ -44,7 +44,7 @@ static struct platform_device ath79_wmac + }, + }; + +-static void __init ar913x_wmac_setup(void) ++static int ar913x_wmac_reset(void) + { + /* reset the WMAC */ + ath79_device_reset_set(AR913X_RESET_AMBA2WMAC); +@@ -53,10 +53,19 @@ static void __init ar913x_wmac_setup(voi + ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC); + mdelay(10); + ++ return 0; ++} ++ ++static void __init ar913x_wmac_setup(void) ++{ ++ ar913x_wmac_reset(); ++ + ath79_wmac_resources[0].start = AR913X_WMAC_BASE; + ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; + ath79_wmac_resources[1].start = ATH79_CPU_IRQ_IP2; + ath79_wmac_resources[1].end = ATH79_CPU_IRQ_IP2; ++ ++ ath79_wmac_data.external_reset = ar913x_wmac_reset; + } + + diff --git a/target/linux/ar71xx/patches-3.3/501-MIPS-ath79-add-mac-argument-to-ath79_register_wmac.patch b/target/linux/ar71xx/patches-3.3/501-MIPS-ath79-add-mac-argument-to-ath79_register_wmac.patch index bab4f701d1..d22b73a0f4 100644 --- a/target/linux/ar71xx/patches-3.3/501-MIPS-ath79-add-mac-argument-to-ath79_register_wmac.patch +++ b/target/linux/ar71xx/patches-3.3/501-MIPS-ath79-add-mac-argument-to-ath79_register_wmac.patch @@ -16,7 +16,7 @@ static struct ath9k_platform_data ath79_wmac_data; static struct resource ath79_wmac_resources[] = { -@@ -134,7 +136,7 @@ static void qca955x_wmac_setup(void) +@@ -143,7 +145,7 @@ static void qca955x_wmac_setup(void) ath79_wmac_data.is_clk_25mhz = true; } @@ -25,7 +25,7 @@ { if (soc_is_ar913x()) ar913x_wmac_setup(); -@@ -151,5 +153,10 @@ void __init ath79_register_wmac(u8 *cal_ +@@ -160,5 +162,10 @@ void __init ath79_register_wmac(u8 *cal_ memcpy(ath79_wmac_data.eeprom_data, cal_data, sizeof(ath79_wmac_data.eeprom_data)); diff --git a/target/linux/ar71xx/patches-3.3/505-MIPS-ath79-add-ath79_gpio_function_select.patch b/target/linux/ar71xx/patches-3.3/505-MIPS-ath79-add-ath79_gpio_function_select.patch index 86e136f67e..08f4a1e95c 100644 --- a/target/linux/ar71xx/patches-3.3/505-MIPS-ath79-add-ath79_gpio_function_select.patch +++ b/target/linux/ar71xx/patches-3.3/505-MIPS-ath79-add-ath79_gpio_function_select.patch @@ -10,7 +10,7 @@ #endif /* __ATH79_COMMON_H */ --- a/arch/mips/ath79/gpio.c +++ b/arch/mips/ath79/gpio.c -@@ -198,6 +198,34 @@ void ath79_gpio_function_setup(u32 set, +@@ -198,6 +198,34 @@ void ath79_gpio_function_setup(u32 set, spin_unlock_irqrestore(&ath79_gpio_lock, flags); } diff --git a/target/linux/ar71xx/patches-3.3/521-MIPS-ath79-enable-UART-for-early_serial.patch b/target/linux/ar71xx/patches-3.3/521-MIPS-ath79-enable-UART-for-early_serial.patch index 489bc96738..2ee025bbf2 100644 --- a/target/linux/ar71xx/patches-3.3/521-MIPS-ath79-enable-UART-for-early_serial.patch +++ b/target/linux/ar71xx/patches-3.3/521-MIPS-ath79-enable-UART-for-early_serial.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/early_printk.c +++ b/arch/mips/ath79/early_printk.c -@@ -56,6 +56,46 @@ static void prom_putchar_dummy(unsigned +@@ -56,6 +56,46 @@ static void prom_putchar_dummy(unsigned /* nothing to do */ } diff --git a/target/linux/ar71xx/patches-3.3/606-MIPS-ath79-pb44-fixes.patch b/target/linux/ar71xx/patches-3.3/606-MIPS-ath79-pb44-fixes.patch index f9ec7753f1..b38b46121d 100644 --- a/target/linux/ar71xx/patches-3.3/606-MIPS-ath79-pb44-fixes.patch +++ b/target/linux/ar71xx/patches-3.3/606-MIPS-ath79-pb44-fixes.patch @@ -50,7 +50,7 @@ #define PB44_GPIO_SW_RESET (PB44_GPIO_EXP_BASE + 6) #define PB44_GPIO_SW_JUMP (PB44_GPIO_EXP_BASE + 8) #define PB44_GPIO_LED_JUMP1 (PB44_GPIO_EXP_BASE + 9) -@@ -92,21 +117,66 @@ static struct ath79_spi_controller_data +@@ -92,21 +117,66 @@ static struct ath79_spi_controller_data .cs_line = 0, }; diff --git a/target/linux/ar71xx/patches-3.3/620-MIPS-ath79-OTP-support.patch b/target/linux/ar71xx/patches-3.3/620-MIPS-ath79-OTP-support.patch index 087dbc0829..f52961a039 100644 --- a/target/linux/ar71xx/patches-3.3/620-MIPS-ath79-OTP-support.patch +++ b/target/linux/ar71xx/patches-3.3/620-MIPS-ath79-OTP-support.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/dev-wmac.c +++ b/arch/mips/ath79/dev-wmac.c -@@ -139,6 +139,137 @@ static void qca955x_wmac_setup(void) +@@ -148,6 +148,137 @@ static void qca955x_wmac_setup(void) ath79_wmac_data.is_clk_25mhz = true; } diff --git a/target/linux/ar71xx/patches-3.3/621-MIPS-ath79-add-ath79_wmac_disable_25ghz-helpers.patch b/target/linux/ar71xx/patches-3.3/621-MIPS-ath79-add-ath79_wmac_disable_25ghz-helpers.patch index ca5900b17e..957ccb6308 100644 --- a/target/linux/ar71xx/patches-3.3/621-MIPS-ath79-add-ath79_wmac_disable_25ghz-helpers.patch +++ b/target/linux/ar71xx/patches-3.3/621-MIPS-ath79-add-ath79_wmac_disable_25ghz-helpers.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/dev-wmac.c +++ b/arch/mips/ath79/dev-wmac.c -@@ -270,6 +270,16 @@ bool __init ar93xx_wmac_read_mac_address +@@ -279,6 +279,16 @@ bool __init ar93xx_wmac_read_mac_address return ret; } diff --git a/target/linux/ar71xx/patches-3.3/650-MIPS-ath79-fix-ar933x-reset.patch b/target/linux/ar71xx/patches-3.3/650-MIPS-ath79-fix-ar933x-reset.patch index a81d6ea6e0..d288f080a6 100644 --- a/target/linux/ar71xx/patches-3.3/650-MIPS-ath79-fix-ar933x-reset.patch +++ b/target/linux/ar71xx/patches-3.3/650-MIPS-ath79-fix-ar933x-reset.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/dev-wmac.c +++ b/arch/mips/ath79/dev-wmac.c -@@ -67,10 +67,27 @@ static void __init ar913x_wmac_setup(voi +@@ -76,10 +76,27 @@ static void __init ar913x_wmac_setup(voi static int ar933x_wmac_reset(void) { -- 2.30.2