diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-07-03 13:13:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:36:32 -0400 |
commit | fc05a3178476695603c25b6be8c28e8457df0cc2 (patch) | |
tree | 281b61c3d8cfff496f6decebe3280159305c556d /drivers/net/wireless/ath/ath9k/hw.c | |
parent | 2e2c9cc37ecda6ad01ed70691d6ff96a7c9e638e (diff) |
ath9k: fix PLL initialization for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index c042daa685f2..e9124b4bb5ab 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -868,7 +868,7 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
868 | /* program BB PLL phase_shift */ | 868 | /* program BB PLL phase_shift */ |
869 | REG_RMW_FIELD(ah, AR_CH0_BB_DPLL3, | 869 | REG_RMW_FIELD(ah, AR_CH0_BB_DPLL3, |
870 | AR_CH0_BB_DPLL3_PHASE_SHIFT, 0x1); | 870 | AR_CH0_BB_DPLL3_PHASE_SHIFT, 0x1); |
871 | } else if (AR_SREV_9340(ah)) { | 871 | } else if (AR_SREV_9340(ah) || AR_SREV_9550(ah)) { |
872 | u32 regval, pll2_divint, pll2_divfrac, refdiv; | 872 | u32 regval, pll2_divint, pll2_divfrac, refdiv; |
873 | 873 | ||
874 | REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x1142c); | 874 | REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x1142c); |
@@ -882,9 +882,15 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
882 | pll2_divfrac = 0x1eb85; | 882 | pll2_divfrac = 0x1eb85; |
883 | refdiv = 3; | 883 | refdiv = 3; |
884 | } else { | 884 | } else { |
885 | pll2_divint = 88; | 885 | if (AR_SREV_9340(ah)) { |
886 | pll2_divfrac = 0; | 886 | pll2_divint = 88; |
887 | refdiv = 5; | 887 | pll2_divfrac = 0; |
888 | refdiv = 5; | ||
889 | } else { | ||
890 | pll2_divint = 0x11; | ||
891 | pll2_divfrac = 0x26666; | ||
892 | refdiv = 1; | ||
893 | } | ||
888 | } | 894 | } |
889 | 895 | ||
890 | regval = REG_READ(ah, AR_PHY_PLL_MODE); | 896 | regval = REG_READ(ah, AR_PHY_PLL_MODE); |
@@ -897,8 +903,12 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
897 | udelay(100); | 903 | udelay(100); |
898 | 904 | ||
899 | regval = REG_READ(ah, AR_PHY_PLL_MODE); | 905 | regval = REG_READ(ah, AR_PHY_PLL_MODE); |
900 | regval = (regval & 0x80071fff) | (0x1 << 30) | (0x1 << 13) | | 906 | if (AR_SREV_9340(ah)) |
901 | (0x4 << 26) | (0x18 << 19); | 907 | regval = (regval & 0x80071fff) | (0x1 << 30) | |
908 | (0x1 << 13) | (0x4 << 26) | (0x18 << 19); | ||
909 | else | ||
910 | regval = (regval & 0x80071fff) | (0x3 << 30) | | ||
911 | (0x1 << 13) | (0x4 << 26) | (0x60 << 19); | ||
902 | REG_WRITE(ah, AR_PHY_PLL_MODE, regval); | 912 | REG_WRITE(ah, AR_PHY_PLL_MODE, regval); |
903 | REG_WRITE(ah, AR_PHY_PLL_MODE, | 913 | REG_WRITE(ah, AR_PHY_PLL_MODE, |
904 | REG_READ(ah, AR_PHY_PLL_MODE) & 0xfffeffff); | 914 | REG_READ(ah, AR_PHY_PLL_MODE) & 0xfffeffff); |
@@ -909,7 +919,8 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
909 | 919 | ||
910 | REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); | 920 | REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); |
911 | 921 | ||
912 | if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah)) | 922 | if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) || |
923 | AR_SREV_9550(ah)) | ||
913 | udelay(1000); | 924 | udelay(1000); |
914 | 925 | ||
915 | /* Switch the core clock for ar9271 to 117Mhz */ | 926 | /* Switch the core clock for ar9271 to 117Mhz */ |
@@ -922,7 +933,7 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
922 | 933 | ||
923 | REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_FORCE_DERIVED_CLK); | 934 | REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_FORCE_DERIVED_CLK); |
924 | 935 | ||
925 | if (AR_SREV_9340(ah)) { | 936 | if (AR_SREV_9340(ah) || AR_SREV_9550(ah)) { |
926 | if (ah->is_clk_25mhz) { | 937 | if (ah->is_clk_25mhz) { |
927 | REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1); | 938 | REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1); |
928 | REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7); | 939 | REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7); |