]> git.proxmox.com Git - mirror_qemu.git/blame - hw/arm/palmetto-bmc.c
ast2400: Integrate the SCU model and set silicon revision
[mirror_qemu.git] / hw / arm / palmetto-bmc.c
CommitLineData
327d8e4e
AJ
1/*
2 * OpenPOWER Palmetto BMC
3 *
4 * Andrew Jeffery <andrew@aj.id.au>
5 *
6 * Copyright 2016 IBM Corp.
7 *
8 * This code is licensed under the GPL version 2 or later. See
9 * the COPYING file in the top-level directory.
10 */
11
12#include "qemu/osdep.h"
da34e65c 13#include "qapi/error.h"
4771d756
PB
14#include "qemu-common.h"
15#include "cpu.h"
327d8e4e
AJ
16#include "exec/address-spaces.h"
17#include "hw/arm/arm.h"
18#include "hw/arm/ast2400.h"
19#include "hw/boards.h"
03dd024f 20#include "qemu/log.h"
327d8e4e
AJ
21
22static struct arm_boot_info palmetto_bmc_binfo = {
23 .loader_start = AST2400_SDRAM_BASE,
24 .board_id = 0,
25 .nb_cpus = 1,
26};
27
28typedef struct PalmettoBMCState {
29 AST2400State soc;
30 MemoryRegion ram;
31} PalmettoBMCState;
32
33static void palmetto_bmc_init(MachineState *machine)
34{
35 PalmettoBMCState *bmc;
36
37 bmc = g_new0(PalmettoBMCState, 1);
38 object_initialize(&bmc->soc, (sizeof(bmc->soc)), TYPE_AST2400);
39 object_property_add_child(OBJECT(machine), "soc", OBJECT(&bmc->soc),
40 &error_abort);
41
42 memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size);
43 memory_region_add_subregion(get_system_memory(), AST2400_SDRAM_BASE,
44 &bmc->ram);
45 object_property_add_const_link(OBJECT(&bmc->soc), "ram", OBJECT(&bmc->ram),
46 &error_abort);
47 object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
48 &error_abort);
49
50 palmetto_bmc_binfo.kernel_filename = machine->kernel_filename;
51 palmetto_bmc_binfo.initrd_filename = machine->initrd_filename;
52 palmetto_bmc_binfo.kernel_cmdline = machine->kernel_cmdline;
53 palmetto_bmc_binfo.ram_size = ram_size;
54 arm_load_kernel(ARM_CPU(first_cpu), &palmetto_bmc_binfo);
55}
56
57static void palmetto_bmc_machine_init(MachineClass *mc)
58{
59 mc->desc = "OpenPOWER Palmetto BMC";
60 mc->init = palmetto_bmc_init;
61 mc->max_cpus = 1;
62 mc->no_sdcard = 1;
63 mc->no_floppy = 1;
64 mc->no_cdrom = 1;
65 mc->no_sdcard = 1;
66 mc->no_parallel = 1;
67}
68
69DEFINE_MACHINE("palmetto-bmc", palmetto_bmc_machine_init);