Merge remote-tracking branch 'moduleh/module.h-split'
[linux-2.6/next.git] / arch / arm / mach-ux500 / cpu.c
blob252e8b3c570649a2248918bb261cc7e67ba824a3
1 /*
2 * Copyright (C) ST-Ericsson SA 2010
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
8 #include <linux/platform_device.h>
9 #include <linux/io.h>
10 #include <linux/clk.h>
11 #include <linux/mfd/db8500-prcmu.h>
12 #include <linux/mfd/db5500-prcmu.h>
14 #include <asm/hardware/gic.h>
15 #include <asm/mach/map.h>
16 #include <asm/localtimer.h>
18 #include <plat/mtu.h>
19 #include <mach/hardware.h>
20 #include <mach/setup.h>
21 #include <mach/devices.h>
23 #include "clock.h"
25 void __iomem *_PRCMU_BASE;
27 void __init ux500_init_irq(void)
29 void __iomem *dist_base;
30 void __iomem *cpu_base;
32 if (cpu_is_u5500()) {
33 dist_base = __io_address(U5500_GIC_DIST_BASE);
34 cpu_base = __io_address(U5500_GIC_CPU_BASE);
35 } else if (cpu_is_u8500()) {
36 dist_base = __io_address(U8500_GIC_DIST_BASE);
37 cpu_base = __io_address(U8500_GIC_CPU_BASE);
38 } else
39 ux500_unknown_soc();
41 gic_init(0, 29, dist_base, cpu_base);
44 * Init clocks here so that they are available for system timer
45 * initialization.
47 if (cpu_is_u5500())
48 db5500_prcmu_early_init();
49 if (cpu_is_u8500())
50 prcmu_early_init();
51 clk_init();
54 static void __init ux500_timer_init(void)
56 #ifdef CONFIG_LOCAL_TIMERS
57 /* Setup the local timer base */
58 if (cpu_is_u5500())
59 twd_base = __io_address(U5500_TWD_BASE);
60 else if (cpu_is_u8500())
61 twd_base = __io_address(U8500_TWD_BASE);
62 else
63 ux500_unknown_soc();
64 #endif
65 if (cpu_is_u5500())
66 mtu_base = __io_address(U5500_MTU0_BASE);
67 else if (cpu_is_u8500ed())
68 mtu_base = __io_address(U8500_MTU0_BASE_ED);
69 else if (cpu_is_u8500())
70 mtu_base = __io_address(U8500_MTU0_BASE);
71 else
72 ux500_unknown_soc();
74 nmdk_timer_init();
77 struct sys_timer ux500_timer = {
78 .init = ux500_timer_init,