diff options
author | gonzo <gonzo@FreeBSD.org> | 2009-07-09 20:11:26 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2009-07-09 20:11:26 +0000 |
commit | d3fc9cc82bf32e8dbf6a2bfc47d3b61031d63b1a (patch) | |
tree | e0abfec54865386903f58dfdd15661c0c5ddd27e /sys/mips/atheros/uart_bus_ar71xx.c | |
parent | 4516fd717d6c64161c976803c8bc71609efea432 (diff) | |
download | FreeBSD-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/uart_bus_ar71xx.c')
-rw-r--r-- | sys/mips/atheros/uart_bus_ar71xx.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sys/mips/atheros/uart_bus_ar71xx.c b/sys/mips/atheros/uart_bus_ar71xx.c index 380c3da..8d83291 100644 --- a/sys/mips/atheros/uart_bus_ar71xx.c +++ b/sys/mips/atheros/uart_bus_ar71xx.c @@ -67,20 +67,9 @@ static int uart_ar71xx_probe(device_t dev) { struct uart_softc *sc; - uint32_t pll_config, div; uint64_t freq; - /* PLL freq */ - pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG); - div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1; - freq = div * AR71XX_BASE_FREQ; - /* CPU freq */ - div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK) - + 1; - freq = freq / div; - /* AHB freq */ - div = (((pll_config >> PLL_AHB_DIV_SHIFT) & PLL_AHB_DIV_MASK) + 1) * 2; - freq = freq / div; + freq = ar71xx_ahb_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); |