diff options
Diffstat (limited to 'arch/powerpc/platforms/wsp/psr2.c')
-rw-r--r-- | arch/powerpc/platforms/wsp/psr2.c | 56 |
1 files changed, 12 insertions, 44 deletions
diff --git a/arch/powerpc/platforms/wsp/psr2.c b/arch/powerpc/platforms/wsp/psr2.c index 166f2e4b4bee..0c1ae06d0be1 100644 --- a/arch/powerpc/platforms/wsp/psr2.c +++ b/arch/powerpc/platforms/wsp/psr2.c | |||
@@ -14,10 +14,10 @@ | |||
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/of.h> | 15 | #include <linux/of.h> |
16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | #include <linux/time.h> | ||
17 | 18 | ||
18 | #include <asm/machdep.h> | 19 | #include <asm/machdep.h> |
19 | #include <asm/system.h> | 20 | #include <asm/system.h> |
20 | #include <asm/time.h> | ||
21 | #include <asm/udbg.h> | 21 | #include <asm/udbg.h> |
22 | 22 | ||
23 | #include "ics.h" | 23 | #include "ics.h" |
@@ -27,7 +27,8 @@ | |||
27 | static void psr2_spin(void) | 27 | static void psr2_spin(void) |
28 | { | 28 | { |
29 | hard_irq_disable(); | 29 | hard_irq_disable(); |
30 | for (;;) ; | 30 | for (;;) |
31 | continue; | ||
31 | } | 32 | } |
32 | 33 | ||
33 | static void psr2_restart(char *cmd) | 34 | static void psr2_restart(char *cmd) |
@@ -35,65 +36,32 @@ static void psr2_restart(char *cmd) | |||
35 | psr2_spin(); | 36 | psr2_spin(); |
36 | } | 37 | } |
37 | 38 | ||
38 | static int psr2_probe_devices(void) | ||
39 | { | ||
40 | struct device_node *np; | ||
41 | |||
42 | /* Our RTC is a ds1500. It seems to be programatically compatible | ||
43 | * with the ds1511 for which we have a driver so let's use that | ||
44 | */ | ||
45 | np = of_find_compatible_node(NULL, NULL, "dallas,ds1500"); | ||
46 | if (np != NULL) { | ||
47 | struct resource res; | ||
48 | if (of_address_to_resource(np, 0, &res) == 0) | ||
49 | platform_device_register_simple("ds1511", 0, &res, 1); | ||
50 | } | ||
51 | return 0; | ||
52 | } | ||
53 | machine_arch_initcall(psr2_md, psr2_probe_devices); | ||
54 | |||
55 | static void __init psr2_setup_arch(void) | ||
56 | { | ||
57 | /* init to some ~sane value until calibrate_delay() runs */ | ||
58 | loops_per_jiffy = 50000000; | ||
59 | |||
60 | scom_init_wsp(); | ||
61 | |||
62 | /* Setup SMP callback */ | ||
63 | #ifdef CONFIG_SMP | ||
64 | a2_setup_smp(); | ||
65 | #endif | ||
66 | #ifdef CONFIG_PCI | ||
67 | wsp_setup_pci(); | ||
68 | #endif | ||
69 | |||
70 | } | ||
71 | |||
72 | static int __init psr2_probe(void) | 39 | static int __init psr2_probe(void) |
73 | { | 40 | { |
74 | unsigned long root = of_get_flat_dt_root(); | 41 | unsigned long root = of_get_flat_dt_root(); |
75 | 42 | ||
43 | if (of_flat_dt_is_compatible(root, "ibm,wsp-chroma")) { | ||
44 | /* chroma systems also claim they are psr2s */ | ||
45 | return 0; | ||
46 | } | ||
47 | |||
76 | if (!of_flat_dt_is_compatible(root, "ibm,psr2")) | 48 | if (!of_flat_dt_is_compatible(root, "ibm,psr2")) |
77 | return 0; | 49 | return 0; |
78 | 50 | ||
79 | return 1; | 51 | return 1; |
80 | } | 52 | } |
81 | 53 | ||
82 | static void __init psr2_init_irq(void) | ||
83 | { | ||
84 | wsp_init_irq(); | ||
85 | opb_pic_init(); | ||
86 | } | ||
87 | |||
88 | define_machine(psr2_md) { | 54 | define_machine(psr2_md) { |
89 | .name = "PSR2 A2", | 55 | .name = "PSR2 A2", |
90 | .probe = psr2_probe, | 56 | .probe = psr2_probe, |
91 | .setup_arch = psr2_setup_arch, | 57 | .setup_arch = wsp_setup_arch, |
92 | .restart = psr2_restart, | 58 | .restart = psr2_restart, |
93 | .power_off = psr2_spin, | 59 | .power_off = psr2_spin, |
94 | .halt = psr2_spin, | 60 | .halt = psr2_spin, |
95 | .calibrate_decr = generic_calibrate_decr, | 61 | .calibrate_decr = generic_calibrate_decr, |
96 | .init_IRQ = psr2_init_irq, | 62 | .init_IRQ = wsp_setup_irq, |
97 | .progress = udbg_progress, | 63 | .progress = udbg_progress, |
98 | .power_save = book3e_idle, | 64 | .power_save = book3e_idle, |
99 | }; | 65 | }; |
66 | |||
67 | machine_arch_initcall(psr2_md, wsp_probe_devices); | ||