Deleted Added
full compact
ar724x_chip.c (234907) ar724x_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/ar724x_chip.c 234907 2012-05-02 04:51:43Z adrian $");
28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar724x_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>

--- 31 unchanged lines hidden (view full) ---

68
69static void
70ar724x_chip_detect_sys_frequency(void)
71{
72 uint32_t pll;
73 uint32_t freq;
74 uint32_t div;
75
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>

--- 31 unchanged lines hidden (view full) ---

68
69static void
70ar724x_chip_detect_sys_frequency(void)
71{
72 uint32_t pll;
73 uint32_t freq;
74 uint32_t div;
75
76 u_ar71xx_refclk = AR724X_BASE_FREQ;
77
76 pll = ATH_READ_REG(AR724X_PLL_REG_CPU_CONFIG);
77
78 div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_MASK);
79 freq = div * AR724X_BASE_FREQ;
80
81 div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
82 freq *= div;
83

--- 162 unchanged lines hidden ---
78 pll = ATH_READ_REG(AR724X_PLL_REG_CPU_CONFIG);
79
80 div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_MASK);
81 freq = div * AR724X_BASE_FREQ;
82
83 div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
84 freq *= div;
85

--- 162 unchanged lines hidden ---