aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-06-21 05:23:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-22 16:09:51 -0400
commita5415d625d35871dd8eaf3784a402f36c028c29d (patch)
treedab654b3e6494faeb5192595376778225133e770
parent77a27da38916626aaaa994e716514dfa990290f7 (diff)
ath9k: add AR9330 specific PLL initialization
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9840e0051084..99c90f71576e 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -733,6 +733,39 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
733 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, 733 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
734 AR_CH0_BB_DPLL2_PLL_PWD, 0x0); 734 AR_CH0_BB_DPLL2_PLL_PWD, 0x0);
735 udelay(1000); 735 udelay(1000);
736 } else if (AR_SREV_9330(ah)) {
737 u32 ddr_dpll2, pll_control2, kd;
738
739 if (ah->is_clk_25mhz) {
740 ddr_dpll2 = 0x18e82f01;
741 pll_control2 = 0xe04a3d;
742 kd = 0x1d;
743 } else {
744 ddr_dpll2 = 0x19e82f01;
745 pll_control2 = 0x886666;
746 kd = 0x3d;
747 }
748
749 /* program DDR PLL ki and kd value */
750 REG_WRITE(ah, AR_CH0_DDR_DPLL2, ddr_dpll2);
751
752 /* program DDR PLL phase_shift */
753 REG_RMW_FIELD(ah, AR_CH0_DDR_DPLL3,
754 AR_CH0_DPLL3_PHASE_SHIFT, 0x1);
755
756 REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x1142c);
757 udelay(1000);
758
759 /* program refdiv, nint, frac to RTC register */
760 REG_WRITE(ah, AR_RTC_PLL_CONTROL2, pll_control2);
761
762 /* program BB PLL kd and ki value */
763 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, AR_CH0_DPLL2_KD, kd);
764 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, AR_CH0_DPLL2_KI, 0x06);
765
766 /* program BB PLL phase_shift */
767 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL3,
768 AR_CH0_BB_DPLL3_PHASE_SHIFT, 0x1);
736 } else if (AR_SREV_9340(ah)) { 769 } else if (AR_SREV_9340(ah)) {
737 u32 regval, pll2_divint, pll2_divfrac, refdiv; 770 u32 regval, pll2_divint, pll2_divfrac, refdiv;
738 771
@@ -774,7 +807,7 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
774 807
775 REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); 808 REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
776 809
777 if (AR_SREV_9485(ah) || AR_SREV_9340(ah)) 810 if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah))
778 udelay(1000); 811 udelay(1000);
779 812
780 /* Switch the core clock for ar9271 to 117Mhz */ 813 /* Switch the core clock for ar9271 to 117Mhz */