ar91xx_chip.c (234907) | ar91xx_chip.c (248781) |
---|---|
1/*- 2 * Copyright (c) 2010 Adrian Chadd 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 Adrian Chadd 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar91xx_chip.c 234907 2012-05-02 04:51:43Z adrian $"); | 28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar91xx_chip.c 248781 2013-03-27 03:33:19Z adrian $"); |
29 30#include "opt_ddb.h" 31 32#include <sys/param.h> 33#include <sys/conf.h> 34#include <sys/kernel.h> 35#include <sys/systm.h> 36#include <sys/bus.h> --- 29 unchanged lines hidden (view full) --- 66 67static void 68ar91xx_chip_detect_sys_frequency(void) 69{ 70 uint32_t pll; 71 uint32_t freq; 72 uint32_t div; 73 | 29 30#include "opt_ddb.h" 31 32#include <sys/param.h> 33#include <sys/conf.h> 34#include <sys/kernel.h> 35#include <sys/systm.h> 36#include <sys/bus.h> --- 29 unchanged lines hidden (view full) --- 66 67static void 68ar91xx_chip_detect_sys_frequency(void) 69{ 70 uint32_t pll; 71 uint32_t freq; 72 uint32_t div; 73 |
74 u_ar71xx_refclk = AR91XX_BASE_FREQ; 75 |
|
74 pll = ATH_READ_REG(AR91XX_PLL_REG_CPU_CONFIG); 75 76 div = ((pll >> AR91XX_PLL_DIV_SHIFT) & AR91XX_PLL_DIV_MASK); 77 freq = div * AR91XX_BASE_FREQ; 78 u_ar71xx_cpu_freq = freq; 79 80 div = ((pll >> AR91XX_DDR_DIV_SHIFT) & AR91XX_DDR_DIV_MASK) + 1; 81 u_ar71xx_ddr_freq = freq / div; --- 138 unchanged lines hidden --- | 76 pll = ATH_READ_REG(AR91XX_PLL_REG_CPU_CONFIG); 77 78 div = ((pll >> AR91XX_PLL_DIV_SHIFT) & AR91XX_PLL_DIV_MASK); 79 freq = div * AR91XX_BASE_FREQ; 80 u_ar71xx_cpu_freq = freq; 81 82 div = ((pll >> AR91XX_DDR_DIV_SHIFT) & AR91XX_DDR_DIV_MASK) + 1; 83 u_ar71xx_ddr_freq = freq / div; --- 138 unchanged lines hidden --- |