Path: blob/master/arch/powerpc/platforms/85xx/qemu_e500.c
26481 views
// SPDX-License-Identifier: GPL-2.0-or-later1/*2* Paravirt target for a generic QEMU e500 machine3*4* This is intended to be a flexible device-tree-driven platform, not fixed5* 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 hardcoded7* here, such as MPIC, but this is a limitation of the current code rather than8* an interface contract with QEMU.9*10* Copyright 2012 Freescale Semiconductor Inc.11*/1213#include <linux/kernel.h>14#include <linux/of.h>15#include <linux/of_fdt.h>16#include <linux/pgtable.h>17#include <asm/machdep.h>18#include <asm/time.h>19#include <asm/udbg.h>20#include <asm/mpic.h>21#include <asm/swiotlb.h>22#include <sysdev/fsl_soc.h>23#include <sysdev/fsl_pci.h>24#include "smp.h"25#include "mpc85xx.h"2627static void __init qemu_e500_pic_init(void)28{29struct mpic *mpic;30unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |31MPIC_ENABLE_COREINT;3233mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");3435BUG_ON(mpic == NULL);36mpic_init(mpic);37}3839static void __init qemu_e500_setup_arch(void)40{41ppc_md.progress("qemu_e500_setup_arch()", 0);4243fsl_pci_assign_primary();44swiotlb_detect_4g();45mpc85xx_smp_init();46}4748machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices);4950define_machine(qemu_e500) {51.name = "QEMU e500",52.compatible = "fsl,qemu-e500",53.setup_arch = qemu_e500_setup_arch,54.init_IRQ = qemu_e500_pic_init,55#ifdef CONFIG_PCI56.pcibios_fixup_bus = fsl_pcibios_fixup_bus,57.pcibios_fixup_phb = fsl_pcibios_fixup_phb,58#endif59.get_irq = mpic_get_coreint_irq,60.progress = udbg_progress,61.power_save = e500_idle,62};636465