summaryrefslogtreecommitdiffstats
path: root/sys/mips/atheros/ar71xx_machdep.c
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2009-07-09 20:11:26 +0000
committergonzo <gonzo@FreeBSD.org>2009-07-09 20:11:26 +0000
commitd3fc9cc82bf32e8dbf6a2bfc47d3b61031d63b1a (patch)
treee0abfec54865386903f58dfdd15661c0c5ddd27e /sys/mips/atheros/ar71xx_machdep.c
parent4516fd717d6c64161c976803c8bc71609efea432 (diff)
downloadFreeBSD-src-d3fc9cc82bf32e8dbf6a2bfc47d3b61031d63b1a.zip
FreeBSD-src-d3fc9cc82bf32e8dbf6a2bfc47d3b61031d63b1a.tar.gz
- Move CPU/AHB frequency calculations to functions to
prevent code duplication
Diffstat (limited to 'sys/mips/atheros/ar71xx_machdep.c')
-rw-r--r--sys/mips/atheros/ar71xx_machdep.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/mips/atheros/ar71xx_machdep.c b/sys/mips/atheros/ar71xx_machdep.c
index a120959..6ca395a 100644
--- a/sys/mips/atheros/ar71xx_machdep.c
+++ b/sys/mips/atheros/ar71xx_machdep.c
@@ -100,8 +100,8 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused,
__register_t a2 __unused, __register_t a3 __unused)
{
vm_offset_t kernend;
- uint64_t platform_counter_freq, freq;
- uint32_t reg, div, pll_config;
+ uint64_t platform_counter_freq;
+ uint32_t reg;
int argc, i, count = 0;
char **argv, **envp;
@@ -151,12 +151,7 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused,
* should be called first.
*/
init_param1();
- pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG);
- div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1;
- freq = div * AR71XX_BASE_FREQ;
- div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK)
- + 1;
- platform_counter_freq = freq / div;
+ platform_counter_freq = ar71xx_cpu_freq();
mips_timer_init_params(platform_counter_freq, 1);
cninit();
OpenPOWER on IntegriCloud