From fc318ea6caca66d71a8d6fe03f1bdb84b76715ef Mon Sep 17 00:00:00 2001 From: otomam <1020793665@qq.com> Date: Thu, 9 Jan 2025 12:29:26 +0800 Subject: [PATCH] obmc: Fix issues in boost and phosphor-hwmon; Add Aspeed 2600 evb support * boost need version 1.78.0 * after adjust download directory, phosphor-hwmon build failed, because systemd will scan source directory, change back to using git * support ast2600 to build obmc and simulate with qemu Signed-off-by: otomam --- .oebuild/manifest.yaml | 8 ++-- .oebuild/platform/ast2600.yaml | 22 +++++++++ bsp/meta-aspeed/conf/layer.conf | 14 ++++++ bsp/meta-aspeed/conf/machine/ast2600.conf | 45 ++++++++++++++++++ .../conf/machine/include/aspeed.inc | 46 +++++++++++++++++++ .../conf/machine/include/ast2600.inc | 9 ++++ .../sensor/phosphor-hwmon_%.bbappend | 12 ----- .../recipes-support/boost/boost_%.bbappend | 21 +++++---- 8 files changed, 152 insertions(+), 25 deletions(-) create mode 100644 .oebuild/platform/ast2600.yaml create mode 100644 bsp/meta-aspeed/conf/layer.conf create mode 100644 bsp/meta-aspeed/conf/machine/ast2600.conf create mode 100644 bsp/meta-aspeed/conf/machine/include/aspeed.inc create mode 100644 bsp/meta-aspeed/conf/machine/include/ast2600.inc delete mode 100644 meta-openeuler/dynamic-layers/phosphor-layer/recipes-phosphor/sensor/phosphor-hwmon_%.bbappend diff --git a/.oebuild/manifest.yaml b/.oebuild/manifest.yaml index 8b6589b68ac..c26a9c7767c 100644 --- a/.oebuild/manifest.yaml +++ b/.oebuild/manifest.yaml @@ -1968,9 +1968,6 @@ manifest_list: obmc-phosphor-power: remote_url: https://github.com/openbmc/phosphor-power-control.git version: ca9aa00180423b548369a7485bbca641581cc1ab - phosphor-hwmon: - remote_url: https://github.com/openbmc/phosphor-hwmon.git - version: 0bbd07c008404ed701b336d8a2b398407b908fe6 phosphor-inventory-manager: remote_url: https://github.com/openbmc/phosphor-inventory-manager.git version: 69ddaad8dfd1102e9bdd6437149e2a8397a1b558 @@ -2006,13 +2003,16 @@ manifest_list: version: 5411992a063c66652694b84d0b4e83fd29862e29 boost-obmc: remote_url: https://gitee.com/src-openeuler/boost.git - version: b98d772597a551bb10fa356b436b15b82f84ce3a + version: 8ab4fe722e8136317f6f9b370ff20af44f61c78d webui-vue: remote_url: https://github.com/openbmc/webui-vue.git version: 78372d6345cf5f1e04d6a8d56c416a7aec70b998 yocto-meta-phosphor: remote_url: https://gitee.com/openeuler/yocto-meta-phosphor.git version: ab20103918e68151d01de65eadd8cfb00b70ed68 + metaBMC: + remote_url: https://gitee.com/openeuler/MetaBMC.git + version: afbfd4fb279d35bc7194dc4a011e9ffc225070a7 i2c-tools: remote_url: https://gitee.com/src-openeuler/i2c-tools.git version: 0c606d9fef419621fee2cbb3ff7e78ec080ceca6 diff --git a/.oebuild/platform/ast2600.yaml b/.oebuild/platform/ast2600.yaml new file mode 100644 index 00000000000..69d5543b7c5 --- /dev/null +++ b/.oebuild/platform/ast2600.yaml @@ -0,0 +1,22 @@ +type: platform + +machine: ast2600 + +toolchain_type: EXTERNAL_TOOLCHAIN:arm + +repos: + - yocto-meta-phosphor + - metaBMC + +layers: + - yocto-meta-phosphor + - yocto-meta-openeuler/bsp/meta-aspeed + - metaBMC/meta-openeuler + - metaBMC/meta-aspeed + +local_conf: | + OPENEULER_PREBUILT_TOOLS_ENABLE = "no" + DISTRO_FEATURES:append = " obmc " + INIT_MANAGER = "systemd" + VIRTUAL-RUNTIME_dev_manager = "systemd" + ROOT_HOME = "/home/root" diff --git a/bsp/meta-aspeed/conf/layer.conf b/bsp/meta-aspeed/conf/layer.conf new file mode 100644 index 00000000000..2ebf5997ab5 --- /dev/null +++ b/bsp/meta-aspeed/conf/layer.conf @@ -0,0 +1,14 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH =. "${LAYERDIR}:" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "aspeed" +BBFILE_PATTERN_aspeed = "^${LAYERDIR}/" +# BBFILE_PRIORITY_aspeed = "10" + +LAYERVERSION_aspeed = "1" +LAYERDEPENDS_aspeed = "core" +LAYERSERIES_COMPAT_aspeed = "kirkstone" diff --git a/bsp/meta-aspeed/conf/machine/ast2600.conf b/bsp/meta-aspeed/conf/machine/ast2600.conf new file mode 100644 index 00000000000..909d027bd38 --- /dev/null +++ b/bsp/meta-aspeed/conf/machine/ast2600.conf @@ -0,0 +1,45 @@ +# PREFERRED_PROVIDER_virtual/kernel ?= "linux-aspeed" +KERNEL_DEVICETREE = "aspeed-ast2600-evb.dtb" + +UBOOT_MACHINE = "ast2600_openbmc_spl_defconfig" +UBOOT_DEVICETREE = "ast2600-evb" +SPL_BINARY = "spl/u-boot-spl.bin" +SOCSEC_SIGN_ENABLE = "0" +VOLATILE_LOG_DIR = "no" + +require conf/machine/include/ast2600.inc +require conf/machine/include/obmc-evb-common.inc + +SERIAL_CONSOLES = "115200;ttyS4" + +# AST2600 EVB has 64MB SPI flash +FLASH_SIZE = "65536" +# FLASH_SIZE = "131072" + +# FLASH_RWFS_OFFSET:flash-65536 ?= "43008" 文件系统大小超出,调整大小,对应修改设备树 +FLASH_RWFS_OFFSET:flash-65536 = "55296" + +# require conf/machine/include/qemu-arm-common.inc +#kernel modules to install and autoload +require conf/machine/include/kernel-modules-conf/common.inc +INSTALLMODULES += " \ +kernel-module-unix \ +" + +KERNEL_MODULE_AUTOLOAD = "${INSTALLMODULES}" +TUNE_FEATURES:append = " cortexa7" + +# 编译器不支持 DEFAULTTUNE:aspeed-g6 ?= "armv7ahf-vfpv4d16" +DEFAULTTUNE:aspeed-g6 = "armv7a" + +TUNE_CCARGS .= " -mno-unaligned-access" + +# require conf/machine/include/obmc-bsp-common.inc +KERNEL_CLASSES ?= "kernel-fitimage" +KERNEL_IMAGETYPES ?= "fitImage vmlinux" + +IMAGE_FSTYPES += "mtd-static mtd-static-tar mtd-static-alltar" +INITRAMFS_IMAGE = "obmc-phosphor-initramfs" + +INITRAMFS_CTYPE ?= "xz" +INITRAMFS_FSTYPES = "cpio.${INITRAMFS_CTYPE}" diff --git a/bsp/meta-aspeed/conf/machine/include/aspeed.inc b/bsp/meta-aspeed/conf/machine/include/aspeed.inc new file mode 100644 index 00000000000..f614b475c0c --- /dev/null +++ b/bsp/meta-aspeed/conf/machine/include/aspeed.inc @@ -0,0 +1,46 @@ +PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-aspeed-sdk" +PREFERRED_PROVIDER_u-boot ?= "u-boot-aspeed-sdk" +PREFERRED_PROVIDER_u-boot-fw-utils ?= "u-boot-fw-utils-aspeed-sdk" + +# Build a FIT image and stuff core-image-minimal in it by default. +KERNEL_IMAGETYPE ?= "fitImage" +KERNEL_CLASSES ?= "kernel-fitimage" + +WKS_FILE ?= "emmc-aspeed.wks.in" +WKS_FILE_DEPENDS ?= " \ + phosphor-hostfw-image \ + virtual/bootloader \ + virtual/kernel \ +" +WKS_HOSTFW_SIZE ?= "5G" +IMAGE_BOOT_FILES ?= "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE};fitImage" + +MACHINE_EXTRA_RRECOMMENDS += "udev-aspeed-vuart udev-aspeed-mtd-partitions" +MACHINE_FEATURES += "hw-rng" + +MACHINEOVERRIDES =. "aspeed:" + +SERIAL_CONSOLES ?= "115200;ttyS4" + +DEFAULTTUNE:aspeed-g6 ?= "armv7ahf-vfpv4d16" + +UBOOT_ENTRYPOINT:aspeed-g6 ?= "0x80001000" +UBOOT_LOADADDRESS:aspeed-g6 ?= "0x80001000" + +# runqemu support +# EXTRA_IMAGEDEPENDS += "qemu-helper-native" +# IMAGE_CLASSES += "qemuboot" +# QB_SYSTEM_NAME = "qemu-system-arm" +# QB_ROOTFS_OPT = "-drive file=@ROOTFS@,if=mtd,format=raw" +# QB_DEFAULT_FSTYPE = "static.mtd" +# # Disable virtio-pci device +# QB_RNG = "" +# QB_NETWORK_DEVICE = "-net nic" +# # Boot from drive +# QB_DEFAULT_KERNEL = "none" +# # runqemu overrides default memory size +# QB_MEM = "-m 512" + +# QB_MACHINE:aspeed-g6 = "-machine ast2600-evb" +# QB_MEM:aspeed-g6 = "-m 1G" +# QB_SLIRP_OPT:aspeed-g6 = "-netdev user,id=net0,hostfwd=tcp::2222-:22,hostfwd=tcp::2443-:443" diff --git a/bsp/meta-aspeed/conf/machine/include/ast2600.inc b/bsp/meta-aspeed/conf/machine/include/ast2600.inc new file mode 100644 index 00000000000..1e5e1f8fe8b --- /dev/null +++ b/bsp/meta-aspeed/conf/machine/include/ast2600.inc @@ -0,0 +1,9 @@ +SOC_FAMILY = "aspeed-g6" + +# Enable SPL signing by default +SOCSEC_SIGN_ENABLE ?= "1" +SOCSEC_SIGN_SOC ?= "2600" + +include conf/machine/include/soc-family.inc +require conf/machine/include/aspeed.inc +include conf/machine/include/arm/arch-armv7a.inc diff --git a/meta-openeuler/dynamic-layers/phosphor-layer/recipes-phosphor/sensor/phosphor-hwmon_%.bbappend b/meta-openeuler/dynamic-layers/phosphor-layer/recipes-phosphor/sensor/phosphor-hwmon_%.bbappend deleted file mode 100644 index 85561f7b219..00000000000 --- a/meta-openeuler/dynamic-layers/phosphor-layer/recipes-phosphor/sensor/phosphor-hwmon_%.bbappend +++ /dev/null @@ -1,12 +0,0 @@ - -# we do not use git to download the source code -# so the variable ${SRCPV} is not set -# remove this variable from ${PV} -PV = "1.0" - -SRC_URI += " \ - file://${BPN} \ -" - -# the source code repository fetched by openeuler_fetch -S = "${WORKDIR}/${BPN}" diff --git a/meta-openeuler/dynamic-layers/phosphor-layer/recipes-support/boost/boost_%.bbappend b/meta-openeuler/dynamic-layers/phosphor-layer/recipes-support/boost/boost_%.bbappend index 0262760ec45..d34cfc9400d 100644 --- a/meta-openeuler/dynamic-layers/phosphor-layer/recipes-support/boost/boost_%.bbappend +++ b/meta-openeuler/dynamic-layers/phosphor-layer/recipes-support/boost/boost_%.bbappend @@ -1,19 +1,22 @@ # main bbfile: meta/recipes-support/boost/boost_1.78.0.bb -PV = "1.83.0" +PV = "1.78.0" # modify 0001-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" # since OpenBMC must use version 1.78.0 -SRC_URI = "file://${BOOST_P}.tar.gz \ - file://boost-1.81-graph-Dont-run-performance-test-in-CI.patch \ - file://boost-1.81-random-Update-multiprecision_float_test.cpp-to-not-overflow.patch \ - file://boost-1.81-random-Update-multiprecision_int_test.cpp-to-not-accidental.patch \ - file://boost-1.81-random-test-Add-missing-includes.patch \ - file://boost-1.81-phoenix-Update-avoid-placeholders-uarg1.10-ODR-violates.patch \ -" +SRC_URI = " \ + file://${BOOST_P}.tar.gz \ + file://boost-1.78-pool-fix-integer-overflows-in-pool-ordered_malloc.patch \ + file://boost-1.78-locale-Fix-access-to-first-element-of-empty-vector.patch \ + file://boost-1.77-type_erasure-remove-boost-system-linkage.patch \ + file://boost-1.78-build-Don-t-skip-install-targets-if-there-s-build-no-in-ureqs.patch \ + file://boost-1.78-filesystem-Added-protection-for-CVE-2022-21658.patch \ + file://boost-1.78-filesystem-Use-O_NONBLOCK-instead-of-O_NDELAY.patch \ + file://boost-1.78-python-Update-call_method-hpp.patch \ + " -SRC_URI[sha256sum] = "c0685b68dd44cc46574cce86c4e17c0f611b15e195be9848dfd0769a0a207628" +SRC_URI[sha256sum] = "205666dea9f6a7cfed87c7a6dfbeb52a2c1b9de55712c9c1a87735d7181452b6" S = "${WORKDIR}/${BOOST_P}" -- Gitee