1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Paravirt target for a generic QEMU e500 machine
5 * This is intended to be a flexible device-tree-driven platform, not fixed
6 * to a particular piece of hardware or a particular spec of virtual hardware,
7 * beyond the assumption of an e500-family CPU. Some things are still hardcoded
8 * here, such as MPIC, but this is a limitation of the current code rather than
9 * an interface contract with QEMU.
11 * Copyright 2012 Freescale Semiconductor Inc.
14 #include <linux/kernel.h>
15 #include <linux/of_fdt.h>
16 #include <linux/pgtable.h>
17 #include <asm/machdep.h>
21 #include <asm/swiotlb.h>
22 #include <sysdev/fsl_soc.h>
23 #include <sysdev/fsl_pci.h>
27 void __init
qemu_e500_pic_init(void)
30 unsigned int flags
= MPIC_BIG_ENDIAN
| MPIC_SINGLE_DEST_CPU
|
33 mpic
= mpic_alloc(NULL
, 0, flags
, 0, 256, " OpenPIC ");
39 static void __init
qemu_e500_setup_arch(void)
41 ppc_md
.progress("qemu_e500_setup_arch()", 0);
43 fsl_pci_assign_primary();
49 * Called very early, device-tree isn't unflattened
51 static int __init
qemu_e500_probe(void)
53 return !!of_machine_is_compatible("fsl,qemu-e500");
56 machine_arch_initcall(qemu_e500
, mpc85xx_common_publish_devices
);
58 define_machine(qemu_e500
) {
60 .probe
= qemu_e500_probe
,
61 .setup_arch
= qemu_e500_setup_arch
,
62 .init_IRQ
= qemu_e500_pic_init
,
64 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
65 .pcibios_fixup_phb
= fsl_pcibios_fixup_phb
,
67 .get_irq
= mpic_get_coreint_irq
,
68 .calibrate_decr
= generic_calibrate_decr
,
69 .progress
= udbg_progress
,