ivshmem: Implement shm=... with a memory backend
[qemu/kevin.git] / hw / arm / palmetto-bmc.c
blob55d741918b969391c11c6e5e3c5210b3a3016f2d
1 /*
2 * OpenPOWER Palmetto BMC
4 * Andrew Jeffery <andrew@aj.id.au>
6 * Copyright 2016 IBM Corp.
8 * This code is licensed under the GPL version 2 or later. See
9 * the COPYING file in the top-level directory.
12 #include "qemu/osdep.h"
13 #include "exec/address-spaces.h"
14 #include "hw/arm/arm.h"
15 #include "hw/arm/ast2400.h"
16 #include "hw/boards.h"
18 static struct arm_boot_info palmetto_bmc_binfo = {
19 .loader_start = AST2400_SDRAM_BASE,
20 .board_id = 0,
21 .nb_cpus = 1,
24 typedef struct PalmettoBMCState {
25 AST2400State soc;
26 MemoryRegion ram;
27 } PalmettoBMCState;
29 static void palmetto_bmc_init(MachineState *machine)
31 PalmettoBMCState *bmc;
33 bmc = g_new0(PalmettoBMCState, 1);
34 object_initialize(&bmc->soc, (sizeof(bmc->soc)), TYPE_AST2400);
35 object_property_add_child(OBJECT(machine), "soc", OBJECT(&bmc->soc),
36 &error_abort);
38 memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size);
39 memory_region_add_subregion(get_system_memory(), AST2400_SDRAM_BASE,
40 &bmc->ram);
41 object_property_add_const_link(OBJECT(&bmc->soc), "ram", OBJECT(&bmc->ram),
42 &error_abort);
43 object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
44 &error_abort);
46 palmetto_bmc_binfo.kernel_filename = machine->kernel_filename;
47 palmetto_bmc_binfo.initrd_filename = machine->initrd_filename;
48 palmetto_bmc_binfo.kernel_cmdline = machine->kernel_cmdline;
49 palmetto_bmc_binfo.ram_size = ram_size;
50 arm_load_kernel(ARM_CPU(first_cpu), &palmetto_bmc_binfo);
53 static void palmetto_bmc_machine_init(MachineClass *mc)
55 mc->desc = "OpenPOWER Palmetto BMC";
56 mc->init = palmetto_bmc_init;
57 mc->max_cpus = 1;
58 mc->no_sdcard = 1;
59 mc->no_floppy = 1;
60 mc->no_cdrom = 1;
61 mc->no_sdcard = 1;
62 mc->no_parallel = 1;
65 DEFINE_MACHINE("palmetto-bmc", palmetto_bmc_machine_init);