2 * Copyright 2008-2011, IBM Corporation
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
10 #include <linux/kernel.h>
12 #include <linux/of_device.h>
13 #include <linux/smp.h>
14 #include <linux/delay.h>
15 #include <linux/time.h>
22 #define WSP_SOC_COMPATIBLE "ibm,wsp-soc"
23 #define PBIC_COMPATIBLE "ibm,wsp-pbic"
24 #define COPRO_COMPATIBLE "ibm,wsp-coprocessor"
26 static int __init
wsp_probe_buses(void)
28 static __initdata
struct of_device_id bus_ids
[] = {
30 * every node in between needs to be here or you won't
33 { .compatible
= WSP_SOC_COMPATIBLE
, },
34 { .compatible
= PBIC_COMPATIBLE
, },
35 { .compatible
= COPRO_COMPATIBLE
, },
38 of_platform_bus_probe(NULL
, bus_ids
, NULL
);
43 void __init
wsp_setup_arch(void)
45 /* init to some ~sane value until calibrate_delay() runs */
46 loops_per_jiffy
= 50000000;
50 /* Setup SMP callback */
59 void __init
wsp_setup_irq(void)
66 int __init
wsp_probe_devices(void)
68 struct device_node
*np
;
70 /* Our RTC is a ds1500. It seems to be programatically compatible
71 * with the ds1511 for which we have a driver so let's use that
73 np
= of_find_compatible_node(NULL
, NULL
, "dallas,ds1500");
76 if (of_address_to_resource(np
, 0, &res
) == 0)
77 platform_device_register_simple("ds1511", 0, &res
, 1);
89 struct device_node
*dn
;
90 struct device_node
*mine
;
91 struct device_node
*me
;
93 me
= of_get_cpu_node(smp_processor_id(), NULL
);
94 mine
= scom_find_parent(me
);
96 /* This will halt all the A2s but not power off the chip */
97 for_each_node_with_property(dn
, "scom-controller") {
100 m
= scom_map(dn
, 0, 1);
102 /* read-modify-write it so the HW probe does not get
104 val
= scom_read(m
, 0);
106 scom_write(m
, 0, val
);
109 m
= scom_map(mine
, 0, 1);
110 val
= scom_read(m
, 0);
112 scom_write(m
, 0, val
);
113 /* should never return */