
Add common smbios information that can be used by all armv8 platforms and set it as default for qemu-arm64.
From now smbios library can load values from here for those fields
doesn't exist in the sysinfo driver.
To run this with QEMU arm64, please dump the generated DTB from QEMU first, merge it with the one we build and then re-run QEMU with the merged DTB. ``` qemu-system-arm -machine virt -machine dumpdtb=qemu.dtb cat <(dtc -I dtb qemu.dtb) <(dtc -I dtb ./dts/dt.dtb | \ grep -v /dts-v1/) | dtc - -o merged.dtb qemu-system-arm -machine virt -nographic -bios u-boot.bin \ -dtb merged.dtb ``` For details please take reference on dt_qemu.rst
Signed-off-by: Raymond Mao raymond.mao@linaro.org --- Changes in v2 - Initial patch.
arch/arm/dts/qemu-arm64.dts | 4 ++ arch/arm/dts/smbios_generic.dtsi | 82 ++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 arch/arm/dts/smbios_generic.dtsi
diff --git a/arch/arm/dts/qemu-arm64.dts b/arch/arm/dts/qemu-arm64.dts index 096b3910728..95fcf53ed74 100644 --- a/arch/arm/dts/qemu-arm64.dts +++ b/arch/arm/dts/qemu-arm64.dts @@ -7,5 +7,9 @@
/dts-v1/;
+#if defined(CONFIG_SYSINFO_SMBIOS) && !defined(QFW_SMBIOS) +#include "smbios_generic.dtsi" +#endif + / { }; diff --git a/arch/arm/dts/smbios_generic.dtsi b/arch/arm/dts/smbios_generic.dtsi new file mode 100644 index 00000000000..c9f07283403 --- /dev/null +++ b/arch/arm/dts/smbios_generic.dtsi @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Default SMBIOS information for Arm64 platforms + * + * Copyright (c) 2024 Linaro Limited + * Author: Raymond Mao raymond.mao@linaro.org + */ +#include <config.h> +#include <smbios_def.h> + +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = CONFIG_SYS_VENDOR; + product = CONFIG_SYS_BOARD; + version = "Not Specified"; + serial = "Not Specified"; + wakeup-type = <SMBIOS_WAKEUP_TYPE_UNKNOWN>; + sku = "Not Specified"; + family = "armv8"; + }; + + baseboard { + manufacturer = CONFIG_SYS_VENDOR; + product = CONFIG_SYS_BOARD; + version = "Not Specified"; + serial = "Not Specified"; + asset-tag = "Not Specified"; + chassis-location = "Not Specified"; + feature-flags = <SMBIOS_BOARD_FEAT_HOST_BOARD>; + board-type = <SMBIOS_BOARD_TYPE_MOTHERBOARD>; + }; + + chassis { + manufacturer = CONFIG_SYS_VENDOR; + version = "Not Specified"; + serial = "Not Specified"; + asset-tag = "Not Specified"; + chassis-type = <SMBIOS_ENCLOSURE_DESKTOP>; + bootup-state = <SMBIOS_STATE_SAFE>; + power-supply-state = <SMBIOS_STATE_SAFE>; + thermal-state = <SMBIOS_STATE_SAFE>; + security-status = <SMBIOS_SECURITY_NONE>; + oem-defined = <SMBIOS_ENCLOSURE_OEM_UND>; + height = <SMBIOS_ENCLOSURE_HEIGHT_UND>; + number-of-power-cords = <SMBIOS_POWCORD_NUM_UND>; + }; + + processor { + version = "Not Specified"; + processor-type = <SMBIOS_PROCESSOR_TYPE_CENTRAL>; + processor-status = <SMBIOS_PROCESSOR_STATUS_ENABLED>; + upgrade = <SMBIOS_PROCESSOR_UPGRADE_NONE>; + family = <SMBIOS_PROCESSOR_FAMILY_EXT>; + family2 = <SMBIOS_PROCESSOR_FAMILY_ARMV8>; + socket-design = "Not Specified"; + serial = "Not Specified"; + asset-tag = "Not Specified"; + part-number = "Not Specified"; + }; + + cache { + l1-cache { + socket-design = "Not Specified"; + config = <(SMBIOS_CACHE_LEVEL_1 | + SMBIOS_CACHE_ENABLED | + SMBIOS_CACHE_OP_WB)>; + }; + + l2-cache { + socket-design = "Not Specified"; + config = <(SMBIOS_CACHE_LEVEL_2 | + SMBIOS_CACHE_ENABLED | + SMBIOS_CACHE_OP_WB)>; + }; + }; + }; + }; +};