hw/arm/aspeed: add anacapa-bmc machine
Subsystems (2)
v2 cover hw/arm/aspeed: add anacapa-bmc machine
This series adds support for the Anacapa machine type. The first patch introduces FacebookAspeedTest and updates the existing Facebook machine tests. The second patch adds the machine model and functional tests. The third patch adds the FRU EEPROM contents.
---
Changes in v2:
- Split the functional test (FacebookAspeedTest) into a separate patch,
also updating bletchley-bmc and catalina-bmc to use it.
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]
---
William de Abreu Pinho (3):
tests/functional/aspeed: introduce FacebookAspeedTest hw/arm/aspeed: add anacapa-bmc machine hw/arm/aspeed: anacapa: add FRU EEPROM data
hw/arm/aspeed_ast2600_anacapa.c | 362 ++++++++++++++++++++++++++ hw/arm/meson.build | 1 + tests/functional/arm/meson.build | 2 + tests/functional/arm/test_aspeed_anacapa.py | 25 ++ tests/functional/arm/test_aspeed_bletchley.py | 6 +- tests/functional/arm/test_aspeed_catalina.py | 6 +- tests/functional/aspeed.py | 8 + 7 files changed, 404 insertions(+), 6 deletions(-)
---
base-commit: ee7eb612be8f8886d48c1d0c1f1c65e495138f83
change-id: 20260511-add-anacapa-machine-cf7076ab0afa
Best regards,
Signature · 1 line
William de Abreu Pinho <[email protected]>
PATCH v2 1/3 tests/functional/aspeed: introduce FacebookAspeedTest
Facebook OpenBMC Images include an early script [1] that lowers the console log level to warning. This suppresses the "Hostname set to" message from the serial console. Introduce FacebookAspeedTest (a subclass of AspeedTest), that waits for login prompt instead. Update bletchley-bmc and catalina-bmc to use the new class.
This is also used by the anacapa-bmc machine introduced in the following patch.
--- tests/functional/arm/test_aspeed_bletchley.py | 6 +++--- tests/functional/arm/test_aspeed_catalina.py | 6 +++--- tests/functional/aspeed.py | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-)
tests/functional/arm/test_aspeed_bletchley.py +3 -3
@@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later from qemu_test import Asset -from aspeed import AspeedTest +from aspeed import FacebookAspeedTest -class BletchleyMachine(AspeedTest): +class BletchleyMachine(FacebookAspeedTest): ASSET_BLETCHLEY_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/bletchley-bmc/openbmc-20250128071329/obmc-phosphor-image-bletchley-20250128071329.static.mtd.xz',
@@ -22,4 +22,4 @@ def test_arm_ast2600_bletchley_openbmc(self): soc='AST2600 rev A3') if __name__ == '__main__': - AspeedTest.main() + FacebookAspeedTest.main()
tests/functional/arm/test_aspeed_catalina.py +3 -3
@@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later from qemu_test import Asset -from aspeed import AspeedTest +from aspeed import FacebookAspeedTest -class CatalinaMachine(AspeedTest): +class CatalinaMachine(FacebookAspeedTest): ASSET_CATALINA_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/a866feb5ef81245b4827a214584bf6bcc72939f6/images/catalina-bmc/obmc-phosphor-image-catalina-20250619123021.static.mtd.xz',
@@ -22,4 +22,4 @@ def test_arm_ast2600_catalina_openbmc(self): soc='AST2600 rev A3') if __name__ == '__main__': - AspeedTest.main() + FacebookAspeedTest.main()
tests/functional/aspeed.py +8 -0
@@ -28,6 +28,9 @@ def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04', self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}') self.wait_for_console_pattern(f'ASPEED {soc}') self.wait_for_console_pattern('/init as init process') + self.wait_for_boot_complete(hostname) + + def wait_for_boot_complete(self, hostname): self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.') def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
@@ -69,3 +72,8 @@ def generate_otpmem_image(self): f.write(pattern) return path + +class FacebookAspeedTest(AspeedTest): + + def wait_for_boot_complete(self, hostname): + self.wait_for_console_pattern(f'{hostname} login:')
Signature · 1 line
2.53.0-Meta
Re: [PATCH v2 1/3] tests/functional/aspeed: introduce FacebookAspeedTest
Quoted 69 lines · William de Abreu Pinho
Facebook OpenBMC Images include an early script [1] that lowers the console log level to warning. This suppresses the "Hostname set to" message from the serial console. Introduce FacebookAspeedTest (a subclass of AspeedTest), that waits for login prompt instead. Update bletchley-bmc and catalina-bmc to use the new class.
This is also used by the anacapa-bmc machine introduced in the following patch.
Signed-off-by William de Abreu Pinho <[email protected]>--- tests/functional/arm/test_aspeed_bletchley.py | 6 +++--- tests/functional/arm/test_aspeed_catalina.py | 6 +++--- tests/functional/aspeed.py | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-)tests/functional/arm/test_aspeed_bletchley.py +3
-3@@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later from qemu_test import Asset -from aspeed import AspeedTest +from aspeed import FacebookAspeedTest -class BletchleyMachine(AspeedTest): +class BletchleyMachine(FacebookAspeedTest): ASSET_BLETCHLEY_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/bletchley-bmc/openbmc-20250128071329/obmc-phosphor-image-bletchley-20250128071329.static.mtd.xz',@@ -22,4 +22,4 @@ def test_arm_ast2600_bletchley_openbmc(self): soc='AST2600 rev A3') if __name__ == '__main__': - AspeedTest.main() + FacebookAspeedTest.main()tests/functional/arm/test_aspeed_catalina.py +3
-3@@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later from qemu_test import Asset -from aspeed import AspeedTest +from aspeed import FacebookAspeedTest -class CatalinaMachine(AspeedTest): +class CatalinaMachine(FacebookAspeedTest): ASSET_CATALINA_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/a866feb5ef81245b4827a214584bf6bcc72939f6/images/catalina-bmc/obmc-phosphor-image-catalina-20250619123021.static.mtd.xz',@@ -22,4 +22,4 @@ def test_arm_ast2600_catalina_openbmc(self): soc='AST2600 rev A3') if __name__ == '__main__': - AspeedTest.main() + FacebookAspeedTest.main()tests/functional/aspeed.py +0
-0
tests/functional/aspeed.py def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04', · line 34
Quoted 7 lines
tests/functional/aspeed.py +3
-0@@ -28,6 +28,9 @@ def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04', self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}') self.wait_for_console_pattern(f'ASPEED {soc}') self.wait_for_console_pattern('/init as init process') + self.wait_for_boot_complete(hostname) + + def wait_for_boot_complete(self, hostname): self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.')
This will slow down a bit the tests. Anyhow,
Thanks,
C.
Quoted 11 lines
tests/functional/aspeed.py +5
-0def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):@@ -69,3 +72,8 @@ def generate_otpmem_image(self): f.write(pattern) return path + +class FacebookAspeedTest(AspeedTest): + + def wait_for_boot_complete(self, hostname): + self.wait_for_console_pattern(f'{hostname} login:')
PATCH v2 2/3 hw/arm/aspeed: add anacapa-bmc machine
In reply to William de Abreu PinhoAdd 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
--- hw/arm/aspeed_ast2600_anacapa.c | 153 ++++++++++++++++++++++++++++ hw/arm/meson.build | 1 + tests/functional/arm/meson.build | 2 + tests/functional/arm/test_aspeed_anacapa.py | 25 +++++ 4 files changed, 181 insertions(+)
hw/arm/aspeed_ast2600_anacapa.c new file +153 -0
@@ -0,0 +1,153 @@ +/* +* Facebook Anacapa +* +* Copyright (c) Meta Platforms, Inc. and affiliates. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/arm/machines-qom.h" +#include "hw/arm/aspeed.h" +#include "hw/arm/aspeed_soc.h" +#include "hw/i2c/i2c_mux_pca954x.h" +#include "hw/gpio/pca9552.h" +#include "hw/nvram/eeprom_at24c.h" + +/* Anacapa hardware value */ +#define ANACAPA_BMC_HW_STRAP1 0x00002002 +#define ANACAPA_BMC_HW_STRAP2 0x00000000 +#define ANACAPA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) + +static void anacapa_bmc_i2c_init (AspeedMachineState *bmc) +{ +/* Reference: aspeed-bmc-facebook-anacapa.dts */ + +AspeedSoCState *soc = bmc->soc; +I2CBus *i2c[16 ] = {}; +I2CSlave *i2c_mux; + +for (int i =0 ; i <ARRAY_SIZE (i2c); i++) { + i2c[i] =aspeed_i2c_get_bus (&soc->i2c, i); + } + +/* &i2c0 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[0 ],0x50 ,256 * KiB); +/* i2c-mux@70 */ +i2c_slave_create_simple (i2c[0 ],TYPE_PCA9546 ,0x70 ); + +/* &i2c1 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[1 ],0x50 ,256 * KiB); +/* i2c-mux@70 (PCA9546) — 4 channels, empty */ +i2c_slave_create_simple (i2c[1 ],TYPE_PCA9546 ,0x70 ); + +/* &i2c4 */ +/* i2c-mux@70 (PCA9548) */ +i2c_slave_create_simple (i2c[4 ],TYPE_PCA9548 ,0x70 ); + +/* &i2c6 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[6 ],0x50 ,32 * KiB); + +/* &i2c8 */ +/* i2c-mux@72 (PCA9546) */ + i2c_mux =i2c_slave_create_simple (i2c[8 ],TYPE_PCA9546 ,0x72 ); + +/* i2c8mux ch0 */ +/* adc128d818@1f — no model */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ), +TYPE_PCA9552 ,0x22 ); +/* pca9555@24 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ), +TYPE_PCA9552 ,0x24 ); +/* eeprom@50 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,0 ),0x50 ,16 * KiB); + +/* i2c8mux ch1 */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), +TYPE_PCA9552 ,0x22 ); +/* pca9555@24 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), +TYPE_PCA9552 ,0x24 ); +/* eeprom@50 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,16 * KiB); + +/* &i2c9 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[9 ],0x50 ,16 * KiB); +/* eeprom@56 */ +at24c_eeprom_init (i2c[9 ],0x56 ,8 * KiB); + +/* &i2c10 */ +/* i2c-mux@71 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[10 ],TYPE_PCA9548 ,0x71 ); + +/* i2c10mux ch5 */ +/* pca9555@22*/ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ), +TYPE_PCA9552 ,0x22 ); +/* eeprom@52 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); + +/* &i2c11 */ +/* i2c-mux@71 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[11 ],TYPE_PCA9548 ,0x71 ); + +/* i2c11mux ch0-ch4 — empty */ + +/* i2c11mux ch5 */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ), +TYPE_PCA9552 ,0x22 ); +/* eeprom@52 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); + +/* &i2c13 */ +/* i2c-mux@70 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[13 ],TYPE_PCA9548 ,0x70 ); + +/* i2c13mux ch3 */ +/* adc128d818@1f - no model */ + +/* i2c13mux ch4 */ +/* eeprom@51 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,4 ),0x51 ,32 * KiB); + +/* i2c13mux ch7 */ +/* nfc@28 — no model */ +} + +static void aspeed_machine_anacapa_class_init (ObjectClass *oc, +const void *data) +{ +MachineClass *mc =MACHINE_CLASS (oc); +AspeedMachineClass *amc =ASPEED_MACHINE_CLASS (oc); + + mc->desc ="Facebook Anacapa BMC (Cortex-A7)" ; + amc->soc_name ="ast2600-a3" ; + amc->hw_strap1 =ANACAPA_BMC_HW_STRAP1 ; + amc->hw_strap2 =ANACAPA_BMC_HW_STRAP2 ; + amc->fmc_model ="mx66l1g45g" ; + amc->spi_model =NULL ; + amc->num_cs =2 ; + amc->macs_mask =ASPEED_MAC2_ON ; + amc->i2c_init = anacapa_bmc_i2c_init; + mc->default_ram_size =ANACAPA_BMC_RAM_SIZE ; +aspeed_machine_class_init_cpus_defaults (mc); +} + +static const TypeInfo aspeed_ast2600_anacapa_types[] = { + { + .name =MACHINE_TYPE_NAME ("anacapa-bmc" ), + .parent =TYPE_ASPEED_MACHINE , + .class_init = aspeed_machine_anacapa_class_init, + .interfaces = arm_machine_interfaces, + } +}; + +DEFINE_TYPES (aspeed_ast2600_anacapa_types)
hw/arm/meson.build +1 -0
@@ -56,6 +56,7 @@ arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_ast2500_witherspoon.c', 'aspeed_ast2500_yosemitev2.c', 'aspeed_ast2600.c', + 'aspeed_ast2600_anacapa.c', 'aspeed_ast2600_bletchley.c', 'aspeed_ast2600_catalina.c', 'aspeed_ast2600_evb.c',
tests/functional/arm/meson.build +2 -0
@@ -12,6 +12,7 @@ test_arm_timeouts = { 'aspeed_ast2600_sdk' : 720, 'aspeed_ast2600_sdk_515' : 720, 'aspeed_ast2600_sdk_otp' : 720, + 'aspeed_anacapa' : 480, 'aspeed_bletchley' : 480, 'aspeed_catalina' : 480, 'aspeed_gb200nvl_bmc' : 480,
@@ -45,6 +46,7 @@ tests_arm_system_thorough = [ 'aspeed_ast2600_sdk', 'aspeed_ast2600_sdk_515', 'aspeed_ast2600_sdk_otp', + 'aspeed_anacapa', 'aspeed_bletchley', 'aspeed_catalina', 'aspeed_gb200nvl_bmc',
tests/functional/arm/test_aspeed_anacapa.py new file +25 -0
@@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# +# Functional test that boots the ASPEED machines +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import Asset +from aspeed import FacebookAspeedTest + + +class AnacapaMachine(FacebookAspeedTest): + + ASSET_ANACAPA_FLASH = Asset( + 'https://github.com/legoater/qemu-aspeed-boot/raw/3fa3212827b04be4034d43b5adeef57c27d6ab18/images/anacapa-bmc/openbmc-20260512025228/obmc-phosphor-image-anacapa-20260512025228.static.mtd.xz', + '2232e241abcfb6d4f6b82cb6c378ce5ce05e364aac6d118785c2b6cc33fe43f3') + + def test_arm_ast2600_anacapa_openbmc(self): + image_path = self.uncompress(self.ASSET_ANACAPA_FLASH) + + self.do_test_arm_aspeed_openbmc('anacapa-bmc', image=image_path, + uboot='2019.04', cpu_id='0xf00', + soc='AST2600 rev A3') + +if __name__ == '__main__': + FacebookAspeedTest.main()
Signature · 1 line
2.53.0-Meta
Quoted 10 lines · William de Abreu Pinho
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
Quoted 7 lines
Signed-off-by William de Abreu Pinho <[email protected]>--- hw/arm/aspeed_ast2600_anacapa.c | 153 ++++++++++++++++++++++++++++ hw/arm/meson.build | 1 + tests/functional/arm/meson.build | 2 + tests/functional/arm/test_aspeed_anacapa.py | 25 +++++ 4 files changed, 181 insertions(+)
I forgot to tell you to update docs/system/arm/aspeed.rst too.
With that,
Quoted 30 lines
hw/arm/aspeed_ast2600_anacapa.c new file +23
-0@@ -0,0 +1,153 @@ +/* +* Facebook Anacapa +* +* Copyright (c) Meta Platforms, Inc. and affiliates. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/arm/machines-qom.h" +#include "hw/arm/aspeed.h" +#include "hw/arm/aspeed_soc.h" +#include "hw/i2c/i2c_mux_pca954x.h" +#include "hw/gpio/pca9552.h" +#include "hw/nvram/eeprom_at24c.h" + +/* Anacapa hardware value */ +#define ANACAPA_BMC_HW_STRAP1 0x00002002 +#define ANACAPA_BMC_HW_STRAP2 0x00000000 +#define ANACAPA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) + +static void anacapa_bmc_i2c_init (AspeedMachineState *bmc)
hw/arm/aspeed_ast2600_anacapa.c line 33
Quoted 10 lines
hw/arm/aspeed_ast2600_anacapa.c new file +10
-0+{ +/* Reference: aspeed-bmc-facebook-anacapa.dts */ + +AspeedSoCState *soc = bmc->soc; +I2CBus *i2c[16 ] = {}; +I2CSlave *i2c_mux; + +for (int i =0 ; i <ARRAY_SIZE (i2c); i++) { + i2c[i] =aspeed_i2c_get_bus (&soc->i2c, i); + }
This seems to be a common pattern in the Aspeed machines to initialize an array of I2C. We could introduce an helper for it.
Thanks,
C.
Quoted 183 lines
hw/arm/aspeed_ast2600_anacapa.c new file +119
-0+/* &i2c0 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[0 ],0x50 ,256 * KiB); +/* i2c-mux@70 */ +i2c_slave_create_simple (i2c[0 ],TYPE_PCA9546 ,0x70 ); + +/* &i2c1 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[1 ],0x50 ,256 * KiB); +/* i2c-mux@70 (PCA9546) — 4 channels, empty */ +i2c_slave_create_simple (i2c[1 ],TYPE_PCA9546 ,0x70 ); + +/* &i2c4 */ +/* i2c-mux@70 (PCA9548) */ +i2c_slave_create_simple (i2c[4 ],TYPE_PCA9548 ,0x70 ); + +/* &i2c6 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[6 ],0x50 ,32 * KiB); + +/* &i2c8 */ +/* i2c-mux@72 (PCA9546) */ + i2c_mux =i2c_slave_create_simple (i2c[8 ],TYPE_PCA9546 ,0x72 ); + +/* i2c8mux ch0 */ +/* adc128d818@1f — no model */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ), +TYPE_PCA9552 ,0x22 ); +/* pca9555@24 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ), +TYPE_PCA9552 ,0x24 ); +/* eeprom@50 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,0 ),0x50 ,16 * KiB); + +/* i2c8mux ch1 */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), +TYPE_PCA9552 ,0x22 ); +/* pca9555@24 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), +TYPE_PCA9552 ,0x24 ); +/* eeprom@50 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,16 * KiB); + +/* &i2c9 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[9 ],0x50 ,16 * KiB); +/* eeprom@56 */ +at24c_eeprom_init (i2c[9 ],0x56 ,8 * KiB); + +/* &i2c10 */ +/* i2c-mux@71 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[10 ],TYPE_PCA9548 ,0x71 ); + +/* i2c10mux ch5 */ +/* pca9555@22*/ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ), +TYPE_PCA9552 ,0x22 ); +/* eeprom@52 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); + +/* &i2c11 */ +/* i2c-mux@71 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[11 ],TYPE_PCA9548 ,0x71 ); + +/* i2c11mux ch0-ch4 — empty */ + +/* i2c11mux ch5 */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ), +TYPE_PCA9552 ,0x22 ); +/* eeprom@52 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); + +/* &i2c13 */ +/* i2c-mux@70 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[13 ],TYPE_PCA9548 ,0x70 ); + +/* i2c13mux ch3 */ +/* adc128d818@1f - no model */ + +/* i2c13mux ch4 */ +/* eeprom@51 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,4 ),0x51 ,32 * KiB); + +/* i2c13mux ch7 */ +/* nfc@28 — no model */ +} + +static void aspeed_machine_anacapa_class_init (ObjectClass *oc, +const void *data) +{ +MachineClass *mc =MACHINE_CLASS (oc); +AspeedMachineClass *amc =ASPEED_MACHINE_CLASS (oc); + + mc->desc ="Facebook Anacapa BMC (Cortex-A7)" ; + amc->soc_name ="ast2600-a3" ; + amc->hw_strap1 =ANACAPA_BMC_HW_STRAP1 ; + amc->hw_strap2 =ANACAPA_BMC_HW_STRAP2 ; + amc->fmc_model ="mx66l1g45g" ; + amc->spi_model =NULL ; + amc->num_cs =2 ; + amc->macs_mask =ASPEED_MAC2_ON ; + amc->i2c_init = anacapa_bmc_i2c_init; + mc->default_ram_size =ANACAPA_BMC_RAM_SIZE ; +aspeed_machine_class_init_cpus_defaults (mc); +} + +static const TypeInfo aspeed_ast2600_anacapa_types[] = { + { + .name =MACHINE_TYPE_NAME ("anacapa-bmc" ), + .parent =TYPE_ASPEED_MACHINE , + .class_init = aspeed_machine_anacapa_class_init, + .interfaces = arm_machine_interfaces, + } +}; + +DEFINE_TYPES (aspeed_ast2600_anacapa_types)hw/arm/meson.build +1
-0@@ -56,6 +56,7 @@ arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_ast2500_witherspoon.c', 'aspeed_ast2500_yosemitev2.c', 'aspeed_ast2600.c', + 'aspeed_ast2600_anacapa.c', 'aspeed_ast2600_bletchley.c', 'aspeed_ast2600_catalina.c', 'aspeed_ast2600_evb.c',tests/functional/arm/meson.build +2
-0@@ -12,6 +12,7 @@ test_arm_timeouts = { 'aspeed_ast2600_sdk' : 720, 'aspeed_ast2600_sdk_515' : 720, 'aspeed_ast2600_sdk_otp' : 720, + 'aspeed_anacapa' : 480, 'aspeed_bletchley' : 480, 'aspeed_catalina' : 480, 'aspeed_gb200nvl_bmc' : 480,@@ -45,6 +46,7 @@ tests_arm_system_thorough = [ 'aspeed_ast2600_sdk', 'aspeed_ast2600_sdk_515', 'aspeed_ast2600_sdk_otp', + 'aspeed_anacapa', 'aspeed_bletchley', 'aspeed_catalina', 'aspeed_gb200nvl_bmc',tests/functional/arm/test_aspeed_anacapa.py new file +25
-0@@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# +# Functional test that boots the ASPEED machines +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import Asset +from aspeed import FacebookAspeedTest + + +class AnacapaMachine(FacebookAspeedTest): + + ASSET_ANACAPA_FLASH = Asset( + 'https://github.com/legoater/qemu-aspeed-boot/raw/3fa3212827b04be4034d43b5adeef57c27d6ab18/images/anacapa-bmc/openbmc-20260512025228/obmc-phosphor-image-anacapa-20260512025228.static.mtd.xz', + '2232e241abcfb6d4f6b82cb6c378ce5ce05e364aac6d118785c2b6cc33fe43f3') + + def test_arm_ast2600_anacapa_openbmc(self): + image_path = self.uncompress(self.ASSET_ANACAPA_FLASH) + + self.do_test_arm_aspeed_openbmc('anacapa-bmc', image=image_path, + uboot='2019.04', cpu_id='0xf00', + soc='AST2600 rev A3') + +if __name__ == '__main__': + FacebookAspeedTest.main()
Quoted 57 lines · Cédric Le Goater
Quoted 10 lines · William de Abreu Pinho
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/8e22df918eaaa5d83143471d24ef0eeb1c1e3c7cQuoted 7 lines
Signed-off-by William de Abreu Pinho <[email protected]>--- hw/arm/aspeed_ast2600_anacapa.c | 153 ++++++++++++++++++++++++++++ hw/arm/meson.build | 1 + tests/functional/arm/meson.build | 2 + tests/functional/arm/test_aspeed_anacapa.py | 25 +++++ 4 files changed, 181 insertions(+)I forgot to tell you to update
docs/system/arm/aspeed.rsttoo.With that,
Reviewed-by Cédric Le Goater <[email protected]>Quoted 32 lines
hw/arm/aspeed_ast2600_anacapa.c new file +25
-0@@ -0,0 +1,153 @@ +/* +* Facebook Anacapa +* +* Copyright (c) Meta Platforms, Inc. and affiliates. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/arm/machines-qom.h" +#include "hw/arm/aspeed.h" +#include "hw/arm/aspeed_soc.h" +#include "hw/i2c/i2c_mux_pca954x.h" +#include "hw/gpio/pca9552.h" +#include "hw/nvram/eeprom_at24c.h" + +/* Anacapa hardware value */ +#define ANACAPA_BMC_HW_STRAP1 0x00002002 +#define ANACAPA_BMC_HW_STRAP2 0x00000000 +#define ANACAPA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) + +static void anacapa_bmc_i2c_init (AspeedMachineState *bmc) +{ +/* Reference: aspeed-bmc-facebook-anacapa.dts */
Quoted 9 lines
hw/arm/aspeed_ast2600_anacapa.c line 33
Quoted 8 lines
hw/arm/aspeed_ast2600_anacapa.c new file +8
-0+ +AspeedSoCState *soc = bmc->soc; +I2CBus *i2c[16 ] = {}; +I2CSlave *i2c_mux; + +for (int i =0 ; i <ARRAY_SIZE (i2c); i++) { + i2c[i] =aspeed_i2c_get_bus (&soc->i2c, i); + }
Thanks for the suggestion. I will introduce a helper in a hw/arm/aspeed.c in a separate patch.
Quoted 194 lines
This seems to be a common pattern in the Aspeed machines to initialize an array of I2C. We could introduce an helper for it.
Thanks,
C.
Quoted 183 lines
hw/arm/aspeed_ast2600_anacapa.c new file +119
-0+/* &i2c0 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[0 ],0x50 ,256 * KiB); +/* i2c-mux@70 */ +i2c_slave_create_simple (i2c[0 ],TYPE_PCA9546 ,0x70 ); + +/* &i2c1 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[1 ],0x50 ,256 * KiB); +/* i2c-mux@70 (PCA9546) — 4 channels, empty */ +i2c_slave_create_simple (i2c[1 ],TYPE_PCA9546 ,0x70 ); + +/* &i2c4 */ +/* i2c-mux@70 (PCA9548) */ +i2c_slave_create_simple (i2c[4 ],TYPE_PCA9548 ,0x70 ); + +/* &i2c6 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[6 ],0x50 ,32 * KiB); + +/* &i2c8 */ +/* i2c-mux@72 (PCA9546) */ + i2c_mux =i2c_slave_create_simple (i2c[8 ],TYPE_PCA9546 ,0x72 ); + +/* i2c8mux ch0 */ +/* adc128d818@1f — no model */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ), +TYPE_PCA9552 ,0x22 ); +/* pca9555@24 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ), +TYPE_PCA9552 ,0x24 ); +/* eeprom@50 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,0 ),0x50 ,16 * KiB); + +/* i2c8mux ch1 */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), +TYPE_PCA9552 ,0x22 ); +/* pca9555@24 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), +TYPE_PCA9552 ,0x24 ); +/* eeprom@50 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,16 * KiB); + +/* &i2c9 */ +/* eeprom@50 */ +at24c_eeprom_init (i2c[9 ],0x50 ,16 * KiB); +/* eeprom@56 */ +at24c_eeprom_init (i2c[9 ],0x56 ,8 * KiB); + +/* &i2c10 */ +/* i2c-mux@71 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[10 ],TYPE_PCA9548 ,0x71 ); + +/* i2c10mux ch5 */ +/* pca9555@22*/ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ), +TYPE_PCA9552 ,0x22 ); +/* eeprom@52 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); + +/* &i2c11 */ +/* i2c-mux@71 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[11 ],TYPE_PCA9548 ,0x71 ); + +/* i2c11mux ch0-ch4 — empty */ + +/* i2c11mux ch5 */ +/* pca9555@22 */ +i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ), +TYPE_PCA9552 ,0x22 ); +/* eeprom@52 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); + +/* &i2c13 */ +/* i2c-mux@70 (PCA9548) */ + i2c_mux =i2c_slave_create_simple (i2c[13 ],TYPE_PCA9548 ,0x70 ); + +/* i2c13mux ch3 */ +/* adc128d818@1f - no model */ + +/* i2c13mux ch4 */ +/* eeprom@51 */ +at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,4 ),0x51 ,32 * KiB); + +/* i2c13mux ch7 */ +/* nfc@28 — no model */ +} + +static void aspeed_machine_anacapa_class_init (ObjectClass *oc, +const void *data) +{ +MachineClass *mc =MACHINE_CLASS (oc); +AspeedMachineClass *amc =ASPEED_MACHINE_CLASS (oc); + + mc->desc ="Facebook Anacapa BMC (Cortex-A7)" ; + amc->soc_name ="ast2600-a3" ; + amc->hw_strap1 =ANACAPA_BMC_HW_STRAP1 ; + amc->hw_strap2 =ANACAPA_BMC_HW_STRAP2 ; + amc->fmc_model ="mx66l1g45g" ; + amc->spi_model =NULL ; + amc->num_cs =2 ; + amc->macs_mask =ASPEED_MAC2_ON ; + amc->i2c_init = anacapa_bmc_i2c_init; + mc->default_ram_size =ANACAPA_BMC_RAM_SIZE ; +aspeed_machine_class_init_cpus_defaults (mc); +} + +static const TypeInfo aspeed_ast2600_anacapa_types[] = { + { + .name =MACHINE_TYPE_NAME ("anacapa-bmc" ), + .parent =TYPE_ASPEED_MACHINE , + .class_init = aspeed_machine_anacapa_class_init, + .interfaces = arm_machine_interfaces, + } +}; + +DEFINE_TYPES (aspeed_ast2600_anacapa_types)hw/arm/meson.build +1
-0@@ -56,6 +56,7 @@ arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_ast2500_witherspoon.c', 'aspeed_ast2500_yosemitev2.c', 'aspeed_ast2600.c', + 'aspeed_ast2600_anacapa.c', 'aspeed_ast2600_bletchley.c', 'aspeed_ast2600_catalina.c', 'aspeed_ast2600_evb.c',tests/functional/arm/meson.build +2
-0@@ -12,6 +12,7 @@ test_arm_timeouts = { 'aspeed_ast2600_sdk' : 720, 'aspeed_ast2600_sdk_515' : 720, 'aspeed_ast2600_sdk_otp' : 720, + 'aspeed_anacapa' : 480, 'aspeed_bletchley' : 480, 'aspeed_catalina' : 480, 'aspeed_gb200nvl_bmc' : 480,@@ -45,6 +46,7 @@ tests_arm_system_thorough = [ 'aspeed_ast2600_sdk', 'aspeed_ast2600_sdk_515', 'aspeed_ast2600_sdk_otp', + 'aspeed_anacapa', 'aspeed_bletchley', 'aspeed_catalina', 'aspeed_gb200nvl_bmc',tests/functional/arm/test_aspeed_anacapa.py new file +25
-0@@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# +# Functional test that boots the ASPEED machines +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import Asset +from aspeed import FacebookAspeedTest + + +class AnacapaMachine(FacebookAspeedTest): + + ASSET_ANACAPA_FLASH = Asset( + 'https://github.com/legoater/qemu-aspeed-boot/raw/3fa3212827b04be4034d43b5adeef57c27d6ab18/images/anacapa-bmc/openbmc-20260512025228/obmc-phosphor-image-anacapa-20260512025228.static.mtd.xz', + '2232e241abcfb6d4f6b82cb6c378ce5ce05e364aac6d118785c2b6cc33fe43f3') + + def test_arm_ast2600_anacapa_openbmc(self): + image_path = self.uncompress(self.ASSET_ANACAPA_FLASH) + + self.do_test_arm_aspeed_openbmc('anacapa-bmc', image=image_path, + uboot='2019.04', cpu_id='0xf00', + soc='AST2600 rev A3') + +if __name__ == '__main__': + FacebookAspeedTest.main()
PATCH v2 3/3 hw/arm/aspeed: anacapa: add FRU EEPROM data
In reply to William de Abreu PinhoUse frugen to generate FRU data for the following components: HPM MB, R-PDB, L-PDB, SCM, BSM, R Bridge Board, L Bridge Board, and HPM board ID.
--- hw/arm/aspeed_ast2600_anacapa.c | 225 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 217 insertions(+), 8 deletions(-)
hw/arm/aspeed_ast2600_anacapa.c +217 -8
@@ -20,6 +20,207 @@#define ANACAPA_BMC_HW_STRAP2 0x00000000#define ANACAPA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) +/* +* "Anacapa HPM (MB)" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU MB EVT2", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Inventec", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t hpm_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x08 ,0x00 ,0x00 ,0xf6 ,0x01 ,0x07 ,0x19 ,0xb4 , +0xa4 ,0xf2 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 ,0x6e ,0x74 ,0x65 ,0x63 ,0xd4 , +0x41 ,0x6e ,0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x51 ,0x45 ,0x4d ,0x55 , +0x20 ,0x4d ,0x42 ,0x20 ,0x45 ,0x56 ,0x54 ,0x32 ,0x47 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a ,0xc0 , +0xc1 ,0x00 ,0x00 ,0xb8 ,0x01 ,0x06 ,0x19 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 , +0x6e ,0x74 ,0x65 ,0x63 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e ,0x61 ,0x63 , +0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a ,0x82 ,0x2d , +0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 ,0x71 ,0xd9 , +0xd6 ,0xc0 ,0xc1 ,0x0e +}; +static const size_t hpm_eeprom_len =sizeof (hpm_eeprom); + +/* +* "Anacapa R-PDB" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU RPDB", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Inventec", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t rpdb_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x08 ,0x00 ,0x00 ,0xf6 ,0x01 ,0x07 ,0x19 ,0x41 , +0x2d ,0xf2 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 ,0x6e ,0x74 ,0x65 ,0x63 ,0xd1 , +0x41 ,0x6e ,0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x51 ,0x45 ,0x4d ,0x55 , +0x20 ,0x52 ,0x50 ,0x44 ,0x42 ,0x47 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a ,0xc0 ,0xc1 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x4d ,0x01 ,0x06 ,0x19 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 , +0x6e ,0x74 ,0x65 ,0x63 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e ,0x61 ,0x63 , +0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a ,0x82 ,0x2d , +0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 ,0x71 ,0xd9 , +0xd6 ,0xc0 ,0xc1 ,0x0e +}; +static const size_t rpdb_eeprom_len =sizeof (rpdb_eeprom); + +/* +* "Anacapa L-PDB" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU LPDB", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Inventec", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t lpdb_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x08 ,0x00 ,0x00 ,0xf6 ,0x01 ,0x07 ,0x19 ,0x41 , +0x2d ,0xf2 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 ,0x6e ,0x74 ,0x65 ,0x63 ,0xd1 , +0x41 ,0x6e ,0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x51 ,0x45 ,0x4d ,0x55 , +0x20 ,0x4c ,0x50 ,0x44 ,0x42 ,0x47 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a ,0xc0 ,0xc1 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x53 ,0x01 ,0x06 ,0x19 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 , +0x6e ,0x74 ,0x65 ,0x63 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e ,0x61 ,0x63 , +0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a ,0x82 ,0x2d , +0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 ,0x71 ,0xd9 , +0xd6 ,0xc0 ,0xc1 ,0x0e +}; +static const size_t lpdb_eeprom_len =sizeof (lpdb_eeprom); + +/* +* "Anacapa SCM" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Quanta", "pname": "Anacapa SCM", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Quanta", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t scm_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x07 ,0x00 ,0x00 ,0xf7 ,0x01 ,0x06 ,0x19 ,0x41 , +0x2d ,0xf2 ,0xc6 ,0x51 ,0x75 ,0x61 ,0x6e ,0x74 ,0x61 ,0xcb ,0x41 ,0x6e , +0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x53 ,0x43 ,0x4d ,0x47 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a , +0xc0 ,0xc1 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xc5 ,0x01 ,0x06 ,0x19 ,0xc6 , +0x51 ,0x75 ,0x61 ,0x6e ,0x74 ,0x61 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e , +0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a , +0x82 ,0x2d ,0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 , +0x71 ,0xd9 ,0xd6 ,0xc0 ,0xc1 ,0x00 ,0x00 ,0xe2 +}; +static const size_t scm_eeprom_len =sizeof (scm_eeprom); + +/* +* "Anacapa BMC Storage Module" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Quanta", "pname": "Anacapa BMC Storage Module", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Quanta", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t bsm_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x0a ,0x00 ,0x00 ,0xf4 ,0x01 ,0x09 ,0x00 ,0x00 , +0x00 ,0x00 ,0xc6 ,0x51 ,0x75 ,0x61 ,0x6e ,0x74 ,0x61 ,0xda ,0x41 ,0x6e , +0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x42 ,0x4d ,0x43 ,0x20 ,0x53 ,0x74 , +0x6f ,0x72 ,0x61 ,0x67 ,0x65 ,0x20 ,0x4d ,0x6f ,0x64 ,0x75 ,0x6c ,0x65 , +0xce ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 , +0x30 ,0x30 ,0x30 ,0xcb ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 , +0x30 ,0x30 ,0x30 ,0xc0 ,0xc1 ,0x00 ,0x00 ,0x10 ,0x01 ,0x08 ,0x00 ,0xc6 , +0x51 ,0x75 ,0x61 ,0x6e ,0x74 ,0x61 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e , +0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0xcb ,0x31 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 , +0x30 ,0x30 ,0x30 ,0x30 ,0x31 ,0xc2 ,0x4d ,0x50 ,0xce ,0x31 ,0x30 ,0x30 , +0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0x30 ,0xc4 , +0x51 ,0x45 ,0x4d ,0x55 ,0xc0 ,0xc1 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x77 , +}; +static const size_t bsm_eeprom_len =sizeof (bsm_eeprom); + +/* +* "Anacapa R Bridge Board" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU RBB EVT2", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Inventec", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t rbb_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x08 ,0x00 ,0x00 ,0xf6 ,0x01 ,0x07 ,0x19 ,0xb4 , +0xa4 ,0xf2 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 ,0x6e ,0x74 ,0x65 ,0x63 ,0xd5 , +0x41 ,0x6e ,0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x51 ,0x45 ,0x4d ,0x55 , +0x20 ,0x52 ,0x42 ,0x42 ,0x20 ,0x45 ,0x56 ,0x54 ,0x32 ,0x47 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a , +0xc0 ,0xc1 ,0x00 ,0x70 ,0x01 ,0x06 ,0x19 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 , +0x6e ,0x74 ,0x65 ,0x63 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e ,0x61 ,0x63 , +0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a ,0x82 ,0x2d , +0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 ,0x71 ,0xd9 , +0xd6 ,0xc0 ,0xc1 ,0x0e +}; +static const size_t rbb_eeprom_len =sizeof (rbb_eeprom); + +/* +* "Anacapa L Bridge Board" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU LBB EVT2", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Inventec", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t lbb_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x08 ,0x00 ,0x00 ,0xf6 ,0x01 ,0x07 ,0x19 ,0xb4 , +0xa4 ,0xf2 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 ,0x6e ,0x74 ,0x65 ,0x63 ,0xd5 , +0x41 ,0x6e ,0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x51 ,0x45 ,0x4d ,0x55 , +0x20 ,0x4c ,0x42 ,0x42 ,0x20 ,0x45 ,0x56 ,0x54 ,0x32 ,0x47 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a , +0xc0 ,0xc1 ,0x00 ,0x76 ,0x01 ,0x06 ,0x19 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 , +0x6e ,0x74 ,0x65 ,0x63 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e ,0x61 ,0x63 , +0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a ,0x82 ,0x2d , +0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 ,0x71 ,0xd9 , +0xd6 ,0xc0 ,0xc1 ,0x0e +}; +static const size_t lbb_eeprom_len =sizeof (lbb_eeprom); + +/* +* "Anacapa HPM BRD ID" FRU data. Generated with frugen. +* +* { +* "board": { "mfg": "Inventec", "pname": "Anacapa HPM BRD ID", +* "pn": "00000000000", "serial": "00000000000000" }, +* "product": { "mfg": "Inventec", "pname": "CI-Anacapa", +* "pn": "10000000001", "ver": "MP", +* "serial": "10000000000000", "atag": "QEMU" } +* } +*/ +static const uint8_t hpm_brd_id_eeprom[] = { +0x01 ,0x00 ,0x00 ,0x01 ,0x08 ,0x00 ,0x00 ,0xf6 ,0x01 ,0x07 ,0x19 ,0x41 , +0x2d ,0xf2 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 ,0x6e ,0x74 ,0x65 ,0x63 ,0xd2 , +0x41 ,0x6e ,0x61 ,0x63 ,0x61 ,0x70 ,0x61 ,0x20 ,0x48 ,0x50 ,0x4d ,0x20 , +0x42 ,0x52 ,0x44 ,0x20 ,0x49 ,0x44 ,0x47 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x46 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0a ,0xc0 ,0xc1 ,0x00 , +0x00 ,0x00 ,0x00 ,0x42 ,0x01 ,0x06 ,0x19 ,0xc8 ,0x49 ,0x6e ,0x76 ,0x65 , +0x6e ,0x74 ,0x65 ,0x63 ,0xca ,0x43 ,0x49 ,0x2d ,0x41 ,0x6e ,0x61 ,0x63 , +0x61 ,0x70 ,0x61 ,0x46 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1a ,0x82 ,0x2d , +0x0c ,0x47 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x83 ,0x71 ,0xd9 , +0xd6 ,0xc0 ,0xc1 ,0x0e +}; +static const size_t hpm_brd_id_eeprom_len =sizeof (hpm_brd_id_eeprom); +static void anacapa_bmc_i2c_init (AspeedMachineState *bmc) {/* Reference: aspeed-bmc-facebook-anacapa.dts */
@@ -50,7 +251,8 @@ static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)/* &i2c6 */ /* eeprom@50 */ -at24c_eeprom_init (i2c[6 ],0x50 ,32 * KiB); +at24c_eeprom_init_rom (i2c[6 ],0x50 ,32 * KiB, + hpm_eeprom, hpm_eeprom_len);/* &i2c8 */ /* i2c-mux@72 (PCA9546) */
@@ -65,7 +267,8 @@ static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,0 ),TYPE_PCA9552 ,0x24 );/* eeprom@50 */ -at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,0 ),0x50 ,16 * KiB); +at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,0 ),0x50 ,16 * KiB, + rpdb_eeprom, rpdb_eeprom_len);/* i2c8mux ch1 */ /* pca9555@22 */
@@ -75,13 +278,16 @@ static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ),TYPE_PCA9552 ,0x24 );/* eeprom@50 */ -at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,16 * KiB); +at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,16 * KiB, + lpdb_eeprom, lpdb_eeprom_len);/* &i2c9 */ /* eeprom@50 */ -at24c_eeprom_init (i2c[9 ],0x50 ,16 * KiB); +at24c_eeprom_init_rom (i2c[9 ],0x50 ,16 * KiB, + scm_eeprom, scm_eeprom_len);/* eeprom@56 */ -at24c_eeprom_init (i2c[9 ],0x56 ,8 * KiB); +at24c_eeprom_init_rom (i2c[9 ],0x56 ,8 * KiB, + bsm_eeprom, bsm_eeprom_len);/* &i2c10 */ /* i2c-mux@71 (PCA9548) */
@@ -92,7 +298,8 @@ static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ),TYPE_PCA9552 ,0x22 );/* eeprom@52 */ -at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); +at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB, + rbb_eeprom, rbb_eeprom_len);/* &i2c11 */ /* i2c-mux@71 (PCA9548) */
@@ -105,7 +312,8 @@ static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,5 ),TYPE_PCA9552 ,0x22 );/* eeprom@52 */ -at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB); +at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,5 ),0x52 ,32 * KiB, + lbb_eeprom, lbb_eeprom_len);/* &i2c13 */ /* i2c-mux@70 (PCA9548) */
@@ -116,7 +324,8 @@ static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)/* i2c13mux ch4 */ /* eeprom@51 */ -at24c_eeprom_init (pca954x_i2c_get_bus (i2c_mux,4 ),0x51 ,32 * KiB); +at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,4 ),0x51 ,32 * KiB, + hpm_brd_id_eeprom, hpm_brd_id_eeprom_len);/* i2c13mux ch7 */ /* nfc@28 — no model */
Signature · 1 line
2.53.0-Meta