ar71xx: add an external reset callback for ar913x and use it in ath9k
authorFelix Fietkau <nbd@openwrt.org>
Sun, 19 May 2013 22:49:09 +0000 (22:49 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 19 May 2013 22:49:09 +0000 (22:49 +0000)
should reduce the frequency of DMA stop failures

Backport of r36530

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 36664

package/mac80211/patches/556-ath9k_ar913x_external_reset.patch [new file with mode: 0644]
target/linux/ar71xx/patches-3.3/480-ar913x_wmac_external_reset.patch [new file with mode: 0644]
target/linux/ar71xx/patches-3.3/501-MIPS-ath79-add-mac-argument-to-ath79_register_wmac.patch
target/linux/ar71xx/patches-3.3/505-MIPS-ath79-add-ath79_gpio_function_select.patch
target/linux/ar71xx/patches-3.3/521-MIPS-ath79-enable-UART-for-early_serial.patch
target/linux/ar71xx/patches-3.3/606-MIPS-ath79-pb44-fixes.patch
target/linux/ar71xx/patches-3.3/620-MIPS-ath79-OTP-support.patch
target/linux/ar71xx/patches-3.3/621-MIPS-ath79-add-ath79_wmac_disable_25ghz-helpers.patch
target/linux/ar71xx/patches-3.3/650-MIPS-ath79-fix-ar933x-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 (file)
index 0000000..c95f391
--- /dev/null
@@ -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 (file)
index 0000000..376652a
--- /dev/null
@@ -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;
+ }
index bab4f701d19a5969a2d49c7894f9460dfffd737d..d22b73a0f434d36cc94c5da8a2d5ffb4fa21c9b3 100644 (file)
@@ -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));
  
index 86e136f67ec3730a4468843ef57a52f534ade544..08f4a1e95cb05612313231f39468e66f883ecbf2 100644 (file)
@@ -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);
  }
  
index 489bc967380cb89bb7826d1d05e78fbfe814d16e..2ee025bbf2079fa3ad73fa013991b52a62c32511 100644 (file)
@@ -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 */
  }
  
index f9ec7753f1aa75c5be2321bd071253217c37f24a..b38b46121ded4083fe63eae2241156d7f7c32eab 100644 (file)
@@ -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,
  };
  
index 087dbc0829b56eb09080ff5be157bb0f5798d563..f52961a0395236cff425aec8937a62ff731bb2f4 100644 (file)
@@ -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;
  }
  
index ca5900b17e7fd17aac0e5edf5df2ba3b39f23442..957ccb6308c463cb36d8034c5590ab4c89d58d4f 100644 (file)
@@ -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;
  }
  
index a81d6ea6e0267eb08837dc5608c420fe53fc6f97..d288f080a6a5c1de556ba5fbf94183a039b38976 100644 (file)
@@ -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)
  {