Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 1 | /* |
Olof Johansson | 31c56d8 | 2007-02-04 16:36:55 -0600 | [diff] [blame] | 2 | * Copyright (C) 2006-2007 PA Semi, Inc |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 3 | * |
| 4 | * Authors: Kip Walker, PA Semi |
| 5 | * Olof Johansson, PA Semi |
| 6 | * |
| 7 | * Maintained by: Olof Johansson <olof@lixom.net> |
| 8 | * |
| 9 | * Based on arch/powerpc/platforms/maple/setup.c |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program; if not, write to the Free Software |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 | */ |
| 24 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 25 | #include <linux/errno.h> |
| 26 | #include <linux/kernel.h> |
| 27 | #include <linux/delay.h> |
| 28 | #include <linux/console.h> |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 29 | #include <linux/pci.h> |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 30 | |
| 31 | #include <asm/prom.h> |
| 32 | #include <asm/system.h> |
| 33 | #include <asm/iommu.h> |
| 34 | #include <asm/machdep.h> |
| 35 | #include <asm/mpic.h> |
| 36 | #include <asm/smp.h> |
| 37 | #include <asm/time.h> |
Olof Johansson | 952418c | 2007-04-25 04:01:34 +1000 | [diff] [blame] | 38 | #include <asm/of_platform.h> |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 39 | |
Olof Johansson | 2b571a0 | 2007-10-16 23:26:20 -0700 | [diff] [blame^] | 40 | #include <pcmcia/ss.h> |
| 41 | #include <pcmcia/cistpl.h> |
| 42 | #include <pcmcia/ds.h> |
| 43 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 44 | #include "pasemi.h" |
| 45 | |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 46 | /* SDC reset register, must be pre-mapped at reset time */ |
Olof Johansson | f620be9 | 2007-02-04 16:36:52 -0600 | [diff] [blame] | 47 | static void __iomem *reset_reg; |
| 48 | |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 49 | /* Various error status registers, must be pre-mapped at MCE time */ |
| 50 | |
| 51 | #define MAX_MCE_REGS 32 |
| 52 | struct mce_regs { |
| 53 | char *name; |
| 54 | void __iomem *addr; |
| 55 | }; |
| 56 | |
| 57 | static struct mce_regs mce_regs[MAX_MCE_REGS]; |
| 58 | static int num_mce_regs; |
| 59 | |
| 60 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 61 | static void pas_restart(char *cmd) |
| 62 | { |
Olof Johansson | f620be9 | 2007-02-04 16:36:52 -0600 | [diff] [blame] | 63 | printk("Restarting...\n"); |
| 64 | while (1) |
| 65 | out_le32(reset_reg, 0x6000000); |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | #ifdef CONFIG_SMP |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 69 | static DEFINE_SPINLOCK(timebase_lock); |
Olof Johansson | dc559f7 | 2007-08-22 12:26:43 +1000 | [diff] [blame] | 70 | static unsigned long timebase; |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 71 | |
| 72 | static void __devinit pas_give_timebase(void) |
| 73 | { |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 74 | spin_lock(&timebase_lock); |
| 75 | mtspr(SPRN_TBCTL, TBCTL_FREEZE); |
Olof Johansson | dc559f7 | 2007-08-22 12:26:43 +1000 | [diff] [blame] | 76 | isync(); |
| 77 | timebase = get_tb(); |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 78 | spin_unlock(&timebase_lock); |
Olof Johansson | dc559f7 | 2007-08-22 12:26:43 +1000 | [diff] [blame] | 79 | |
| 80 | while (timebase) |
| 81 | barrier(); |
| 82 | mtspr(SPRN_TBCTL, TBCTL_RESTART); |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | static void __devinit pas_take_timebase(void) |
| 86 | { |
Olof Johansson | dc559f7 | 2007-08-22 12:26:43 +1000 | [diff] [blame] | 87 | while (!timebase) |
| 88 | smp_rmb(); |
| 89 | |
| 90 | spin_lock(&timebase_lock); |
| 91 | set_tb(timebase >> 32, timebase & 0xffffffff); |
| 92 | timebase = 0; |
| 93 | spin_unlock(&timebase_lock); |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 94 | } |
| 95 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 96 | struct smp_ops_t pas_smp_ops = { |
| 97 | .probe = smp_mpic_probe, |
| 98 | .message_pass = smp_mpic_message_pass, |
| 99 | .kick_cpu = smp_generic_kick_cpu, |
| 100 | .setup_cpu = smp_mpic_setup_cpu, |
Olof Johansson | c388cfe | 2007-02-04 16:36:53 -0600 | [diff] [blame] | 101 | .give_timebase = pas_give_timebase, |
| 102 | .take_timebase = pas_take_timebase, |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 103 | }; |
| 104 | #endif /* CONFIG_SMP */ |
| 105 | |
| 106 | void __init pas_setup_arch(void) |
| 107 | { |
| 108 | #ifdef CONFIG_SMP |
| 109 | /* Setup SMP callback */ |
| 110 | smp_ops = &pas_smp_ops; |
| 111 | #endif |
| 112 | /* Lookup PCI hosts */ |
| 113 | pas_pci_init(); |
| 114 | |
| 115 | #ifdef CONFIG_DUMMY_CONSOLE |
| 116 | conswitchp = &dummy_con; |
| 117 | #endif |
| 118 | |
Olof Johansson | f620be9 | 2007-02-04 16:36:52 -0600 | [diff] [blame] | 119 | /* Remap SDC register for doing reset */ |
| 120 | /* XXXOJN This should maybe come out of the device tree */ |
| 121 | reset_reg = ioremap(0xfc101100, 4); |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 122 | } |
| 123 | |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 124 | static int __init pas_setup_mce_regs(void) |
| 125 | { |
| 126 | struct pci_dev *dev; |
| 127 | int reg; |
| 128 | |
| 129 | if (!machine_is(pasemi)) |
| 130 | return -ENODEV; |
| 131 | |
| 132 | /* Remap various SoC status registers for use by the MCE handler */ |
| 133 | |
| 134 | reg = 0; |
| 135 | |
| 136 | dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, NULL); |
| 137 | while (dev && reg < MAX_MCE_REGS) { |
| 138 | mce_regs[reg].name = kasprintf(GFP_KERNEL, |
| 139 | "mc%d_mcdebug_errsta", reg); |
| 140 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x730); |
| 141 | dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, dev); |
| 142 | reg++; |
| 143 | } |
| 144 | |
| 145 | dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL); |
| 146 | if (dev && reg+4 < MAX_MCE_REGS) { |
| 147 | mce_regs[reg].name = "iobdbg_IntStatus1"; |
| 148 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x438); |
| 149 | reg++; |
| 150 | mce_regs[reg].name = "iobdbg_IOCTbusIntDbgReg"; |
| 151 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x454); |
| 152 | reg++; |
| 153 | mce_regs[reg].name = "iobiom_IntStatus"; |
| 154 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0xc10); |
| 155 | reg++; |
| 156 | mce_regs[reg].name = "iobiom_IntDbgReg"; |
| 157 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0xc1c); |
| 158 | reg++; |
| 159 | } |
| 160 | |
| 161 | dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa009, NULL); |
| 162 | if (dev && reg+2 < MAX_MCE_REGS) { |
| 163 | mce_regs[reg].name = "l2csts_IntStatus"; |
| 164 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x200); |
| 165 | reg++; |
| 166 | mce_regs[reg].name = "l2csts_Cnt"; |
| 167 | mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x214); |
| 168 | reg++; |
| 169 | } |
| 170 | |
| 171 | num_mce_regs = reg; |
| 172 | |
| 173 | return 0; |
| 174 | } |
| 175 | device_initcall(pas_setup_mce_regs); |
| 176 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 177 | static __init void pas_init_IRQ(void) |
| 178 | { |
| 179 | struct device_node *np; |
| 180 | struct device_node *root, *mpic_node; |
| 181 | unsigned long openpic_addr; |
| 182 | const unsigned int *opprop; |
| 183 | int naddr, opplen; |
| 184 | struct mpic *mpic; |
| 185 | |
| 186 | mpic_node = NULL; |
| 187 | |
| 188 | for_each_node_by_type(np, "interrupt-controller") |
Stephen Rothwell | 55b61fe | 2007-05-03 17:26:52 +1000 | [diff] [blame] | 189 | if (of_device_is_compatible(np, "open-pic")) { |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 190 | mpic_node = np; |
| 191 | break; |
| 192 | } |
| 193 | if (!mpic_node) |
| 194 | for_each_node_by_type(np, "open-pic") { |
| 195 | mpic_node = np; |
| 196 | break; |
| 197 | } |
| 198 | if (!mpic_node) { |
| 199 | printk(KERN_ERR |
| 200 | "Failed to locate the MPIC interrupt controller\n"); |
| 201 | return; |
| 202 | } |
| 203 | |
| 204 | /* Find address list in /platform-open-pic */ |
| 205 | root = of_find_node_by_path("/"); |
Stephen Rothwell | a8bda5d | 2007-04-03 10:56:50 +1000 | [diff] [blame] | 206 | naddr = of_n_addr_cells(root); |
Stephen Rothwell | e2eb639 | 2007-04-03 22:26:41 +1000 | [diff] [blame] | 207 | opprop = of_get_property(root, "platform-open-pic", &opplen); |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 208 | if (!opprop) { |
| 209 | printk(KERN_ERR "No platform-open-pic property.\n"); |
| 210 | of_node_put(root); |
| 211 | return; |
| 212 | } |
| 213 | openpic_addr = of_read_number(opprop, naddr); |
| 214 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 215 | |
Olof Johansson | 7df2457d | 2007-01-28 23:33:18 -0600 | [diff] [blame] | 216 | mpic = mpic_alloc(mpic_node, openpic_addr, |
Olof Johansson | 7e8bddf | 2007-04-16 16:28:38 +1000 | [diff] [blame] | 217 | MPIC_PRIMARY|MPIC_LARGE_VECTORS|MPIC_WANTS_RESET, |
Olof Johansson | 7df2457d | 2007-01-28 23:33:18 -0600 | [diff] [blame] | 218 | 0, 0, " PAS-OPIC "); |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 219 | BUG_ON(!mpic); |
| 220 | |
| 221 | mpic_assign_isu(mpic, 0, openpic_addr + 0x10000); |
| 222 | mpic_init(mpic); |
| 223 | of_node_put(mpic_node); |
| 224 | of_node_put(root); |
| 225 | } |
| 226 | |
| 227 | static void __init pas_progress(char *s, unsigned short hex) |
| 228 | { |
| 229 | printk("[%04x] : %s\n", hex, s ? s : ""); |
| 230 | } |
| 231 | |
| 232 | |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 233 | static int pas_machine_check_handler(struct pt_regs *regs) |
| 234 | { |
| 235 | int cpu = smp_processor_id(); |
| 236 | unsigned long srr0, srr1, dsisr; |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 237 | int dump_slb = 0; |
| 238 | int i; |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 239 | |
| 240 | srr0 = regs->nip; |
| 241 | srr1 = regs->msr; |
| 242 | dsisr = mfspr(SPRN_DSISR); |
| 243 | printk(KERN_ERR "Machine Check on CPU %d\n", cpu); |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 244 | printk(KERN_ERR "SRR0 0x%016lx SRR1 0x%016lx\n", srr0, srr1); |
| 245 | printk(KERN_ERR "DSISR 0x%016lx DAR 0x%016lx\n", dsisr, regs->dar); |
| 246 | printk(KERN_ERR "BER 0x%016lx MER 0x%016lx\n", mfspr(SPRN_PA6T_BER), |
| 247 | mfspr(SPRN_PA6T_MER)); |
| 248 | printk(KERN_ERR "IER 0x%016lx DER 0x%016lx\n", mfspr(SPRN_PA6T_IER), |
| 249 | mfspr(SPRN_PA6T_DER)); |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 250 | printk(KERN_ERR "Cause:\n"); |
| 251 | |
| 252 | if (srr1 & 0x200000) |
| 253 | printk(KERN_ERR "Signalled by SDC\n"); |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 254 | |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 255 | if (srr1 & 0x100000) { |
| 256 | printk(KERN_ERR "Load/Store detected error:\n"); |
| 257 | if (dsisr & 0x8000) |
| 258 | printk(KERN_ERR "D-cache ECC double-bit error or bus error\n"); |
| 259 | if (dsisr & 0x4000) |
| 260 | printk(KERN_ERR "LSU snoop response error\n"); |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 261 | if (dsisr & 0x2000) { |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 262 | printk(KERN_ERR "MMU SLB multi-hit or invalid B field\n"); |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 263 | dump_slb = 1; |
| 264 | } |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 265 | if (dsisr & 0x1000) |
| 266 | printk(KERN_ERR "Recoverable Duptags\n"); |
| 267 | if (dsisr & 0x800) |
| 268 | printk(KERN_ERR "Recoverable D-cache parity error count overflow\n"); |
| 269 | if (dsisr & 0x400) |
| 270 | printk(KERN_ERR "TLB parity error count overflow\n"); |
| 271 | } |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 272 | |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 273 | if (srr1 & 0x80000) |
| 274 | printk(KERN_ERR "Bus Error\n"); |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 275 | |
| 276 | if (srr1 & 0x40000) { |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 277 | printk(KERN_ERR "I-side SLB multiple hit\n"); |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 278 | dump_slb = 1; |
| 279 | } |
| 280 | |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 281 | if (srr1 & 0x20000) |
| 282 | printk(KERN_ERR "I-cache parity error hit\n"); |
| 283 | |
Olof Johansson | cd78341 | 2007-09-05 12:09:23 +1000 | [diff] [blame] | 284 | if (num_mce_regs == 0) |
| 285 | printk(KERN_ERR "No MCE registers mapped yet, can't dump\n"); |
| 286 | else |
| 287 | printk(KERN_ERR "SoC debug registers:\n"); |
| 288 | |
| 289 | for (i = 0; i < num_mce_regs; i++) |
| 290 | printk(KERN_ERR "%s: 0x%08x\n", mce_regs[i].name, |
| 291 | in_le32(mce_regs[i].addr)); |
| 292 | |
| 293 | if (dump_slb) { |
| 294 | unsigned long e, v; |
| 295 | int i; |
| 296 | |
| 297 | printk(KERN_ERR "slb contents:\n"); |
| 298 | for (i = 0; i < SLB_NUM_ENTRIES; i++) { |
| 299 | asm volatile("slbmfee %0,%1" : "=r" (e) : "r" (i)); |
| 300 | asm volatile("slbmfev %0,%1" : "=r" (v) : "r" (i)); |
| 301 | printk(KERN_ERR "%02d %016lx %016lx\n", i, e, v); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 306 | /* SRR1[62] is from MSR[62] if recoverable, so pass that back */ |
| 307 | return !!(srr1 & 0x2); |
| 308 | } |
| 309 | |
Olof Johansson | 31c56d8 | 2007-02-04 16:36:55 -0600 | [diff] [blame] | 310 | static void __init pas_init_early(void) |
| 311 | { |
| 312 | iommu_init_early_pasemi(); |
| 313 | } |
| 314 | |
Olof Johansson | 2b571a0 | 2007-10-16 23:26:20 -0700 | [diff] [blame^] | 315 | #ifdef CONFIG_PCMCIA |
| 316 | static int pcmcia_notify(struct notifier_block *nb, unsigned long action, |
| 317 | void *data) |
| 318 | { |
| 319 | struct device *dev = data; |
| 320 | struct device *parent; |
| 321 | struct pcmcia_device *pdev = to_pcmcia_dev(dev); |
| 322 | |
| 323 | /* We are only intereted in device addition */ |
| 324 | if (action != BUS_NOTIFY_ADD_DEVICE) |
| 325 | return 0; |
| 326 | |
| 327 | parent = pdev->socket->dev.parent; |
| 328 | |
| 329 | /* We know electra_cf devices will always have of_node set, since |
| 330 | * electra_cf is an of_platform driver. |
| 331 | */ |
| 332 | if (!parent->archdata.of_node) |
| 333 | return 0; |
| 334 | |
| 335 | if (!of_device_is_compatible(parent->archdata.of_node, "electra-cf")) |
| 336 | return 0; |
| 337 | |
| 338 | /* We use the direct ops for localbus */ |
| 339 | dev->archdata.dma_ops = &dma_direct_ops; |
| 340 | |
| 341 | return 0; |
| 342 | } |
| 343 | |
| 344 | static struct notifier_block pcmcia_notifier = { |
| 345 | .notifier_call = pcmcia_notify, |
| 346 | }; |
| 347 | |
| 348 | static inline void pasemi_pcmcia_init(void) |
| 349 | { |
| 350 | extern struct bus_type pcmcia_bus_type; |
| 351 | |
| 352 | bus_register_notifier(&pcmcia_bus_type, &pcmcia_notifier); |
| 353 | } |
| 354 | |
| 355 | #else |
| 356 | |
| 357 | static inline void pasemi_pcmcia_init(void) |
| 358 | { |
| 359 | } |
| 360 | |
| 361 | #endif |
| 362 | |
| 363 | |
Olof Johansson | b97d279 | 2007-04-18 16:39:54 +1000 | [diff] [blame] | 364 | static struct of_device_id pasemi_bus_ids[] = { |
Olof Johansson | 2b571a0 | 2007-10-16 23:26:20 -0700 | [diff] [blame^] | 365 | { .type = "localbus", }, |
Olof Johansson | b97d279 | 2007-04-18 16:39:54 +1000 | [diff] [blame] | 366 | { .type = "sdc", }, |
| 367 | {}, |
| 368 | }; |
| 369 | |
| 370 | static int __init pasemi_publish_devices(void) |
| 371 | { |
Olof Johansson | 90f7afe | 2007-05-01 14:43:39 +1000 | [diff] [blame] | 372 | if (!machine_is(pasemi)) |
| 373 | return 0; |
| 374 | |
Olof Johansson | 2b571a0 | 2007-10-16 23:26:20 -0700 | [diff] [blame^] | 375 | pasemi_pcmcia_init(); |
| 376 | |
Olof Johansson | 90f7afe | 2007-05-01 14:43:39 +1000 | [diff] [blame] | 377 | /* Publish OF platform devices for SDC and other non-PCI devices */ |
Olof Johansson | b97d279 | 2007-04-18 16:39:54 +1000 | [diff] [blame] | 378 | of_platform_bus_probe(NULL, pasemi_bus_ids, NULL); |
| 379 | |
| 380 | return 0; |
| 381 | } |
| 382 | device_initcall(pasemi_publish_devices); |
| 383 | |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 384 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 385 | /* |
| 386 | * Called very early, MMU is off, device-tree isn't unflattened |
| 387 | */ |
| 388 | static int __init pas_probe(void) |
| 389 | { |
| 390 | unsigned long root = of_get_flat_dt_root(); |
| 391 | |
| 392 | if (!of_flat_dt_is_compatible(root, "PA6T-1682M")) |
| 393 | return 0; |
| 394 | |
| 395 | hpte_init_native(); |
| 396 | |
Olof Johansson | 31c56d8 | 2007-02-04 16:36:55 -0600 | [diff] [blame] | 397 | alloc_iobmap_l2(); |
| 398 | |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 399 | return 1; |
| 400 | } |
| 401 | |
Olof Johansson | d4875a2 | 2007-07-06 00:49:04 +1000 | [diff] [blame] | 402 | define_machine(pasemi) { |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 403 | .name = "PA Semi PA6T-1682M", |
| 404 | .probe = pas_probe, |
| 405 | .setup_arch = pas_setup_arch, |
Olof Johansson | 31c56d8 | 2007-02-04 16:36:55 -0600 | [diff] [blame] | 406 | .init_early = pas_init_early, |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 407 | .init_IRQ = pas_init_IRQ, |
| 408 | .get_irq = mpic_get_irq, |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 409 | .restart = pas_restart, |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 410 | .get_boot_time = pas_get_boot_time, |
| 411 | .calibrate_decr = generic_calibrate_decr, |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 412 | .progress = pas_progress, |
Olof Johansson | bfed9d3 | 2007-02-04 16:36:50 -0600 | [diff] [blame] | 413 | .machine_check_exception = pas_machine_check_handler, |
Olof Johansson | 1e76875 | 2006-09-06 14:42:08 -0500 | [diff] [blame] | 414 | }; |