From owner-svn-src-all@FreeBSD.ORG Thu Sep 13 18:24:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 262D21065670; Thu, 13 Sep 2012 18:24:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB7A58FC17; Thu, 13 Sep 2012 18:24:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8DIODfn050643; Thu, 13 Sep 2012 18:24:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8DIODxJ050639; Thu, 13 Sep 2012 18:24:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209131824.q8DIODxJ050639@svn.freebsd.org> From: Adrian Chadd Date: Thu, 13 Sep 2012 18:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240471 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 18:24:14 -0000 Author: adrian Date: Thu Sep 13 18:24:13 2012 New Revision: 240471 URL: http://svn.freebsd.org/changeset/base/240471 Log: Don't use AR_PHY_MODE to setup half/quarter rate. I'm not sure where in the deep, distant past I found the AR_PHY_MODE registers for half/quarter rate mode, but unfortunately that doesn't seem to work "right" for non-AR9280 chips. Specifically: * don't touch AR_PHY_MODE * set the PLL bits when configuring half/quarter rate I've verified this on the AR9280 (5ghz fast clock) and the AR5416. The AR9280 works in both half/quarter rate; the AR5416 unfortunately only currently works at half rate. It fails to calibrate on quarter rate. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Sep 13 17:49:11 2012 (r240470) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Sep 13 18:24:13 2012 (r240471) @@ -746,19 +746,6 @@ ar5416SetRfMode(struct ath_hal *ah, cons AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; } - /* - * Set half/quarter mode flags if required. - * - * This doesn't change the IFS timings at all; that needs to - * be done as part of the MAC setup. Similarly, the PLL - * configuration also needs some changes for the half/quarter - * rate clock. - */ - if (IEEE80211_IS_CHAN_HALF(chan)) - rfMode |= AR_PHY_MODE_HALF; - else if (IEEE80211_IS_CHAN_QUARTER(chan)) - rfMode |= AR_PHY_MODE_QUARTER; - OS_REG_WRITE(ah, AR_PHY_MODE, rfMode); } Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Sep 13 17:49:11 2012 (r240470) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Sep 13 18:24:13 2012 (r240471) @@ -114,6 +114,10 @@ ar9280InitPLL(struct ath_hal *ah, const * Else, set PLL to 0x2850 to prevent reset-to-reset variation */ pll = IS_5GHZ_FAST_CLOCK_EN(ah, chan) ? 0x142c : 0x2850; + if (IEEE80211_IS_CHAN_HALF(chan)) + pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); } else if (AR_SREV_MERLIN_10_OR_LATER(ah)) { pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV); if (chan != AH_NULL) {