2 * Generic device-tree-driven paravirt PPC e500 platform
4 * Copyright 2012 Freescale Semiconductor, Inc.
6 * This is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
13 #include "qemu-common.h"
15 #include "hw/boards.h"
16 #include "sysemu/device_tree.h"
17 #include "hw/pci/pci.h"
18 #include "hw/openpic.h"
20 static void e500plat_fixup_devtree(PPCE500Params
*params
, void *fdt
)
22 const char model
[] = "QEMU ppce500";
23 const char compatible
[] = "fsl,qemu-e500";
25 qemu_devtree_setprop(fdt
, "/", "model", model
, sizeof(model
));
26 qemu_devtree_setprop(fdt
, "/", "compatible", compatible
,
30 static void e500plat_init(QEMUMachineInitArgs
*args
)
32 ram_addr_t ram_size
= args
->ram_size
;
33 const char *boot_device
= args
->boot_device
;
34 const char *cpu_model
= args
->cpu_model
;
35 const char *kernel_filename
= args
->kernel_filename
;
36 const char *kernel_cmdline
= args
->kernel_cmdline
;
37 const char *initrd_filename
= args
->initrd_filename
;
38 PPCE500Params params
= {
40 .boot_device
= boot_device
,
41 .kernel_filename
= kernel_filename
,
42 .kernel_cmdline
= kernel_cmdline
,
43 .initrd_filename
= initrd_filename
,
44 .cpu_model
= cpu_model
,
45 .pci_first_slot
= 0x1,
46 .pci_nr_slots
= PCI_SLOT_MAX
- 1,
47 .fixup_devtree
= e500plat_fixup_devtree
,
48 .mpic_version
= OPENPIC_MODEL_FSL_MPIC_42
,
51 ppce500_init(¶ms
);
54 static QEMUMachine e500plat_machine
= {
56 .desc
= "generic paravirt e500 platform",
57 .init
= e500plat_init
,
59 DEFAULT_MACHINE_OPTIONS
,
62 static void e500plat_machine_init(void)
64 qemu_register_machine(&e500plat_machine
);
67 machine_init(e500plat_machine_init
);