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
,
24 typedef struct 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
),
38 memory_region_allocate_system_memory(&bmc
->ram
, NULL
, "ram", ram_size
);
39 memory_region_add_subregion(get_system_memory(), AST2400_SDRAM_BASE
,
41 object_property_add_const_link(OBJECT(&bmc
->soc
), "ram", OBJECT(&bmc
->ram
),
43 object_property_set_bool(OBJECT(&bmc
->soc
), true, "realized",
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
;
65 DEFINE_MACHINE("palmetto-bmc", palmetto_bmc_machine_init
);