ar9130_phy.c revision 302408
113978Smrkam/*
213978Smrkam * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd
313978Smrkam * Copyright (c) 2010 Atheros Communications, Inc.
413978Smrkam *
513978Smrkam * Permission to use, copy, modify, and/or distribute this software for any
613978Smrkam * purpose with or without fee is hereby granted, provided that the above
713978Smrkam * copyright notice and this permission notice appear in all copies.
813978Smrkam *
913978Smrkam * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1013978Smrkam * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1113978Smrkam * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1213978Smrkam * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1313978Smrkam * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1413978Smrkam * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1513978Smrkam * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1613978Smrkam *
1713978Smrkam * $FreeBSD: stable/11/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c 242412 2012-10-31 21:14:25Z adrian $
1813978Smrkam */
1913978Smrkam#include "opt_ah.h"
2013978Smrkam
2113978Smrkam#include "ah.h"
2213978Smrkam#include "ah_internal.h"
2313978Smrkam#include "ah_devid.h"
2413978Smrkam
2513978Smrkam#include "ar5416/ar5416.h"
2613978Smrkam#include "ar5416/ar5416reg.h"
2713978Smrkam#include "ar5416/ar5416phy.h"
2813978Smrkam#include "ar9001/ar9130_phy.h"
2913978Smrkam
3013978Smrkamvoid
3113978Smrkamar9130InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan)
3213978Smrkam{
3313978Smrkam
3413978Smrkam	uint32_t pll;
3513978Smrkam
3613978Smrkam	/*
3713978Smrkam	 * XXX TODO: support half/quarter rates
3813978Smrkam	 */
3913978Smrkam	if (chan && IEEE80211_IS_CHAN_5GHZ(chan))
4013978Smrkam		pll = 0x1450;
4113978Smrkam	else
4213978Smrkam		pll = 0x1458;
4313978Smrkam
4413978Smrkam	OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
4513978Smrkam	OS_DELAY(RTC_PLL_SETTLE_DELAY);
4613978Smrkam	OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_SLEEP_DERIVED_CLK);
4713978Smrkam}
4813978Smrkam