powerpc/powernv: Report size of OPAL memcons log
[linux/fpc-iii.git] / arch / powerpc / platforms / 85xx / qemu_e500.c
blobb63a8548366f8d6e3218624784e7875edad01ee5
1 /*
2 * Paravirt target for a generic QEMU e500 machine
4 * This is intended to be a flexible device-tree-driven platform, not fixed
5 * to a particular piece of hardware or a particular spec of virtual hardware,
6 * beyond the assumption of an e500-family CPU. Some things are still hardcoded
7 * here, such as MPIC, but this is a limitation of the current code rather than
8 * an interface contract with QEMU.
10 * Copyright 2012 Freescale Semiconductor Inc.
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
18 #include <linux/kernel.h>
19 #include <linux/of_fdt.h>
20 #include <asm/machdep.h>
21 #include <asm/pgtable.h>
22 #include <asm/time.h>
23 #include <asm/udbg.h>
24 #include <asm/mpic.h>
25 #include <sysdev/fsl_soc.h>
26 #include <sysdev/fsl_pci.h>
27 #include "smp.h"
28 #include "mpc85xx.h"
30 void __init qemu_e500_pic_init(void)
32 struct mpic *mpic;
33 unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |
34 MPIC_ENABLE_COREINT;
36 mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
38 BUG_ON(mpic == NULL);
39 mpic_init(mpic);
42 static void __init qemu_e500_setup_arch(void)
44 ppc_md.progress("qemu_e500_setup_arch()", 0);
46 fsl_pci_assign_primary();
47 swiotlb_detect_4g();
48 #if defined(CONFIG_FSL_PCI) && defined(CONFIG_ZONE_DMA32)
50 * Inbound windows don't cover the full lower 4 GiB
51 * due to conflicts with PCICSRBAR and outbound windows,
52 * so limit the DMA32 zone to 2 GiB, to allow consistent
53 * allocations to succeed.
55 limit_zone_pfn(ZONE_DMA32, 1UL << (31 - PAGE_SHIFT));
56 #endif
57 mpc85xx_smp_init();
61 * Called very early, device-tree isn't unflattened
63 static int __init qemu_e500_probe(void)
65 return !!of_machine_is_compatible("fsl,qemu-e500");
68 machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices);
70 define_machine(qemu_e500) {
71 .name = "QEMU e500",
72 .probe = qemu_e500_probe,
73 .setup_arch = qemu_e500_setup_arch,
74 .init_IRQ = qemu_e500_pic_init,
75 #ifdef CONFIG_PCI
76 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
77 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
78 #endif
79 .get_irq = mpic_get_coreint_irq,
80 .calibrate_decr = generic_calibrate_decr,
81 .progress = udbg_progress,