aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index c8a2d0dae79..045abd55784 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -676,42 +676,55 @@ unsigned long ar9003_get_pll_sqsum_dvc(struct ath_hw *ah)
676} 676}
677EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); 677EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc);
678 678
679#define DPLL2_KD_VAL 0x3D 679#define DPLL3_PHASE_SHIFT_VAL 0x1
680#define DPLL2_KI_VAL 0x06
681#define DPLL3_PHASE_SHIFT_VAL 0x1
682
683static void ath9k_hw_init_pll(struct ath_hw *ah, 680static void ath9k_hw_init_pll(struct ath_hw *ah,
684 struct ath9k_channel *chan) 681 struct ath9k_channel *chan)
685{ 682{
686 u32 pll; 683 u32 pll;
687 684
688 if (AR_SREV_9485(ah)) { 685 if (AR_SREV_9485(ah)) {
689 REG_WRITE(ah, AR_RTC_PLL_CONTROL2, 0x886666);
690 REG_WRITE(ah, AR_CH0_DDR_DPLL2, 0x19e82f01);
691
692 REG_RMW_FIELD(ah, AR_CH0_DDR_DPLL3,
693 AR_CH0_DPLL3_PHASE_SHIFT, DPLL3_PHASE_SHIFT_VAL);
694 686
695 REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x1142c); 687 /* program BB PLL ki and kd value, ki=0x4, kd=0x40 */
696 udelay(1000); 688 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
689 AR_CH0_BB_DPLL2_PLL_PWD, 0x1);
690 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
691 AR_CH0_DPLL2_KD, 0x40);
692 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
693 AR_CH0_DPLL2_KI, 0x4);
697 694
698 REG_WRITE(ah, AR_RTC_PLL_CONTROL2, 0x886666); 695 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL1,
696 AR_CH0_BB_DPLL1_REFDIV, 0x5);
697 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL1,
698 AR_CH0_BB_DPLL1_NINI, 0x58);
699 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL1,
700 AR_CH0_BB_DPLL1_NFRAC, 0x0);
699 701
700 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, 702 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
701 AR_CH0_DPLL2_KD, DPLL2_KD_VAL); 703 AR_CH0_BB_DPLL2_OUTDIV, 0x1);
704 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
705 AR_CH0_BB_DPLL2_LOCAL_PLL, 0x1);
702 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, 706 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
703 AR_CH0_DPLL2_KI, DPLL2_KI_VAL); 707 AR_CH0_BB_DPLL2_EN_NEGTRIG, 0x1);
704 708
709 /* program BB PLL phase_shift to 0x6 */
705 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL3, 710 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL3,
706 AR_CH0_DPLL3_PHASE_SHIFT, DPLL3_PHASE_SHIFT_VAL); 711 AR_CH0_BB_DPLL3_PHASE_SHIFT, 0x6);
707 REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x142c); 712
713 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2,
714 AR_CH0_BB_DPLL2_PLL_PWD, 0x0);
708 udelay(1000); 715 udelay(1000);
716
717 REG_RMW_FIELD(ah, AR_CH0_BB_DPLL3,
718 AR_CH0_DPLL3_PHASE_SHIFT, DPLL3_PHASE_SHIFT_VAL);
709 } 719 }
710 720
711 pll = ath9k_hw_compute_pll_control(ah, chan); 721 pll = ath9k_hw_compute_pll_control(ah, chan);
712 722
713 REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); 723 REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
714 724
725 if (AR_SREV_9485(ah))
726 udelay(1000);
727
715 /* Switch the core clock for ar9271 to 117Mhz */ 728 /* Switch the core clock for ar9271 to 117Mhz */
716 if (AR_SREV_9271(ah)) { 729 if (AR_SREV_9271(ah)) {
717 udelay(500); 730 udelay(500);