Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Paul Mackerras | 0cb7b2a | 2005-10-29 22:07:56 +1000 | [diff] [blame] | 2 | * Maple (970 eval board) setup code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * (c) Copyright 2004 Benjamin Herrenschmidt (benh@kernel.crashing.org), |
| 5 | * IBM Corp. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License |
| 9 | * as published by the Free Software Foundation; either version |
| 10 | * 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | */ |
| 13 | |
Benjamin Herrenschmidt | 980a651 | 2006-07-03 17:22:05 +1000 | [diff] [blame] | 14 | #undef DEBUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/init.h> |
| 17 | #include <linux/errno.h> |
| 18 | #include <linux/sched.h> |
| 19 | #include <linux/kernel.h> |
| 20 | #include <linux/mm.h> |
| 21 | #include <linux/stddef.h> |
| 22 | #include <linux/unistd.h> |
| 23 | #include <linux/ptrace.h> |
| 24 | #include <linux/slab.h> |
| 25 | #include <linux/user.h> |
| 26 | #include <linux/a.out.h> |
| 27 | #include <linux/tty.h> |
| 28 | #include <linux/string.h> |
| 29 | #include <linux/delay.h> |
| 30 | #include <linux/ioport.h> |
| 31 | #include <linux/major.h> |
| 32 | #include <linux/initrd.h> |
| 33 | #include <linux/vt_kern.h> |
| 34 | #include <linux/console.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #include <linux/pci.h> |
| 36 | #include <linux/adb.h> |
| 37 | #include <linux/cuda.h> |
| 38 | #include <linux/pmu.h> |
| 39 | #include <linux/irq.h> |
| 40 | #include <linux/seq_file.h> |
| 41 | #include <linux/root_dev.h> |
| 42 | #include <linux/serial.h> |
| 43 | #include <linux/smp.h> |
Jiri Slaby | 1977f03 | 2007-10-18 23:40:25 -0700 | [diff] [blame] | 44 | #include <linux/bitops.h> |
Jon Loeliger | 0173d42 | 2008-01-08 05:07:15 +1100 | [diff] [blame] | 45 | #include <linux/of_device.h> |
David S. Miller | d9b2b2a | 2008-02-13 16:56:49 -0800 | [diff] [blame] | 46 | #include <linux/lmb.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
| 48 | #include <asm/processor.h> |
| 49 | #include <asm/sections.h> |
| 50 | #include <asm/prom.h> |
| 51 | #include <asm/system.h> |
| 52 | #include <asm/pgtable.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | #include <asm/io.h> |
Michael Ellerman | 3d1229d | 2005-11-14 23:35:00 +1100 | [diff] [blame] | 54 | #include <asm/kexec.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | #include <asm/pci-bridge.h> |
| 56 | #include <asm/iommu.h> |
| 57 | #include <asm/machdep.h> |
| 58 | #include <asm/dma.h> |
| 59 | #include <asm/cputable.h> |
| 60 | #include <asm/time.h> |
Stephen Rothwell | bbeb3f4 | 2005-09-27 13:51:59 +1000 | [diff] [blame] | 61 | #include <asm/mpic.h> |
Nathan Lynch | 9e254c4 | 2006-12-06 18:50:46 -0600 | [diff] [blame] | 62 | #include <asm/rtas.h> |
Paul Mackerras | 40ef8cb | 2005-10-10 22:50:37 +1000 | [diff] [blame] | 63 | #include <asm/udbg.h> |
Nathan Lynch | 4297c98 | 2007-02-05 20:01:15 -0600 | [diff] [blame] | 64 | #include <asm/nvram.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | |
Paul Mackerras | 0cb7b2a | 2005-10-29 22:07:56 +1000 | [diff] [blame] | 66 | #include "maple.h" |
| 67 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | #ifdef DEBUG |
| 69 | #define DBG(fmt...) udbg_printf(fmt) |
| 70 | #else |
| 71 | #define DBG(fmt...) |
| 72 | #endif |
| 73 | |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 74 | static unsigned long maple_find_nvram_base(void) |
| 75 | { |
| 76 | struct device_node *rtcs; |
| 77 | unsigned long result = 0; |
| 78 | |
| 79 | /* find NVRAM device */ |
| 80 | rtcs = of_find_compatible_node(NULL, "nvram", "AMD8111"); |
| 81 | if (rtcs) { |
| 82 | struct resource r; |
| 83 | if (of_address_to_resource(rtcs, 0, &r)) { |
| 84 | printk(KERN_EMERG "Maple: Unable to translate NVRAM" |
| 85 | " address\n"); |
| 86 | goto bail; |
| 87 | } |
| 88 | if (!(r.flags & IORESOURCE_IO)) { |
| 89 | printk(KERN_EMERG "Maple: NVRAM address isn't PIO!\n"); |
| 90 | goto bail; |
| 91 | } |
| 92 | result = r.start; |
| 93 | } else |
| 94 | printk(KERN_EMERG "Maple: Unable to find NVRAM\n"); |
| 95 | bail: |
| 96 | of_node_put(rtcs); |
| 97 | return result; |
| 98 | } |
| 99 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | static void maple_restart(char *cmd) |
| 101 | { |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 102 | unsigned int maple_nvram_base; |
Jeremy Kerr | eeb2b72 | 2006-07-12 15:40:17 +1000 | [diff] [blame] | 103 | const unsigned int *maple_nvram_offset, *maple_nvram_command; |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 104 | struct device_node *sp; |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 105 | |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 106 | maple_nvram_base = maple_find_nvram_base(); |
| 107 | if (maple_nvram_base == 0) |
| 108 | goto fail; |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 109 | |
| 110 | /* find service processor device */ |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 111 | sp = of_find_node_by_name(NULL, "service-processor"); |
| 112 | if (!sp) { |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 113 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 114 | goto fail; |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 115 | } |
Stephen Rothwell | e2eb639 | 2007-04-03 22:26:41 +1000 | [diff] [blame] | 116 | maple_nvram_offset = of_get_property(sp, "restart-addr", NULL); |
| 117 | maple_nvram_command = of_get_property(sp, "restart-value", NULL); |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 118 | of_node_put(sp); |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 119 | |
| 120 | /* send command */ |
Jeremy Kerr | eeb2b72 | 2006-07-12 15:40:17 +1000 | [diff] [blame] | 121 | outb_p(*maple_nvram_command, maple_nvram_base + *maple_nvram_offset); |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 122 | for (;;) ; |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 123 | fail: |
| 124 | printk(KERN_EMERG "Maple: Manual Restart Required\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | static void maple_power_off(void) |
| 128 | { |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 129 | unsigned int maple_nvram_base; |
Jeremy Kerr | eeb2b72 | 2006-07-12 15:40:17 +1000 | [diff] [blame] | 130 | const unsigned int *maple_nvram_offset, *maple_nvram_command; |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 131 | struct device_node *sp; |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 132 | |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 133 | maple_nvram_base = maple_find_nvram_base(); |
| 134 | if (maple_nvram_base == 0) |
| 135 | goto fail; |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 136 | |
| 137 | /* find service processor device */ |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 138 | sp = of_find_node_by_name(NULL, "service-processor"); |
| 139 | if (!sp) { |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 140 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 141 | goto fail; |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 142 | } |
Stephen Rothwell | e2eb639 | 2007-04-03 22:26:41 +1000 | [diff] [blame] | 143 | maple_nvram_offset = of_get_property(sp, "power-off-addr", NULL); |
| 144 | maple_nvram_command = of_get_property(sp, "power-off-value", NULL); |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 145 | of_node_put(sp); |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 146 | |
| 147 | /* send command */ |
Jeremy Kerr | eeb2b72 | 2006-07-12 15:40:17 +1000 | [diff] [blame] | 148 | outb_p(*maple_nvram_command, maple_nvram_base + *maple_nvram_offset); |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 149 | for (;;) ; |
Benjamin Herrenschmidt | 4c882b0 | 2006-01-14 16:35:35 +1100 | [diff] [blame] | 150 | fail: |
| 151 | printk(KERN_EMERG "Maple: Manual Power-Down Required\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | static void maple_halt(void) |
| 155 | { |
David Gibson | d7152fe | 2005-06-23 17:14:39 +1000 | [diff] [blame] | 156 | maple_power_off(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | #ifdef CONFIG_SMP |
| 160 | struct smp_ops_t maple_smp_ops = { |
| 161 | .probe = smp_mpic_probe, |
| 162 | .message_pass = smp_mpic_message_pass, |
| 163 | .kick_cpu = smp_generic_kick_cpu, |
| 164 | .setup_cpu = smp_mpic_setup_cpu, |
| 165 | .give_timebase = smp_generic_give_timebase, |
| 166 | .take_timebase = smp_generic_take_timebase, |
| 167 | }; |
| 168 | #endif /* CONFIG_SMP */ |
| 169 | |
Nathan Lynch | 9e254c4 | 2006-12-06 18:50:46 -0600 | [diff] [blame] | 170 | static void __init maple_use_rtas_reboot_and_halt_if_present(void) |
| 171 | { |
| 172 | if (rtas_service_present("system-reboot") && |
| 173 | rtas_service_present("power-off")) { |
| 174 | ppc_md.restart = rtas_restart; |
| 175 | ppc_md.power_off = rtas_power_off; |
| 176 | ppc_md.halt = rtas_halt; |
| 177 | } |
| 178 | } |
| 179 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | void __init maple_setup_arch(void) |
| 181 | { |
| 182 | /* init to some ~sane value until calibrate_delay() runs */ |
| 183 | loops_per_jiffy = 50000000; |
| 184 | |
| 185 | /* Setup SMP callback */ |
| 186 | #ifdef CONFIG_SMP |
| 187 | smp_ops = &maple_smp_ops; |
| 188 | #endif |
| 189 | /* Lookup PCI hosts */ |
| 190 | maple_pci_init(); |
| 191 | |
| 192 | #ifdef CONFIG_DUMMY_CONSOLE |
| 193 | conswitchp = &dummy_con; |
| 194 | #endif |
Nathan Lynch | 9e254c4 | 2006-12-06 18:50:46 -0600 | [diff] [blame] | 195 | maple_use_rtas_reboot_and_halt_if_present(); |
Michael Ellerman | 62d60e9 | 2005-07-07 17:56:30 -0700 | [diff] [blame] | 196 | |
Olof Johansson | 4baaf0c | 2006-04-12 15:23:22 -0500 | [diff] [blame] | 197 | printk(KERN_DEBUG "Using native/NAP idle loop\n"); |
Nathan Lynch | 4297c98 | 2007-02-05 20:01:15 -0600 | [diff] [blame] | 198 | |
| 199 | mmio_nvram_init(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | /* |
| 203 | * Early initialization. |
| 204 | */ |
| 205 | static void __init maple_init_early(void) |
| 206 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | DBG(" -> maple_init_early\n"); |
| 208 | |
Benjamin Herrenschmidt | 1beb6a7 | 2005-12-14 13:10:10 +1100 | [diff] [blame] | 209 | iommu_init_early_dart(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
| 211 | DBG(" <- maple_init_early\n"); |
| 212 | } |
| 213 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 214 | /* |
| 215 | * This is almost identical to pSeries and CHRP. We need to make that |
| 216 | * code generic at one point, with appropriate bits in the device-tree to |
| 217 | * identify the presence of an HT APIC |
| 218 | */ |
| 219 | static void __init maple_init_IRQ(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | { |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 221 | struct device_node *root, *np, *mpic_node = NULL; |
Jeremy Kerr | eeb2b72 | 2006-07-12 15:40:17 +1000 | [diff] [blame] | 222 | const unsigned int *opprop; |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 223 | unsigned long openpic_addr = 0; |
| 224 | int naddr, n, i, opplen, has_isus = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | struct mpic *mpic; |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 226 | unsigned int flags = MPIC_PRIMARY; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 228 | /* Locate MPIC in the device-tree. Note that there is a bug |
| 229 | * in Maple device-tree where the type of the controller is |
| 230 | * open-pic and not interrupt-controller |
| 231 | */ |
Segher Boessenkool | 96278d2 | 2006-07-08 02:37:20 +0200 | [diff] [blame] | 232 | |
| 233 | for_each_node_by_type(np, "interrupt-controller") |
Stephen Rothwell | 55b61fe | 2007-05-03 17:26:52 +1000 | [diff] [blame] | 234 | if (of_device_is_compatible(np, "open-pic")) { |
Segher Boessenkool | 96278d2 | 2006-07-08 02:37:20 +0200 | [diff] [blame] | 235 | mpic_node = np; |
| 236 | break; |
| 237 | } |
| 238 | if (mpic_node == NULL) |
| 239 | for_each_node_by_type(np, "open-pic") { |
| 240 | mpic_node = np; |
| 241 | break; |
| 242 | } |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 243 | if (mpic_node == NULL) { |
| 244 | printk(KERN_ERR |
| 245 | "Failed to locate the MPIC interrupt controller\n"); |
| 246 | return; |
| 247 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 249 | /* Find address list in /platform-open-pic */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | root = of_find_node_by_path("/"); |
Stephen Rothwell | a8bda5d | 2007-04-03 10:56:50 +1000 | [diff] [blame] | 251 | naddr = of_n_addr_cells(root); |
Stephen Rothwell | e2eb639 | 2007-04-03 22:26:41 +1000 | [diff] [blame] | 252 | opprop = of_get_property(root, "platform-open-pic", &opplen); |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 253 | if (opprop != 0) { |
| 254 | openpic_addr = of_read_number(opprop, naddr); |
| 255 | has_isus = (opplen > naddr); |
| 256 | printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n", |
| 257 | openpic_addr, has_isus); |
| 258 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 260 | BUG_ON(openpic_addr == 0); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 262 | /* Check for a big endian MPIC */ |
Stephen Rothwell | e2eb639 | 2007-04-03 22:26:41 +1000 | [diff] [blame] | 263 | if (of_get_property(np, "big-endian", NULL) != NULL) |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 264 | flags |= MPIC_BIG_ENDIAN; |
| 265 | |
| 266 | /* XXX Maple specific bits */ |
Michael Ellerman | 6cfef5b | 2007-04-23 18:47:08 +1000 | [diff] [blame] | 267 | flags |= MPIC_U3_HT_IRQS | MPIC_WANTS_RESET; |
Segher Boessenkool | d319a03 | 2006-07-08 02:37:23 +0200 | [diff] [blame] | 268 | /* All U3/U4 are big-endian, older SLOF firmware doesn't encode this */ |
| 269 | flags |= MPIC_BIG_ENDIAN; |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 270 | |
| 271 | /* Setup the openpic driver. More device-tree junks, we hard code no |
| 272 | * ISUs for now. I'll have to revisit some stuffs with the folks doing |
| 273 | * the firmware for those |
| 274 | */ |
| 275 | mpic = mpic_alloc(mpic_node, openpic_addr, flags, |
| 276 | /*has_isus ? 16 :*/ 0, 0, " MPIC "); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | BUG_ON(mpic == NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 279 | /* Add ISUs */ |
| 280 | opplen /= sizeof(u32); |
| 281 | for (n = 0, i = naddr; i < opplen; i += naddr, n++) { |
| 282 | unsigned long isuaddr = of_read_number(opprop + i, naddr); |
| 283 | mpic_assign_isu(mpic, n, isuaddr); |
| 284 | } |
| 285 | |
| 286 | /* All ISUs are setup, complete initialization */ |
| 287 | mpic_init(mpic); |
| 288 | ppc_md.get_irq = mpic_get_irq; |
| 289 | of_node_put(mpic_node); |
| 290 | of_node_put(root); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | static void __init maple_progress(char *s, unsigned short hex) |
| 294 | { |
| 295 | printk("*** %04x : %s\n", hex, s ? s : ""); |
| 296 | } |
| 297 | |
| 298 | |
| 299 | /* |
| 300 | * Called very early, MMU is off, device-tree isn't unflattened |
| 301 | */ |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 302 | static int __init maple_probe(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | { |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 304 | unsigned long root = of_get_flat_dt_root(); |
Benjamin Herrenschmidt | 980a651 | 2006-07-03 17:22:05 +1000 | [diff] [blame] | 305 | |
| 306 | if (!of_flat_dt_is_compatible(root, "Momentum,Maple") && |
| 307 | !of_flat_dt_is_compatible(root, "Momentum,Apache")) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | return 0; |
| 309 | /* |
| 310 | * On U3, the DART (iommu) must be allocated now since it |
| 311 | * has an impact on htab_initialize (due to the large page it |
| 312 | * occupies having to be broken up so the DART itself is not |
| 313 | * part of the cacheable linar mapping |
| 314 | */ |
Benjamin Herrenschmidt | 1beb6a7 | 2005-12-14 13:10:10 +1100 | [diff] [blame] | 315 | alloc_dart_table(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | |
Michael Ellerman | 7d0daae | 2006-06-23 18:16:38 +1000 | [diff] [blame] | 317 | hpte_init_native(); |
| 318 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | return 1; |
| 320 | } |
| 321 | |
Nathan Lynch | 53378c2 | 2008-03-13 10:43:03 +1100 | [diff] [blame] | 322 | define_machine(maple) { |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 323 | .name = "Maple", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | .probe = maple_probe, |
| 325 | .setup_arch = maple_setup_arch, |
| 326 | .init_early = maple_init_early, |
| 327 | .init_IRQ = maple_init_IRQ, |
Benjamin Herrenschmidt | f90bb15 | 2006-11-11 17:24:51 +1100 | [diff] [blame] | 328 | .pci_irq_fixup = maple_pci_irq_fixup, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, |
| 330 | .restart = maple_restart, |
| 331 | .power_off = maple_power_off, |
| 332 | .halt = maple_halt, |
| 333 | .get_boot_time = maple_get_boot_time, |
| 334 | .set_rtc_time = maple_set_rtc_time, |
| 335 | .get_rtc_time = maple_get_rtc_time, |
Arnd Bergmann | 10f7e7c | 2005-06-23 09:43:07 +1000 | [diff] [blame] | 336 | .calibrate_decr = generic_calibrate_decr, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | .progress = maple_progress, |
Paul Mackerras | a0652fc | 2006-03-27 15:03:03 +1100 | [diff] [blame] | 338 | .power_save = power4_idle, |
Michael Ellerman | 3d1229d | 2005-11-14 23:35:00 +1100 | [diff] [blame] | 339 | #ifdef CONFIG_KEXEC |
| 340 | .machine_kexec = default_machine_kexec, |
| 341 | .machine_kexec_prepare = default_machine_kexec_prepare, |
Michael Ellerman | cc53291 | 2005-12-04 18:39:43 +1100 | [diff] [blame] | 342 | .machine_crash_shutdown = default_machine_crash_shutdown, |
Michael Ellerman | 3d1229d | 2005-11-14 23:35:00 +1100 | [diff] [blame] | 343 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | }; |