ar9130_phy.c revision 221163
1221163Sadrian/* 2221163Sadrian * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd 3221163Sadrian * Copyright (c) 2010 Atheros Communications, Inc. 4221163Sadrian * 5221163Sadrian * Permission to use, copy, modify, and/or distribute this software for any 6221163Sadrian * purpose with or without fee is hereby granted, provided that the above 7221163Sadrian * copyright notice and this permission notice appear in all copies. 8221163Sadrian * 9221163Sadrian * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10221163Sadrian * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11221163Sadrian * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12221163Sadrian * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13221163Sadrian * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14221163Sadrian * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15221163Sadrian * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16221163Sadrian * 17221163Sadrian * $FreeBSD: head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c 221163 2011-04-28 12:47:40Z adrian $ 18221163Sadrian */ 19221163Sadrian#include "opt_ah.h" 20221163Sadrian 21221163Sadrian#include "ah.h" 22221163Sadrian#include "ah_internal.h" 23221163Sadrian#include "ah_devid.h" 24221163Sadrian 25221163Sadrian#include "ar5416/ar5416.h" 26221163Sadrian#include "ar5416/ar5416reg.h" 27221163Sadrian#include "ar5416/ar5416phy.h" 28221163Sadrian#include "ar9001/ar9130_phy.h" 29221163Sadrian 30221163Sadrianvoid 31221163Sadrianar9130InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) 32221163Sadrian{ 33221163Sadrian 34221163Sadrian uint32_t pll; 35221163Sadrian 36221163Sadrian if (chan && IEEE80211_IS_CHAN_5GHZ(chan)) 37221163Sadrian pll = 0x1450; 38221163Sadrian else 39221163Sadrian pll = 0x1458; 40221163Sadrian 41221163Sadrian OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); 42221163Sadrian OS_DELAY(RTC_PLL_SETTLE_DELAY); 43221163Sadrian OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_SLEEP_DERIVED_CLK); 44221163Sadrian} 45