ARM: ux500: move soc_id driver to drivers/soc
[linux-2.6/btrfs-unstable.git] / arch / arm / mach-ux500 / cpu.c
bloba34af283ee231a631ff8d7f12aa9feffc7424ea5
1 /*
2 * Copyright (C) ST-Ericsson SA 2010
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson
6 * License terms: GNU General Public License (GPL) version 2
7 */
9 #include <linux/platform_device.h>
10 #include <linux/io.h>
11 #include <linux/mfd/dbx500-prcmu.h>
12 #include <linux/sys_soc.h>
13 #include <linux/err.h>
14 #include <linux/slab.h>
15 #include <linux/stat.h>
16 #include <linux/of.h>
17 #include <linux/of_irq.h>
18 #include <linux/of_address.h>
19 #include <linux/irq.h>
20 #include <linux/irqchip.h>
21 #include <linux/irqchip/arm-gic.h>
22 #include <linux/platform_data/arm-ux500-pm.h>
24 #include <asm/mach/map.h>
26 #include "setup.h"
28 #include "board-mop500.h"
29 #include "db8500-regs.h"
31 void ux500_restart(enum reboot_mode mode, const char *cmd)
33 local_irq_disable();
34 local_fiq_disable();
36 prcmu_system_reset(0);
40 * FIXME: Should we set up the GPIO domain here?
42 * The problem is that we cannot put the interrupt resources into the platform
43 * device until the irqdomain has been added. Right now, we set the GIC interrupt
44 * domain from init_irq(), then load the gpio driver from
45 * core_initcall(nmk_gpio_init) and add the platform devices from
46 * arch_initcall(customize_machine).
48 * This feels fragile because it depends on the gpio device getting probed
49 * _before_ any device uses the gpio interrupts.
51 void __init ux500_init_irq(void)
53 struct device_node *np;
54 struct resource r;
56 irqchip_init();
57 np = of_find_compatible_node(NULL, NULL, "stericsson,db8500-prcmu");
58 of_address_to_resource(np, 0, &r);
59 of_node_put(np);
60 if (!r.start) {
61 pr_err("could not find PRCMU base resource\n");
62 return;
64 prcmu_early_init(r.start, r.end-r.start);
65 ux500_pm_init(r.start, r.end-r.start);
66 ux500_l2x0_init();