master
c 62 lines 2.03 KB
Raw
1 /*
2 * OpenPOWER Romulus
3 *
4 * Copyright 2016 IBM Corp.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9 #include "qemu/osdep.h"
10 #include "qapi/error.h"
11 #include "hw/arm/machines-qom.h"
12 #include "hw/arm/aspeed.h"
13 #include "hw/arm/aspeed_soc.h"
14
15 /* Romulus hardware value: 0xF10AD206 */
16 #define ROMULUS_BMC_HW_STRAP1 ( \
17 AST2500_HW_STRAP1_DEFAULTS | \
18 SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE | \
19 SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE | \
20 SCU_AST2500_HW_STRAP_UART_DEBUG | \
21 SCU_AST2500_HW_STRAP_DDR4_ENABLE | \
22 SCU_AST2500_HW_STRAP_ACPI_ENABLE | \
23 SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER))
24
25 static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
26 {
27 AspeedSoCState *soc = bmc->soc;
28
29 /*
30 * The romulus board expects Epson RX8900 I2C RTC but a ds1338 is
31 * good enough
32 */
33 i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
34 }
35
36 static void aspeed_machine_romulus_class_init(ObjectClass *oc,
37 const void *data)
38 {
39 MachineClass *mc = MACHINE_CLASS(oc);
40 AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
41
42 mc->desc = "OpenPOWER Romulus BMC (ARM1176)";
43 amc->soc_name = "ast2500-a1";
44 amc->hw_strap1 = ROMULUS_BMC_HW_STRAP1;
45 amc->fmc_model = "n25q256a";
46 amc->spi_model = "mx66l1g45g";
47 amc->num_cs = 2;
48 amc->i2c_init = romulus_bmc_i2c_init;
49 mc->default_ram_size = 512 * MiB;
50 aspeed_machine_class_init_cpus_defaults(mc);
51 };
52
53 static const TypeInfo aspeed_ast2500_romulus_types[] = {
54 {
55 .name = MACHINE_TYPE_NAME("romulus-bmc"),
56 .parent = TYPE_ASPEED_MACHINE,
57 .class_init = aspeed_machine_romulus_class_init,
58 .interfaces = arm_machine_interfaces,
59 }
60 };
61
62 DEFINE_TYPES(aspeed_ast2500_romulus_types)