Skip to content

Commit 25e2ab1

Browse files
Sujithlinvjw
authored andcommitted
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 <[email protected]> Signed-off-by: Vasanthakumar Thiagarajan <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 02afa2a commit 25e2ab1

File tree

1 file changed

+2
-32
lines changed
  • drivers/net/wireless/ath/ath9k

1 file changed

+2
-32
lines changed

drivers/net/wireless/ath/ath9k/hw.c

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,22 +1006,6 @@ static void ath9k_hw_init_qos(struct ath_hw *ah)
10061006
REG_WRITE(ah, AR_TXOP_12_15, 0xFFFFFFFF);
10071007
}
10081008

1009-
static 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-
10251009
static void ath9k_hw_init_pll(struct ath_hw *ah,
10261010
struct ath9k_channel *chan)
10271011
{
@@ -1087,22 +1071,8 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
10871071

10881072
/* Switch the core clock for ar9271 to 117Mhz */
10891073
if (AR_SREV_9271(ah)) {
1090-
if ((pll == 0x142c) || (pll == 0x2850) ) {
1091-
udelay(500);
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-
}
1074+
udelay(500);
1075+
REG_WRITE(ah, 0x50040, 0x304);
11061076
}
11071077

11081078
udelay(RTC_PLL_SETTLE_DELAY);

0 commit comments

Comments
 (0)