Deleted Added
full compact
at91_pmc.c (213498) at91_pmc.c (216227)
1/*-
2 * Copyright (c) 2006 M. Warner Losh. All rights reserved.
3 * Copyright (c) 2010 Greg Ansley. 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) 2006 M. Warner Losh. All rights reserved.
3 * Copyright (c) 2010 Greg Ansley. 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/arm/at91/at91_pmc.c 213498 2010-10-06 22:40:27Z cognet $");
28__FBSDID("$FreeBSD: head/sys/arm/at91/at91_pmc.c 216227 2010-12-06 10:24:06Z kevlo $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/malloc.h>
34#include <sys/module.h>
35#include <sys/time.h>
36#include <sys/bus.h>

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

320 clk->set_mode(clk, 0);
321 if (clk->parent)
322 at91_pmc_clock_disable(clk->parent);
323}
324
325static int
326at91_pmc_pll_rate(struct at91_pmc_clock *clk, uint32_t reg)
327{
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/malloc.h>
34#include <sys/module.h>
35#include <sys/time.h>
36#include <sys/bus.h>

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

320 clk->set_mode(clk, 0);
321 if (clk->parent)
322 at91_pmc_clock_disable(clk->parent);
323}
324
325static int
326at91_pmc_pll_rate(struct at91_pmc_clock *clk, uint32_t reg)
327{
328 uint32_t mul, div, freq;;
328 uint32_t mul, div, freq;
329
330 freq = clk->parent->hz;
331 div = (reg >> clk->pll_div_shift) & clk->pll_div_mask;
332 mul = (reg >> clk->pll_mul_shift) & clk->pll_mul_mask;
333
334// printf("pll = (%d / %d) * %d = %d\n",
335// freq, div ,mul + 1, (freq/div) * (mul+1));
336

--- 251 unchanged lines hidden ---
329
330 freq = clk->parent->hz;
331 div = (reg >> clk->pll_div_shift) & clk->pll_div_mask;
332 mul = (reg >> clk->pll_mul_shift) & clk->pll_mul_mask;
333
334// printf("pll = (%d / %d) * %d = %d\n",
335// freq, div ,mul + 1, (freq/div) * (mul+1));
336

--- 251 unchanged lines hidden ---