]>
Commit | Line | Data |
---|---|---|
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" | |
20 | ||
21 | static struct arm_boot_info palmetto_bmc_binfo = { | |
22 | .loader_start = AST2400_SDRAM_BASE, | |
23 | .board_id = 0, | |
24 | .nb_cpus = 1, | |
25 | }; | |
26 | ||
27 | typedef struct PalmettoBMCState { | |
28 | AST2400State soc; | |
29 | MemoryRegion ram; | |
30 | } PalmettoBMCState; | |
31 | ||
32 | static void palmetto_bmc_init(MachineState *machine) | |
33 | { | |
34 | PalmettoBMCState *bmc; | |
35 | ||
36 | bmc = g_new0(PalmettoBMCState, 1); | |
37 | object_initialize(&bmc->soc, (sizeof(bmc->soc)), TYPE_AST2400); | |
38 | object_property_add_child(OBJECT(machine), "soc", OBJECT(&bmc->soc), | |
39 | &error_abort); | |
40 | ||
41 | memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size); | |
42 | memory_region_add_subregion(get_system_memory(), AST2400_SDRAM_BASE, | |
43 | &bmc->ram); | |
44 | object_property_add_const_link(OBJECT(&bmc->soc), "ram", OBJECT(&bmc->ram), | |
45 | &error_abort); | |
46 | object_property_set_bool(OBJECT(&bmc->soc), true, "realized", | |
47 | &error_abort); | |
48 | ||
49 | palmetto_bmc_binfo.kernel_filename = machine->kernel_filename; | |
50 | palmetto_bmc_binfo.initrd_filename = machine->initrd_filename; | |
51 | palmetto_bmc_binfo.kernel_cmdline = machine->kernel_cmdline; | |
52 | palmetto_bmc_binfo.ram_size = ram_size; | |
53 | arm_load_kernel(ARM_CPU(first_cpu), &palmetto_bmc_binfo); | |
54 | } | |
55 | ||
56 | static void palmetto_bmc_machine_init(MachineClass *mc) | |
57 | { | |
58 | mc->desc = "OpenPOWER Palmetto BMC"; | |
59 | mc->init = palmetto_bmc_init; | |
60 | mc->max_cpus = 1; | |
61 | mc->no_sdcard = 1; | |
62 | mc->no_floppy = 1; | |
63 | mc->no_cdrom = 1; | |
64 | mc->no_sdcard = 1; | |
65 | mc->no_parallel = 1; | |
66 | } | |
67 | ||
68 | DEFINE_MACHINE("palmetto-bmc", palmetto_bmc_machine_init); |