17 #include <linux/errno.h>
18 #include <linux/sched.h>
19 #include <linux/kernel.h>
20 #include <linux/export.h>
22 #include <linux/stddef.h>
24 #include <linux/ptrace.h>
26 #include <linux/tty.h>
27 #include <linux/string.h>
34 #include <linux/pci.h>
35 #include <linux/adb.h>
36 #include <linux/cuda.h>
37 #include <linux/pmu.h>
41 #include <linux/serial.h>
43 #include <linux/bitops.h>
47 #include <asm/processor.h>
48 #include <asm/sections.h>
50 #include <asm/pgtable.h>
52 #include <asm/pci-bridge.h>
53 #include <asm/iommu.h>
54 #include <asm/machdep.h>
56 #include <asm/cputable.h>
61 #include <asm/nvram.h>
66 #define DBG(fmt...) udbg_printf(fmt)
71 static unsigned long maple_find_nvram_base(
void)
97 static void maple_restart(
char *
cmd)
99 unsigned int maple_nvram_base;
100 const unsigned int *maple_nvram_offset, *maple_nvram_command;
103 maple_nvram_base = maple_find_nvram_base();
104 if (maple_nvram_base == 0)
118 outb_p(*maple_nvram_command, maple_nvram_base + *maple_nvram_offset);
124 static void maple_power_off(
void)
126 unsigned int maple_nvram_base;
127 const unsigned int *maple_nvram_offset, *maple_nvram_command;
130 maple_nvram_base = maple_find_nvram_base();
131 if (maple_nvram_base == 0)
145 outb_p(*maple_nvram_command, maple_nvram_base + *maple_nvram_offset);
151 static void maple_halt(
void)
157 struct smp_ops_t maple_smp_ops = {
158 .probe = smp_mpic_probe,
159 .message_pass = smp_mpic_message_pass,
160 .kick_cpu = smp_generic_kick_cpu,
161 .setup_cpu = smp_mpic_setup_cpu,
167 static void __init maple_use_rtas_reboot_and_halt_if_present(
void)
189 #ifdef CONFIG_DUMMY_CONSOLE
192 maple_use_rtas_reboot_and_halt_if_present();
202 static void __init maple_init_early(
void)
204 DBG(
" -> maple_init_early\n");
208 DBG(
" <- maple_init_early\n");
216 static void __init maple_init_IRQ(
void)
219 const unsigned int *opprop;
220 unsigned long openpic_addr = 0;
221 int naddr,
n,
i, opplen, has_isus = 0;
223 unsigned int flags = 0;
230 for_each_node_by_type(np,
"interrupt-controller")
235 if (mpic_node ==
NULL)
236 for_each_node_by_type(np,
"open-pic") {
240 if (mpic_node ==
NULL) {
242 "Failed to locate the MPIC interrupt controller\n");
251 openpic_addr = of_read_number(opprop, naddr);
252 has_isus = (opplen > naddr);
254 openpic_addr, has_isus);
257 BUG_ON(openpic_addr == 0);
261 flags |= MPIC_BIG_ENDIAN;
264 flags |= MPIC_U3_HT_IRQS;
266 flags |= MPIC_BIG_ENDIAN;
272 mpic =
mpic_alloc(mpic_node, openpic_addr, flags,
277 opplen /=
sizeof(
u32);
278 for (n = 0, i = naddr; i < opplen; i += naddr, n++) {
279 unsigned long isuaddr = of_read_number(opprop + i, naddr);
286 of_node_put(mpic_node);
290 static void __init maple_progress(
char *
s,
unsigned short hex)
292 printk(
"*** %04x : %s\n", hex, s ? s :
"");
299 static int __init maple_probe(
void)
301 unsigned long root = of_get_flat_dt_root();
303 if (!of_flat_dt_is_compatible(root,
"Momentum,Maple") &&
304 !of_flat_dt_is_compatible(root,
"Momentum,Apache"))
321 .probe = maple_probe,
323 .init_early = maple_init_early,
324 .init_IRQ = maple_init_IRQ,
327 .restart = maple_restart,
328 .power_off = maple_power_off,
334 .progress = maple_progress,
335 .power_save = power4_idle,
343 static int __init maple_cpc925_edac_setup(
void)
368 mem =
ioremap(
r.start, resource_size(&
r));
378 if (rev < 0x34 || rev > 0x3f) {
384 pdev = platform_device_register_simple(
"cpc925_edac", 0, &
r, 1);
386 return PTR_ERR(pdev);