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>
16 #include <linux/of_address.h>
23 #define WSP_SOC_COMPATIBLE "ibm,wsp-soc"
24 #define PBIC_COMPATIBLE "ibm,wsp-pbic"
25 #define COPRO_COMPATIBLE "ibm,wsp-coprocessor"
27 static int __init wsp_probe_buses(void)
29 static __initdata struct of_device_id bus_ids[] = {
31 * every node in between needs to be here or you won't
34 { .compatible = WSP_SOC_COMPATIBLE, },
35 { .compatible = PBIC_COMPATIBLE, },
36 { .compatible = COPRO_COMPATIBLE, },
39 of_platform_bus_probe(NULL, bus_ids, NULL);
44 void __init wsp_setup_arch(void)
46 /* init to some ~sane value until calibrate_delay() runs */
47 loops_per_jiffy = 50000000;
51 /* Setup SMP callback */
60 void __init wsp_setup_irq(void)
67 int __init wsp_probe_devices(void)
69 struct device_node *np;
71 /* Our RTC is a ds1500. It seems to be programatically compatible
72 * with the ds1511 for which we have a driver so let's use that
74 np = of_find_compatible_node(NULL, NULL, "dallas,ds1500");
77 if (of_address_to_resource(np, 0, &res) == 0)
78 platform_device_register_simple("ds1511", 0, &res, 1);
90 struct device_node *dn;
91 struct device_node *mine;
92 struct device_node *me;
95 me = of_get_cpu_node(smp_processor_id(), NULL);
96 mine = scom_find_parent(me);
98 /* This will halt all the A2s but not power off the chip */
99 for_each_node_with_property(dn, "scom-controller") {
102 m = scom_map(dn, 0, 1);
104 /* read-modify-write it so the HW probe does not get
106 rc = scom_read(m, 0, &val);
108 scom_write(m, 0, val | 1);
111 m = scom_map(mine, 0, 1);
112 rc = scom_read(m, 0, &val);
114 scom_write(m, 0, val | 1);
115 /* should never return */