@samitouri / QOSamiQemu / commits / dc238e34f2

hw/arm/aspeed: add anacapa-bmc machine

Add the Facebook Anacapa BMC machine. The I2C topology is based on the Linux kernel device tree [1]. Hardware strap register values are taken from real hardware. A functional test is included using the OpenBMC image built from [2], similar to the tests for bletchley-bmc and catalina-bmc. [1]: https://github.com/torvalds/linux/blob/76b4ec8efdc3887cdbf730da2e55881fc1a18770/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-anacapa.dts [2]: https://github.com/openbmc/openbmc/commit/8e22df918eaaa5d83143471d24ef0eeb1c1e3c7c Signed-off-by: William de Abreu Pinho <williamdapinho@gmail.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260519-add-anacapa-machine-v3-2-56c23993a20a@gmail.com [ clg: docs/system/arm/aspeed.rst : fixed 'Aspeed family boards' title change ] Signed-off-by: Cédric Le Goater <clg@redhat.com>

William de Abreu Pinho committed May 19, 2026 at 10:48 UTC dc238e34f2d24ac4dee6fe14048121edf85b7ed7
5 files changed +184 -2
docs/system/arm/aspeed.rst
+3 -2
@@ -1,5 +1,5 @@
1 -Aspeed family boards (``ast2500-evb``, ``ast2600-evb``, ``bletchley-bmc``, ``fuji-bmc``, ``gb200nvl-bmc``, ``fby35-bmc``, ``g220a-bmc``, ``palmetto-bmc``, ``quanta-q71l-bmc``, ``rainier-bmc``, ``romulus-bmc``, ``supermicrox11-bmc``, ``supermicrox11spi-bmc``, ``tiogapass-bmc``, ``witherspoon-bmc``, ``yosemitev2-bmc``)
2 -==============================================================================================================================================================================================================================================================================================================================
1 +Aspeed family boards (``anacapa-bmc``, ``ast2500-evb``, ``ast2600-evb``, ``bletchley-bmc``, ``fuji-bmc``, ``gb200nvl-bmc``, ``fby35-bmc``, ``g220a-bmc``, ``palmetto-bmc``, ``quanta-q71l-bmc``, ``rainier-bmc``, ``romulus-bmc``, ``supermicrox11-bmc``, ``supermicrox11spi-bmc``, ``tiogapass-bmc``, ``witherspoon-bmc``, ``yosemitev2-bmc``)
2 +===============================================================================================================================================================================================================================================================================================================================================
3
4 The QEMU Aspeed machines model BMCs of various OpenPOWER systems and
5 Aspeed evaluation boards. They are based on different releases of the
@@ -33,6 +33,7 @@ AST2600 SoC based machines :
33 - ``fuji-bmc`` Facebook Fuji BMC
34 - ``bletchley-bmc`` Facebook Bletchley BMC
35 - ``fby35-bmc`` Facebook fby35 BMC
36 +- ``anacapa-bmc`` Facebook Anacapa BMC
37 - ``gb200nvl-bmc`` Nvidia GB200nvl BMC
38
39 Supported devices
hw/arm/aspeed_ast2600_anacapa.c new
+153
@@ -0,0 +1,153 @@
1 +/*
2 + * Facebook Anacapa
3 + *
4 + * Copyright (c) Meta Platforms, Inc. and affiliates.
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 +#include "hw/i2c/i2c_mux_pca954x.h"
15 +#include "hw/gpio/pca9552.h"
16 +#include "hw/nvram/eeprom_at24c.h"
17 +
18 +/* Anacapa hardware value */
19 +#define ANACAPA_BMC_HW_STRAP1 0x00002002
20 +#define ANACAPA_BMC_HW_STRAP2 0x00000000
21 +#define ANACAPA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB)
22 +
23 +static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)
24 +{
25 + /* Reference: aspeed-bmc-facebook-anacapa.dts */
26 +
27 + AspeedSoCState *soc = bmc->soc;
28 + I2CBus *i2c[16] = {};
29 + I2CSlave *i2c_mux;
30 +
31 + for (int i = 0; i < ARRAY_SIZE(i2c); i++) {
32 + i2c[i] = aspeed_i2c_get_bus(&soc->i2c, i);
33 + }
34 +
35 + /* &i2c0 */
36 + /* eeprom@50 */
37 + at24c_eeprom_init(i2c[0], 0x50, 256 * KiB);
38 + /* i2c-mux@70 */
39 + i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x70);
40 +
41 + /* &i2c1 */
42 + /* eeprom@50 */
43 + at24c_eeprom_init(i2c[1], 0x50, 256 * KiB);
44 + /* i2c-mux@70 (PCA9546) — 4 channels, empty */
45 + i2c_slave_create_simple(i2c[1], TYPE_PCA9546, 0x70);
46 +
47 + /* &i2c4 */
48 + /* i2c-mux@70 (PCA9548) */
49 + i2c_slave_create_simple(i2c[4], TYPE_PCA9548, 0x70);
50 +
51 + /* &i2c6 */
52 + /* eeprom@50 */
53 + at24c_eeprom_init(i2c[6], 0x50, 32 * KiB);
54 +
55 + /* &i2c8 */
56 + /* i2c-mux@72 (PCA9546) */
57 + i2c_mux = i2c_slave_create_simple(i2c[8], TYPE_PCA9546, 0x72);
58 +
59 + /* i2c8mux ch0 */
60 + /* adc128d818@1f — no model */
61 + /* pca9555@22 */
62 + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0),
63 + TYPE_PCA9552, 0x22);
64 + /* pca9555@24 */
65 + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0),
66 + TYPE_PCA9552, 0x24);
67 + /* eeprom@50 */
68 + at24c_eeprom_init(pca954x_i2c_get_bus(i2c_mux, 0), 0x50, 16 * KiB);
69 +
70 + /* i2c8mux ch1 */
71 + /* pca9555@22 */
72 + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 1),
73 + TYPE_PCA9552, 0x22);
74 + /* pca9555@24 */
75 + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 1),
76 + TYPE_PCA9552, 0x24);
77 + /* eeprom@50 */
78 + at24c_eeprom_init(pca954x_i2c_get_bus(i2c_mux, 1), 0x50, 16 * KiB);
79 +
80 + /* &i2c9 */
81 + /* eeprom@50 */
82 + at24c_eeprom_init(i2c[9], 0x50, 16 * KiB);
83 + /* eeprom@56 */
84 + at24c_eeprom_init(i2c[9], 0x56, 8 * KiB);
85 +
86 + /* &i2c10 */
87 + /* i2c-mux@71 (PCA9548) */
88 + i2c_mux = i2c_slave_create_simple(i2c[10], TYPE_PCA9548, 0x71);
89 +
90 + /* i2c10mux ch5 */
91 + /* pca9555@22*/
92 + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5),
93 + TYPE_PCA9552, 0x22);
94 + /* eeprom@52 */
95 + at24c_eeprom_init(pca954x_i2c_get_bus(i2c_mux, 5), 0x52, 32 * KiB);
96 +
97 + /* &i2c11 */
98 + /* i2c-mux@71 (PCA9548) */
99 + i2c_mux = i2c_slave_create_simple(i2c[11], TYPE_PCA9548, 0x71);
100 +
101 + /* i2c11mux ch0-ch4 — empty */
102 +
103 + /* i2c11mux ch5 */
104 + /* pca9555@22 */
105 + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5),
106 + TYPE_PCA9552, 0x22);
107 + /* eeprom@52 */
108 + at24c_eeprom_init(pca954x_i2c_get_bus(i2c_mux, 5), 0x52, 32 * KiB);
109 +
110 + /* &i2c13 */
111 + /* i2c-mux@70 (PCA9548) */
112 + i2c_mux = i2c_slave_create_simple(i2c[13], TYPE_PCA9548, 0x70);
113 +
114 + /* i2c13mux ch3 */
115 + /* adc128d818@1f - no model */
116 +
117 + /* i2c13mux ch4 */
118 + /* eeprom@51 */
119 + at24c_eeprom_init(pca954x_i2c_get_bus(i2c_mux, 4), 0x51, 32 * KiB);
120 +
121 + /* i2c13mux ch7 */
122 + /* nfc@28 — no model */
123 +}
124 +
125 +static void aspeed_machine_anacapa_class_init(ObjectClass *oc,
126 + const void *data)
127 +{
128 + MachineClass *mc = MACHINE_CLASS(oc);
129 + AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
130 +
131 + mc->desc = "Facebook Anacapa BMC (Cortex-A7)";
132 + amc->soc_name = "ast2600-a3";
133 + amc->hw_strap1 = ANACAPA_BMC_HW_STRAP1;
134 + amc->hw_strap2 = ANACAPA_BMC_HW_STRAP2;
135 + amc->fmc_model = "mx66l1g45g";
136 + amc->spi_model = NULL;
137 + amc->num_cs = 2;
138 + amc->macs_mask = ASPEED_MAC2_ON;
139 + amc->i2c_init = anacapa_bmc_i2c_init;
140 + mc->default_ram_size = ANACAPA_BMC_RAM_SIZE;
141 + aspeed_machine_class_init_cpus_defaults(mc);
142 +}
143 +
144 +static const TypeInfo aspeed_ast2600_anacapa_types[] = {
145 + {
146 + .name = MACHINE_TYPE_NAME("anacapa-bmc"),
147 + .parent = TYPE_ASPEED_MACHINE,
148 + .class_init = aspeed_machine_anacapa_class_init,
149 + .interfaces = arm_machine_interfaces,
150 + }
151 +};
152 +
153 +DEFINE_TYPES(aspeed_ast2600_anacapa_types)
hw/arm/meson.build
+1
@@ -54,6 +54,7 @@ arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files(
54 'aspeed_ast2500_witherspoon.c',
55 'aspeed_ast2500_yosemitev2.c',
56 'aspeed_ast2600.c',
57 + 'aspeed_ast2600_anacapa.c',
58 'aspeed_ast2600_bletchley.c',
59 'aspeed_ast2600_catalina.c',
60 'aspeed_ast2600_evb.c',
tests/functional/arm/meson.build
+2
@@ -12,6 +12,7 @@ test_arm_timeouts = {
12 'aspeed_ast2600_sdk' : 720,
13 'aspeed_ast2600_sdk_515' : 720,
14 'aspeed_ast2600_sdk_otp' : 720,
15 + 'aspeed_anacapa' : 480,
16 'aspeed_bletchley' : 480,
17 'aspeed_catalina' : 480,
18 'aspeed_gb200nvl_bmc' : 480,
@@ -45,6 +46,7 @@ tests_arm_system_thorough = [
46 'aspeed_ast2600_sdk',
47 'aspeed_ast2600_sdk_515',
48 'aspeed_ast2600_sdk_otp',
49 + 'aspeed_anacapa',
50 'aspeed_bletchley',
51 'aspeed_catalina',
52 'aspeed_gb200nvl_bmc',
tests/functional/arm/test_aspeed_anacapa.py new
+25
@@ -0,0 +1,25 @@
1 +#!/usr/bin/env python3
2 +#
3 +# Functional test that boots the ASPEED machines
4 +#
5 +# SPDX-License-Identifier: GPL-2.0-or-later
6 +
7 +from qemu_test import Asset
8 +from aspeed import FacebookAspeedTest
9 +
10 +
11 +class AnacapaMachine(FacebookAspeedTest):
12 +
13 + ASSET_ANACAPA_FLASH = Asset(
14 + 'https://github.com/legoater/qemu-aspeed-boot/raw/3fa3212827b04be4034d43b5adeef57c27d6ab18/images/anacapa-bmc/openbmc-20260512025228/obmc-phosphor-image-anacapa-20260512025228.static.mtd.xz',
15 + '2232e241abcfb6d4f6b82cb6c378ce5ce05e364aac6d118785c2b6cc33fe43f3')
16 +
17 + def test_arm_ast2600_anacapa_openbmc(self):
18 + image_path = self.uncompress(self.ASSET_ANACAPA_FLASH)
19 +
20 + self.do_test_arm_aspeed_openbmc('anacapa-bmc', image=image_path,
21 + uboot='2019.04', cpu_id='0xf00',
22 + soc='AST2600 rev A3')
23 +
24 +if __name__ == '__main__':
25 + FacebookAspeedTest.main()