aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-03-17 04:55:22 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-23 16:50:16 -0400
commit25e2ab17fd77e752597050980cec4efae7f87854 (patch)
treed78d6e68100f88c84a16ff6468fff380e0d5b2d2 /drivers/net
parent02afa2a01b74ed3e8f3a85be11919b33f4ad4f02 (diff)
ath9k_hw: always set the core clock for AR9271
When initializing the PLL on AR9271 we always need to set the core clock to 117MHz. While at it remove the baud rate settings for the serial device on the AR9271, the default settings work well unless you want to customize it. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 023c38bb846..5bc5f5fdff5 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1006,22 +1006,6 @@ static void ath9k_hw_init_qos(struct ath_hw *ah)
1006 REG_WRITE(ah, AR_TXOP_12_15, 0xFFFFFFFF); 1006 REG_WRITE(ah, AR_TXOP_12_15, 0xFFFFFFFF);
1007} 1007}
1008 1008
1009static void ath9k_hw_change_target_baud(struct ath_hw *ah, u32 freq, u32 baud)
1010{
1011 u32 lcr;
1012 u32 baud_divider = freq * 1000 * 1000 / 16 / baud;
1013
1014 lcr = REG_READ(ah , 0x5100c);
1015 lcr |= 0x80;
1016
1017 REG_WRITE(ah, 0x5100c, lcr);
1018 REG_WRITE(ah, 0x51004, (baud_divider >> 8));
1019 REG_WRITE(ah, 0x51000, (baud_divider & 0xff));
1020
1021 lcr &= ~0x80;
1022 REG_WRITE(ah, 0x5100c, lcr);
1023}
1024
1025static void ath9k_hw_init_pll(struct ath_hw *ah, 1009static void ath9k_hw_init_pll(struct ath_hw *ah,
1026 struct ath9k_channel *chan) 1010 struct ath9k_channel *chan)
1027{ 1011{
@@ -1087,22 +1071,8 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
1087 1071
1088 /* Switch the core clock for ar9271 to 117Mhz */ 1072 /* Switch the core clock for ar9271 to 117Mhz */
1089 if (AR_SREV_9271(ah)) { 1073 if (AR_SREV_9271(ah)) {
1090 if ((pll == 0x142c) || (pll == 0x2850) ) { 1074 udelay(500);
1091 udelay(500); 1075 REG_WRITE(ah, 0x50040, 0x304);
1092 /* set CLKOBS to output AHB clock */
1093 REG_WRITE(ah, 0x7020, 0xe);
1094 /*
1095 * 0x304: 117Mhz, ahb_ratio: 1x1
1096 * 0x306: 40Mhz, ahb_ratio: 1x1
1097 */
1098 REG_WRITE(ah, 0x50040, 0x304);
1099 /*
1100 * makes adjustments for the baud dividor to keep the
1101 * targetted baud rate based on the used core clock.
1102 */
1103 ath9k_hw_change_target_baud(ah, AR9271_CORE_CLOCK,
1104 AR9271_TARGET_BAUD_RATE);
1105 }
1106 } 1076 }
1107 1077
1108 udelay(RTC_PLL_SETTLE_DELAY); 1078 udelay(RTC_PLL_SETTLE_DELAY);