OMAP: Add new function to check wether there is irq pending
[linux-ginger.git] / arch / arm / mach-ns9xxx / processor-ns9360.c
blobabee8338735d471884dc057cfac76b3e5cab4790
1 /*
2 * arch/arm/mach-ns9xxx/processor-ns9360.c
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
11 #include <linux/io.h>
12 #include <linux/kernel.h>
13 #include <linux/slab.h>
15 #include <asm/page.h>
16 #include <asm/mach/map.h>
17 #include <mach/processor-ns9360.h>
18 #include <mach/regs-sys-ns9360.h>
20 void ns9360_reset(char mode)
22 u32 reg;
24 reg = __raw_readl(SYS_PLL) >> 16;
25 REGSET(reg, SYS_PLL, SWC, YES);
26 __raw_writel(reg, SYS_PLL);
29 #define CRYSTAL 29491200 /* Hz */
30 unsigned long ns9360_systemclock(void)
32 u32 pll = __raw_readl(SYS_PLL);
33 return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
34 >> REGGETIM(pll, SYS_PLL, FS);
37 static struct map_desc ns9360_io_desc[] __initdata = {
38 { /* BBus */
39 .virtual = io_p2v(0x90000000),
40 .pfn = __phys_to_pfn(0x90000000),
41 .length = 0x00700000,
42 .type = MT_DEVICE,
43 }, { /* AHB */
44 .virtual = io_p2v(0xa0100000),
45 .pfn = __phys_to_pfn(0xa0100000),
46 .length = 0x00900000,
47 .type = MT_DEVICE,
51 void __init ns9360_map_io(void)
53 iotable_init(ns9360_io_desc, ARRAY_SIZE(ns9360_io_desc));