]> Git Repo - qemu.git/blame - hw/ppc/e500plat.c
Merge remote-tracking branch 'sstabellini/xen-2013-04-05' into staging
[qemu.git] / hw / ppc / e500plat.c
CommitLineData
4d5c29ca
SW
1/*
2 * Generic device-tree-driven paravirt PPC e500 platform
3 *
4 * Copyright 2012 Freescale Semiconductor, Inc.
5 *
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.
10 */
11
12#include "config.h"
13#include "qemu-common.h"
14#include "e500.h"
7948b4b0 15#include "hw/boards.h"
9c17d615
PB
16#include "sysemu/device_tree.h"
17#include "hw/pci/pci.h"
f5fba9d2 18#include "hw/openpic.h"
4d5c29ca
SW
19
20static void e500plat_fixup_devtree(PPCE500Params *params, void *fdt)
21{
22 const char model[] = "QEMU ppce500";
23 const char compatible[] = "fsl,qemu-e500";
24
25 qemu_devtree_setprop(fdt, "/", "model", model, sizeof(model));
26 qemu_devtree_setprop(fdt, "/", "compatible", compatible,
27 sizeof(compatible));
28}
29
5f072e1f 30static void e500plat_init(QEMUMachineInitArgs *args)
4d5c29ca 31{
5f072e1f
EH
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;
4d5c29ca
SW
38 PPCE500Params params = {
39 .ram_size = ram_size,
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,
3bb7e02a
AG
45 .pci_first_slot = 0x1,
46 .pci_nr_slots = PCI_SLOT_MAX - 1,
4d5c29ca 47 .fixup_devtree = e500plat_fixup_devtree,
f5fba9d2 48 .mpic_version = OPENPIC_MODEL_FSL_MPIC_42,
4d5c29ca
SW
49 };
50
51 ppce500_init(&params);
52}
53
54static QEMUMachine e500plat_machine = {
55 .name = "ppce500",
56 .desc = "generic paravirt e500 platform",
57 .init = e500plat_init,
f5fba9d2 58 .max_cpus = 32,
e4ada29e 59 DEFAULT_MACHINE_OPTIONS,
4d5c29ca
SW
60};
61
62static void e500plat_machine_init(void)
63{
64 qemu_register_machine(&e500plat_machine);
65}
66
67machine_init(e500plat_machine_init);
This page took 0.140604 seconds and 4 git commands to generate.