14d5c29caSScott Wood /* 24d5c29caSScott Wood * Generic device-tree-driven paravirt PPC e500 platform 34d5c29caSScott Wood * 44d5c29caSScott Wood * Copyright 2012 Freescale Semiconductor, Inc. 54d5c29caSScott Wood * 64d5c29caSScott Wood * This is free software; you can redistribute it and/or modify 74d5c29caSScott Wood * it under the terms of the GNU General Public License as published by 84d5c29caSScott Wood * the Free Software Foundation; either version 2 of the License, or 94d5c29caSScott Wood * (at your option) any later version. 104d5c29caSScott Wood */ 114d5c29caSScott Wood 124d5c29caSScott Wood #include "config.h" 134d5c29caSScott Wood #include "qemu-common.h" 144d5c29caSScott Wood #include "e500.h" 15*7948b4b0SPaolo Bonzini #include "hw/boards.h" 169c17d615SPaolo Bonzini #include "sysemu/device_tree.h" 179c17d615SPaolo Bonzini #include "hw/pci/pci.h" 18f5fba9d2SScott Wood #include "hw/openpic.h" 194d5c29caSScott Wood 204d5c29caSScott Wood static void e500plat_fixup_devtree(PPCE500Params *params, void *fdt) 214d5c29caSScott Wood { 224d5c29caSScott Wood const char model[] = "QEMU ppce500"; 234d5c29caSScott Wood const char compatible[] = "fsl,qemu-e500"; 244d5c29caSScott Wood 254d5c29caSScott Wood qemu_devtree_setprop(fdt, "/", "model", model, sizeof(model)); 264d5c29caSScott Wood qemu_devtree_setprop(fdt, "/", "compatible", compatible, 274d5c29caSScott Wood sizeof(compatible)); 284d5c29caSScott Wood } 294d5c29caSScott Wood 305f072e1fSEduardo Habkost static void e500plat_init(QEMUMachineInitArgs *args) 314d5c29caSScott Wood { 325f072e1fSEduardo Habkost ram_addr_t ram_size = args->ram_size; 335f072e1fSEduardo Habkost const char *boot_device = args->boot_device; 345f072e1fSEduardo Habkost const char *cpu_model = args->cpu_model; 355f072e1fSEduardo Habkost const char *kernel_filename = args->kernel_filename; 365f072e1fSEduardo Habkost const char *kernel_cmdline = args->kernel_cmdline; 375f072e1fSEduardo Habkost const char *initrd_filename = args->initrd_filename; 384d5c29caSScott Wood PPCE500Params params = { 394d5c29caSScott Wood .ram_size = ram_size, 404d5c29caSScott Wood .boot_device = boot_device, 414d5c29caSScott Wood .kernel_filename = kernel_filename, 424d5c29caSScott Wood .kernel_cmdline = kernel_cmdline, 434d5c29caSScott Wood .initrd_filename = initrd_filename, 444d5c29caSScott Wood .cpu_model = cpu_model, 453bb7e02aSAlexander Graf .pci_first_slot = 0x1, 463bb7e02aSAlexander Graf .pci_nr_slots = PCI_SLOT_MAX - 1, 474d5c29caSScott Wood .fixup_devtree = e500plat_fixup_devtree, 48f5fba9d2SScott Wood .mpic_version = OPENPIC_MODEL_FSL_MPIC_42, 494d5c29caSScott Wood }; 504d5c29caSScott Wood 514d5c29caSScott Wood ppce500_init(¶ms); 524d5c29caSScott Wood } 534d5c29caSScott Wood 544d5c29caSScott Wood static QEMUMachine e500plat_machine = { 554d5c29caSScott Wood .name = "ppce500", 564d5c29caSScott Wood .desc = "generic paravirt e500 platform", 574d5c29caSScott Wood .init = e500plat_init, 58f5fba9d2SScott Wood .max_cpus = 32, 59e4ada29eSAvik Sil DEFAULT_MACHINE_OPTIONS, 604d5c29caSScott Wood }; 614d5c29caSScott Wood 624d5c29caSScott Wood static void e500plat_machine_init(void) 634d5c29caSScott Wood { 644d5c29caSScott Wood qemu_register_machine(&e500plat_machine); 654d5c29caSScott Wood } 664d5c29caSScott Wood 674d5c29caSScott Wood machine_init(e500plat_machine_init); 68