xref: /qemu/hw/arm/aspeed.c (revision 2cf6cb500c78ee2256023d510b4a54013b861444)
1327d8e4eSAndrew Jeffery /*
2327d8e4eSAndrew Jeffery  * OpenPOWER Palmetto BMC
3327d8e4eSAndrew Jeffery  *
4327d8e4eSAndrew Jeffery  * Andrew Jeffery <andrew@aj.id.au>
5327d8e4eSAndrew Jeffery  *
6327d8e4eSAndrew Jeffery  * Copyright 2016 IBM Corp.
7327d8e4eSAndrew Jeffery  *
8327d8e4eSAndrew Jeffery  * This code is licensed under the GPL version 2 or later.  See
9327d8e4eSAndrew Jeffery  * the COPYING file in the top-level directory.
10327d8e4eSAndrew Jeffery  */
11327d8e4eSAndrew Jeffery 
12327d8e4eSAndrew Jeffery #include "qemu/osdep.h"
13da34e65cSMarkus Armbruster #include "qapi/error.h"
144771d756SPaolo Bonzini #include "qemu-common.h"
154771d756SPaolo Bonzini #include "cpu.h"
16327d8e4eSAndrew Jeffery #include "exec/address-spaces.h"
17327d8e4eSAndrew Jeffery #include "hw/arm/arm.h"
1800442402SCédric Le Goater #include "hw/arm/aspeed_soc.h"
19327d8e4eSAndrew Jeffery #include "hw/boards.h"
2003dd024fSPaolo Bonzini #include "qemu/log.h"
21e1ad9bc4SCédric Le Goater #include "sysemu/block-backend.h"
22e1ad9bc4SCédric Le Goater #include "sysemu/blockdev.h"
23d769a1daSCédric Le Goater #include "hw/loader.h"
24d769a1daSCédric Le Goater #include "qemu/error-report.h"
25327d8e4eSAndrew Jeffery 
2674fb1f38SCédric Le Goater static struct arm_boot_info aspeed_board_binfo = {
27b033271fSCédric Le Goater     .board_id = -1, /* device-tree-only board */
28327d8e4eSAndrew Jeffery     .nb_cpus = 1,
29327d8e4eSAndrew Jeffery };
30327d8e4eSAndrew Jeffery 
3174fb1f38SCédric Le Goater typedef struct AspeedBoardState {
32ff90606fSCédric Le Goater     AspeedSoCState soc;
33327d8e4eSAndrew Jeffery     MemoryRegion ram;
3474fb1f38SCédric Le Goater } AspeedBoardState;
35327d8e4eSAndrew Jeffery 
36c3ba99f7SCédric Le Goater typedef struct AspeedBoardConfig {
37c3ba99f7SCédric Le Goater     const char *soc_name;
38c3ba99f7SCédric Le Goater     uint32_t hw_strap1;
396a0e947bSCédric Le Goater     const char *fmc_model;
406a0e947bSCédric Le Goater     const char *spi_model;
4126d5df95SCédric Le Goater     uint32_t num_cs;
42*2cf6cb50SCédric Le Goater     void (*i2c_init)(AspeedBoardState *bmc);
43c3ba99f7SCédric Le Goater } AspeedBoardConfig;
44c3ba99f7SCédric Le Goater 
45c3ba99f7SCédric Le Goater enum {
46c3ba99f7SCédric Le Goater     PALMETTO_BMC,
479a7c1750SCédric Le Goater     AST2500_EVB,
48ef17f836SCédric Le Goater     ROMULUS_BMC,
49c3ba99f7SCédric Le Goater };
50c3ba99f7SCédric Le Goater 
51ef17f836SCédric Le Goater /* Palmetto hardware value: 0x120CE416 */
528da33ef7SCédric Le Goater #define PALMETTO_BMC_HW_STRAP1 (                                        \
538da33ef7SCédric Le Goater         SCU_AST2400_HW_STRAP_DRAM_SIZE(DRAM_SIZE_256MB) |               \
548da33ef7SCédric Le Goater         SCU_AST2400_HW_STRAP_DRAM_CONFIG(2 /* DDR3 with CL=6, CWL=5 */) | \
558da33ef7SCédric Le Goater         SCU_AST2400_HW_STRAP_ACPI_DIS |                                 \
568da33ef7SCédric Le Goater         SCU_AST2400_HW_STRAP_SET_CLK_SOURCE(AST2400_CLK_48M_IN) |       \
578da33ef7SCédric Le Goater         SCU_HW_STRAP_VGA_CLASS_CODE |                                   \
588da33ef7SCédric Le Goater         SCU_HW_STRAP_LPC_RESET_PIN |                                    \
598da33ef7SCédric Le Goater         SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_M_S_EN) |                \
608da33ef7SCédric Le Goater         SCU_AST2400_HW_STRAP_SET_CPU_AHB_RATIO(AST2400_CPU_AHB_RATIO_2_1) | \
618da33ef7SCédric Le Goater         SCU_HW_STRAP_SPI_WIDTH |                                        \
628da33ef7SCédric Le Goater         SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) |                       \
638da33ef7SCédric Le Goater         SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT))
648da33ef7SCédric Le Goater 
65ef17f836SCédric Le Goater /* AST2500 evb hardware value: 0xF100C2E6 */
669a7c1750SCédric Le Goater #define AST2500_EVB_HW_STRAP1 ((                                        \
679a7c1750SCédric Le Goater         AST2500_HW_STRAP1_DEFAULTS |                                    \
689a7c1750SCédric Le Goater         SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE |                     \
699a7c1750SCédric Le Goater         SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE |                        \
709a7c1750SCédric Le Goater         SCU_AST2500_HW_STRAP_UART_DEBUG |                               \
719a7c1750SCédric Le Goater         SCU_AST2500_HW_STRAP_DDR4_ENABLE |                              \
729a7c1750SCédric Le Goater         SCU_HW_STRAP_MAC1_RGMII |                                       \
739a7c1750SCédric Le Goater         SCU_HW_STRAP_MAC0_RGMII) &                                      \
749a7c1750SCédric Le Goater         ~SCU_HW_STRAP_2ND_BOOT_WDT)
759a7c1750SCédric Le Goater 
76ef17f836SCédric Le Goater /* Romulus hardware value: 0xF10AD206 */
77ef17f836SCédric Le Goater #define ROMULUS_BMC_HW_STRAP1 (                                         \
78ef17f836SCédric Le Goater         AST2500_HW_STRAP1_DEFAULTS |                                    \
79ef17f836SCédric Le Goater         SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE |                     \
80ef17f836SCédric Le Goater         SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE |                        \
81ef17f836SCédric Le Goater         SCU_AST2500_HW_STRAP_UART_DEBUG |                               \
82ef17f836SCédric Le Goater         SCU_AST2500_HW_STRAP_DDR4_ENABLE |                              \
83ef17f836SCédric Le Goater         SCU_AST2500_HW_STRAP_ACPI_ENABLE |                              \
84ef17f836SCédric Le Goater         SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER))
85ef17f836SCédric Le Goater 
86*2cf6cb50SCédric Le Goater static void palmetto_bmc_i2c_init(AspeedBoardState *bmc);
87*2cf6cb50SCédric Le Goater static void ast2500_evb_i2c_init(AspeedBoardState *bmc);
88*2cf6cb50SCédric Le Goater 
89c3ba99f7SCédric Le Goater static const AspeedBoardConfig aspeed_boards[] = {
906a0e947bSCédric Le Goater     [PALMETTO_BMC] = {
91bd407a21SCédric Le Goater         .soc_name  = "ast2400-a1",
926a0e947bSCédric Le Goater         .hw_strap1 = PALMETTO_BMC_HW_STRAP1,
936a0e947bSCédric Le Goater         .fmc_model = "n25q256a",
946a0e947bSCédric Le Goater         .spi_model = "mx25l25635e",
9526d5df95SCédric Le Goater         .num_cs    = 1,
96*2cf6cb50SCédric Le Goater         .i2c_init  = palmetto_bmc_i2c_init,
976a0e947bSCédric Le Goater     },
986a0e947bSCédric Le Goater     [AST2500_EVB]  = {
996a0e947bSCédric Le Goater         .soc_name  = "ast2500-a1",
1006a0e947bSCédric Le Goater         .hw_strap1 = AST2500_EVB_HW_STRAP1,
1016a0e947bSCédric Le Goater         .fmc_model = "n25q256a",
1026a0e947bSCédric Le Goater         .spi_model = "mx25l25635e",
10326d5df95SCédric Le Goater         .num_cs    = 1,
104*2cf6cb50SCédric Le Goater         .i2c_init  = ast2500_evb_i2c_init,
1056a0e947bSCédric Le Goater     },
106ef17f836SCédric Le Goater     [ROMULUS_BMC]  = {
107ef17f836SCédric Le Goater         .soc_name  = "ast2500-a1",
108ef17f836SCédric Le Goater         .hw_strap1 = ROMULUS_BMC_HW_STRAP1,
109ef17f836SCédric Le Goater         .fmc_model = "n25q256a",
110ef17f836SCédric Le Goater         .spi_model = "mx66l1g45g",
11126d5df95SCédric Le Goater         .num_cs    = 2,
112ef17f836SCédric Le Goater     },
113c3ba99f7SCédric Le Goater };
114c3ba99f7SCédric Le Goater 
115d769a1daSCédric Le Goater #define FIRMWARE_ADDR 0x0
116d769a1daSCédric Le Goater 
117d769a1daSCédric Le Goater static void write_boot_rom(DriveInfo *dinfo, hwaddr addr, size_t rom_size,
118d769a1daSCédric Le Goater                            Error **errp)
119d769a1daSCédric Le Goater {
120d769a1daSCédric Le Goater     BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
121d769a1daSCédric Le Goater     uint8_t *storage;
1220c7209beSCédric Le Goater     int64_t size;
123d769a1daSCédric Le Goater 
1240c7209beSCédric Le Goater     /* The block backend size should have already been 'validated' by
1250c7209beSCédric Le Goater      * the creation of the m25p80 object.
1260c7209beSCédric Le Goater      */
1270c7209beSCédric Le Goater     size = blk_getlength(blk);
1280c7209beSCédric Le Goater     if (size <= 0) {
1290c7209beSCédric Le Goater         error_setg(errp, "failed to get flash size");
1300c7209beSCédric Le Goater         return;
1310c7209beSCédric Le Goater     }
1320c7209beSCédric Le Goater 
1330c7209beSCédric Le Goater     if (rom_size > size) {
1340c7209beSCédric Le Goater         rom_size = size;
135d769a1daSCédric Le Goater     }
136d769a1daSCédric Le Goater 
137d769a1daSCédric Le Goater     storage = g_new0(uint8_t, rom_size);
138d769a1daSCédric Le Goater     if (blk_pread(blk, 0, storage, rom_size) < 0) {
139d769a1daSCédric Le Goater         error_setg(errp, "failed to read the initial flash content");
140d769a1daSCédric Le Goater         return;
141d769a1daSCédric Le Goater     }
142d769a1daSCédric Le Goater 
143d769a1daSCédric Le Goater     rom_add_blob_fixed("aspeed.boot_rom", storage, rom_size, addr);
144d769a1daSCédric Le Goater     g_free(storage);
145d769a1daSCédric Le Goater }
146d769a1daSCédric Le Goater 
14774fb1f38SCédric Le Goater static void aspeed_board_init_flashes(AspeedSMCState *s, const char *flashtype,
148e1ad9bc4SCédric Le Goater                                       Error **errp)
149e1ad9bc4SCédric Le Goater {
150e1ad9bc4SCédric Le Goater     int i ;
151e1ad9bc4SCédric Le Goater 
152e1ad9bc4SCédric Le Goater     for (i = 0; i < s->num_cs; ++i) {
153e1ad9bc4SCédric Le Goater         AspeedSMCFlash *fl = &s->flashes[i];
154e1ad9bc4SCédric Le Goater         DriveInfo *dinfo = drive_get_next(IF_MTD);
155e1ad9bc4SCédric Le Goater         qemu_irq cs_line;
156e1ad9bc4SCédric Le Goater 
157e1ad9bc4SCédric Le Goater         fl->flash = ssi_create_slave_no_init(s->spi, flashtype);
158e1ad9bc4SCédric Le Goater         if (dinfo) {
159e1ad9bc4SCédric Le Goater             qdev_prop_set_drive(fl->flash, "drive", blk_by_legacy_dinfo(dinfo),
160e1ad9bc4SCédric Le Goater                                 errp);
161e1ad9bc4SCédric Le Goater         }
162e1ad9bc4SCédric Le Goater         qdev_init_nofail(fl->flash);
163e1ad9bc4SCédric Le Goater 
164e1ad9bc4SCédric Le Goater         cs_line = qdev_get_gpio_in_named(fl->flash, SSI_GPIO_CS, 0);
165e1ad9bc4SCédric Le Goater         sysbus_connect_irq(SYS_BUS_DEVICE(s), i + 1, cs_line);
166e1ad9bc4SCédric Le Goater     }
167e1ad9bc4SCédric Le Goater }
168e1ad9bc4SCédric Le Goater 
169c3ba99f7SCédric Le Goater static void aspeed_board_init(MachineState *machine,
170c3ba99f7SCédric Le Goater                               const AspeedBoardConfig *cfg)
171327d8e4eSAndrew Jeffery {
17274fb1f38SCédric Le Goater     AspeedBoardState *bmc;
173b033271fSCédric Le Goater     AspeedSoCClass *sc;
174d769a1daSCédric Le Goater     DriveInfo *drive0 = drive_get(IF_MTD, 0, 0);
175327d8e4eSAndrew Jeffery 
17674fb1f38SCédric Le Goater     bmc = g_new0(AspeedBoardState, 1);
177c3ba99f7SCédric Le Goater     object_initialize(&bmc->soc, (sizeof(bmc->soc)), cfg->soc_name);
178327d8e4eSAndrew Jeffery     object_property_add_child(OBJECT(machine), "soc", OBJECT(&bmc->soc),
179327d8e4eSAndrew Jeffery                               &error_abort);
180327d8e4eSAndrew Jeffery 
181b033271fSCédric Le Goater     sc = ASPEED_SOC_GET_CLASS(&bmc->soc);
182b033271fSCédric Le Goater 
183c6c7cfb0SCédric Le Goater     object_property_set_int(OBJECT(&bmc->soc), ram_size, "ram-size",
184c6c7cfb0SCédric Le Goater                            &error_abort);
185c3ba99f7SCédric Le Goater     object_property_set_int(OBJECT(&bmc->soc), cfg->hw_strap1, "hw-strap1",
18687e79af0SAndrew Jeffery                             &error_abort);
18726d5df95SCédric Le Goater     object_property_set_int(OBJECT(&bmc->soc), cfg->num_cs, "num-cs",
18826d5df95SCédric Le Goater                             &error_abort);
189327d8e4eSAndrew Jeffery     object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
190327d8e4eSAndrew Jeffery                              &error_abort);
191327d8e4eSAndrew Jeffery 
192de46f5f4SCédric Le Goater     /*
193de46f5f4SCédric Le Goater      * Allocate RAM after the memory controller has checked the size
194de46f5f4SCédric Le Goater      * was valid. If not, a default value is used.
195de46f5f4SCédric Le Goater      */
196de46f5f4SCédric Le Goater     ram_size = object_property_get_int(OBJECT(&bmc->soc), "ram-size",
197de46f5f4SCédric Le Goater                                        &error_abort);
198de46f5f4SCédric Le Goater 
199de46f5f4SCédric Le Goater     memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size);
200de46f5f4SCédric Le Goater     memory_region_add_subregion(get_system_memory(), sc->info->sdram_base,
201de46f5f4SCédric Le Goater                                 &bmc->ram);
202de46f5f4SCédric Le Goater     object_property_add_const_link(OBJECT(&bmc->soc), "ram", OBJECT(&bmc->ram),
203de46f5f4SCédric Le Goater                                    &error_abort);
204de46f5f4SCédric Le Goater 
2056a0e947bSCédric Le Goater     aspeed_board_init_flashes(&bmc->soc.fmc, cfg->fmc_model, &error_abort);
2066a0e947bSCédric Le Goater     aspeed_board_init_flashes(&bmc->soc.spi[0], cfg->spi_model, &error_abort);
207e1ad9bc4SCédric Le Goater 
208d769a1daSCédric Le Goater     /* Install first FMC flash content as a boot rom. */
209d769a1daSCédric Le Goater     if (drive0) {
210d769a1daSCédric Le Goater         AspeedSMCFlash *fl = &bmc->soc.fmc.flashes[0];
211d769a1daSCédric Le Goater         MemoryRegion *boot_rom = g_new(MemoryRegion, 1);
212d769a1daSCédric Le Goater 
213d769a1daSCédric Le Goater         /*
214d769a1daSCédric Le Goater          * create a ROM region using the default mapping window size of
21593bf276dSCédric Le Goater          * the flash module. The window size is 64MB for the AST2400
21693bf276dSCédric Le Goater          * SoC and 128MB for the AST2500 SoC, which is twice as big as
21793bf276dSCédric Le Goater          * needed by the flash modules of the Aspeed machines.
218d769a1daSCédric Le Goater          */
219d769a1daSCédric Le Goater         memory_region_init_rom(boot_rom, OBJECT(bmc), "aspeed.boot_rom",
220d769a1daSCédric Le Goater                                fl->size, &error_abort);
221d769a1daSCédric Le Goater         memory_region_add_subregion(get_system_memory(), FIRMWARE_ADDR,
222d769a1daSCédric Le Goater                                     boot_rom);
223d769a1daSCédric Le Goater         write_boot_rom(drive0, FIRMWARE_ADDR, fl->size, &error_abort);
224d769a1daSCédric Le Goater     }
225d769a1daSCédric Le Goater 
22674fb1f38SCédric Le Goater     aspeed_board_binfo.kernel_filename = machine->kernel_filename;
22774fb1f38SCédric Le Goater     aspeed_board_binfo.initrd_filename = machine->initrd_filename;
22874fb1f38SCédric Le Goater     aspeed_board_binfo.kernel_cmdline = machine->kernel_cmdline;
22974fb1f38SCédric Le Goater     aspeed_board_binfo.ram_size = ram_size;
23074fb1f38SCédric Le Goater     aspeed_board_binfo.loader_start = sc->info->sdram_base;
231b033271fSCédric Le Goater 
232*2cf6cb50SCédric Le Goater     if (cfg->i2c_init) {
233*2cf6cb50SCédric Le Goater         cfg->i2c_init(bmc);
234*2cf6cb50SCédric Le Goater     }
235*2cf6cb50SCédric Le Goater 
23674fb1f38SCédric Le Goater     arm_load_kernel(ARM_CPU(first_cpu), &aspeed_board_binfo);
237327d8e4eSAndrew Jeffery }
238327d8e4eSAndrew Jeffery 
239*2cf6cb50SCédric Le Goater static void palmetto_bmc_i2c_init(AspeedBoardState *bmc)
240*2cf6cb50SCédric Le Goater {
241*2cf6cb50SCédric Le Goater     AspeedSoCState *soc = &bmc->soc;
242*2cf6cb50SCédric Le Goater 
243*2cf6cb50SCédric Le Goater     /* The palmetto platform expects a ds3231 RTC but a ds1338 is
244*2cf6cb50SCédric Le Goater      * enough to provide basic RTC features. Alarms will be missing */
245*2cf6cb50SCédric Le Goater     i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), "ds1338", 0x68);
246*2cf6cb50SCédric Le Goater }
247*2cf6cb50SCédric Le Goater 
24874fb1f38SCédric Le Goater static void palmetto_bmc_init(MachineState *machine)
249327d8e4eSAndrew Jeffery {
250c3ba99f7SCédric Le Goater     aspeed_board_init(machine, &aspeed_boards[PALMETTO_BMC]);
25174fb1f38SCédric Le Goater }
25274fb1f38SCédric Le Goater 
25374fb1f38SCédric Le Goater static void palmetto_bmc_class_init(ObjectClass *oc, void *data)
25474fb1f38SCédric Le Goater {
25574fb1f38SCédric Le Goater     MachineClass *mc = MACHINE_CLASS(oc);
25674fb1f38SCédric Le Goater 
25774fb1f38SCédric Le Goater     mc->desc = "OpenPOWER Palmetto BMC (ARM926EJ-S)";
258327d8e4eSAndrew Jeffery     mc->init = palmetto_bmc_init;
259327d8e4eSAndrew Jeffery     mc->max_cpus = 1;
260327d8e4eSAndrew Jeffery     mc->no_sdcard = 1;
261327d8e4eSAndrew Jeffery     mc->no_floppy = 1;
262327d8e4eSAndrew Jeffery     mc->no_cdrom = 1;
263327d8e4eSAndrew Jeffery     mc->no_parallel = 1;
264327d8e4eSAndrew Jeffery }
265327d8e4eSAndrew Jeffery 
26674fb1f38SCédric Le Goater static const TypeInfo palmetto_bmc_type = {
26774fb1f38SCédric Le Goater     .name = MACHINE_TYPE_NAME("palmetto-bmc"),
26874fb1f38SCédric Le Goater     .parent = TYPE_MACHINE,
26974fb1f38SCédric Le Goater     .class_init = palmetto_bmc_class_init,
27074fb1f38SCédric Le Goater };
27174fb1f38SCédric Le Goater 
272*2cf6cb50SCédric Le Goater static void ast2500_evb_i2c_init(AspeedBoardState *bmc)
273*2cf6cb50SCédric Le Goater {
274*2cf6cb50SCédric Le Goater     AspeedSoCState *soc = &bmc->soc;
275*2cf6cb50SCédric Le Goater 
276*2cf6cb50SCédric Le Goater     /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */
277*2cf6cb50SCédric Le Goater     i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "tmp105", 0x4d);
278*2cf6cb50SCédric Le Goater }
279*2cf6cb50SCédric Le Goater 
2809a7c1750SCédric Le Goater static void ast2500_evb_init(MachineState *machine)
2819a7c1750SCédric Le Goater {
2829a7c1750SCédric Le Goater     aspeed_board_init(machine, &aspeed_boards[AST2500_EVB]);
2839a7c1750SCédric Le Goater }
2849a7c1750SCédric Le Goater 
2859a7c1750SCédric Le Goater static void ast2500_evb_class_init(ObjectClass *oc, void *data)
2869a7c1750SCédric Le Goater {
2879a7c1750SCédric Le Goater     MachineClass *mc = MACHINE_CLASS(oc);
2889a7c1750SCédric Le Goater 
2899a7c1750SCédric Le Goater     mc->desc = "Aspeed AST2500 EVB (ARM1176)";
2909a7c1750SCédric Le Goater     mc->init = ast2500_evb_init;
2919a7c1750SCédric Le Goater     mc->max_cpus = 1;
2929a7c1750SCédric Le Goater     mc->no_sdcard = 1;
2939a7c1750SCédric Le Goater     mc->no_floppy = 1;
2949a7c1750SCédric Le Goater     mc->no_cdrom = 1;
2959a7c1750SCédric Le Goater     mc->no_parallel = 1;
2969a7c1750SCédric Le Goater }
2979a7c1750SCédric Le Goater 
2989a7c1750SCédric Le Goater static const TypeInfo ast2500_evb_type = {
2999a7c1750SCédric Le Goater     .name = MACHINE_TYPE_NAME("ast2500-evb"),
3009a7c1750SCédric Le Goater     .parent = TYPE_MACHINE,
3019a7c1750SCédric Le Goater     .class_init = ast2500_evb_class_init,
3029a7c1750SCédric Le Goater };
3039a7c1750SCédric Le Goater 
304ef17f836SCédric Le Goater static void romulus_bmc_init(MachineState *machine)
305ef17f836SCédric Le Goater {
306ef17f836SCédric Le Goater     aspeed_board_init(machine, &aspeed_boards[ROMULUS_BMC]);
307ef17f836SCédric Le Goater }
308ef17f836SCédric Le Goater 
309ef17f836SCédric Le Goater static void romulus_bmc_class_init(ObjectClass *oc, void *data)
310ef17f836SCédric Le Goater {
311ef17f836SCédric Le Goater     MachineClass *mc = MACHINE_CLASS(oc);
312ef17f836SCédric Le Goater 
313ef17f836SCédric Le Goater     mc->desc = "OpenPOWER Romulus BMC (ARM1176)";
314ef17f836SCédric Le Goater     mc->init = romulus_bmc_init;
315ef17f836SCédric Le Goater     mc->max_cpus = 1;
316ef17f836SCédric Le Goater     mc->no_sdcard = 1;
317ef17f836SCédric Le Goater     mc->no_floppy = 1;
318ef17f836SCédric Le Goater     mc->no_cdrom = 1;
319ef17f836SCédric Le Goater     mc->no_parallel = 1;
320ef17f836SCédric Le Goater }
321ef17f836SCédric Le Goater 
322ef17f836SCédric Le Goater static const TypeInfo romulus_bmc_type = {
323ef17f836SCédric Le Goater     .name = MACHINE_TYPE_NAME("romulus-bmc"),
324ef17f836SCédric Le Goater     .parent = TYPE_MACHINE,
325ef17f836SCédric Le Goater     .class_init = romulus_bmc_class_init,
326ef17f836SCédric Le Goater };
327ef17f836SCédric Le Goater 
32874fb1f38SCédric Le Goater static void aspeed_machine_init(void)
32974fb1f38SCédric Le Goater {
33074fb1f38SCédric Le Goater     type_register_static(&palmetto_bmc_type);
3319a7c1750SCédric Le Goater     type_register_static(&ast2500_evb_type);
332ef17f836SCédric Le Goater     type_register_static(&romulus_bmc_type);
33374fb1f38SCédric Le Goater }
33474fb1f38SCédric Le Goater 
33574fb1f38SCédric Le Goater type_init(aspeed_machine_init)
336