ARM: ux500: consolidate soc_device code in id.c
[deliverable/linux.git] / arch / arm / mach-ux500 / cpu.c
CommitLineData
178980f9
RV
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
eda413c2 5 * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson
178980f9
RV
6 * License terms: GNU General Public License (GPL) version 2
7 */
8
9#include <linux/platform_device.h>
178980f9 10#include <linux/io.h>
9a47a8dc 11#include <linux/mfd/dbx500-prcmu.h>
eda413c2
LJ
12#include <linux/sys_soc.h>
13#include <linux/err.h>
14#include <linux/slab.h>
15#include <linux/stat.h>
dab6487e
LJ
16#include <linux/of.h>
17#include <linux/of_irq.h>
6252bd35 18#include <linux/of_address.h>
1ae32557 19#include <linux/irq.h>
0529e315 20#include <linux/irqchip.h>
520f7bd7 21#include <linux/irqchip/arm-gic.h>
1e22a8c6 22#include <linux/platform_data/arm-ux500-pm.h>
178980f9 23
178980f9
RV
24#include <asm/mach/map.h>
25
e657bcf6 26#include "setup.h"
178980f9 27
0ddf855a 28#include "board-mop500.h"
174e7796 29#include "db8500-regs.h"
0ddf855a 30
bd93ec50
FB
31void ux500_restart(enum reboot_mode mode, const char *cmd)
32{
33 local_irq_disable();
34 local_fiq_disable();
35
36 prcmu_system_reset(0);
37}
38
a60b57ed
LJ
39/*
40 * FIXME: Should we set up the GPIO domain here?
41 *
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).
47 *
48 * This feels fragile because it depends on the gpio device getting probed
49 * _before_ any device uses the gpio interrupts.
50*/
178980f9
RV
51void __init ux500_init_irq(void)
52{
6252bd35
LW
53 struct device_node *np;
54 struct resource r;
55
e937274f 56 irqchip_init();
6252bd35
LW
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;
63 }
64 prcmu_early_init(r.start, r.end-r.start);
65 ux500_pm_init(r.start, r.end-r.start);
1e6cbc06 66 ux500_l2x0_init();
178980f9 67}
This page took 0.300174 seconds and 5 git commands to generate.