diff options
| author | Vince Chang <vince_chang@aspeedtech.com> | 2026-07-27 05:53:52 +0300 |
|---|---|---|
| committer | Tan Siewert <tan@siewert.io> | 2026-11-13 16:06:47 +0300 |
| commit | bf948c92803d9347f2c1894abfd53f7bfa1496a9 (patch) | |
| tree | 7955d617d4b8e2b1c34e7fcb521c2caf5ee697cd /meta-aspeed | |
| parent | ef2b91ebec1b3bcb57011704bb44c7e33c13b169 (diff) | |
| download | openbmc-3.2.0-dev.tar.xz | |
meta-aspeed: Add u-boot-aspeed 2026.10 for AST27003.2.0-dev
1. Add the OpenBMC U-Boot 2026.10 recipe.
2. Add env files for build AST2700 UFS/eMMC.
3. Add fw_env_ast2700_nor.config to remove the sector size for
libubootenv.
Change-Id: Iaba3b409b7ae10ecc6858230404d1b90a20e61af
Signed-off-by: Vince Chang <vince_chang@aspeedtech.com>
Diffstat (limited to 'meta-aspeed')
7 files changed, 114 insertions, 0 deletions
diff --git a/meta-aspeed/conf/machine/include/ast2700.inc b/meta-aspeed/conf/machine/include/ast2700.inc index 6b2e7c2bab..9c8ccd7fc3 100644 --- a/meta-aspeed/conf/machine/include/ast2700.inc +++ b/meta-aspeed/conf/machine/include/ast2700.inc @@ -1,5 +1,15 @@ SOC_FAMILY = "aspeed-g7" include conf/machine/include/soc-family.inc + +# U-Boot Settings before aspeed.inc +PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-aspeed" +PREFERRED_PROVIDER_u-boot ?= "u-boot-aspeed" +PREFERRED_VERSION_u-boot-aspeed ?= "2026.10" + +# fw_printenv/fw_setenv are provided by libubootenv; the fw_env.config +# is installed by the libubootenv bbappend in meta-aspeed. +PREFERRED_PROVIDER_u-boot-fw-utils ?= "libubootenv" + require conf/machine/include/aspeed.inc DEFAULTTUNE = "cortexa35" diff --git a/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2700_nor.config b/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2700_nor.config new file mode 100644 index 0000000000..5f52d9a304 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2700_nor.config @@ -0,0 +1,2 @@ +# MTD device name Device offset Env. size +/dev/mtd/u-boot-env 0x0000 0x20000 diff --git a/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2700_ufs.config b/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2700_ufs.config new file mode 100644 index 0000000000..c8f6be944d --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2700_ufs.config @@ -0,0 +1,3 @@ +# Device name Device offset Env. size +/dev/disk/by-partlabel/primary 0x00000 0x10000 +/dev/disk/by-partlabel/primary 0x10000 0x10000 diff --git a/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2700-ufs.txt b/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2700-ufs.txt new file mode 100644 index 0000000000..4e9cdbdca7 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2700-ufs.txt @@ -0,0 +1,12 @@ +baudrate=115200 +bootargs=console=ttyS12,115200n8 root=/dev/ram rw earlycon +boota=setenv bootpart 2; setenv rootfs rofs-a; run setmmcargs; ext4load scsi 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image +bootb=setenv bootpart 3; setenv rootfs rofs-b; run setmmcargs; ext4load scsi 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image +bootcmd=run bootmmc +bootdelay=2 +bootmmc=if test "${bootside}" = "b"; then run bootb; run boota; else run boota; run bootb; fi +bootside=a +loadaddr=0x403000000 +rootfs=rofs-a +setmmcargs=setenv bootargs ${bootargs} rootwait root=PARTLABEL=${rootfs} +verify=yes diff --git a/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2700.txt b/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2700.txt new file mode 100644 index 0000000000..cadcab5f52 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2700.txt @@ -0,0 +1,12 @@ +baudrate=115200 +bootargs=console=ttyS12,115200n8 root=/dev/ram rw earlycon +boota=setenv bootpart 2; setenv rootfs rofs-a; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image +bootb=setenv bootpart 3; setenv rootfs rofs-b; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image +bootcmd=run bootmmc +bootdelay=2 +bootmmc=if test "${bootside}" = "b"; then run bootb; run boota; else run boota; run bootb; fi +bootside=a +loadaddr=0x403000000 +rootfs=rofs-a +setmmcargs=setenv bootargs ${bootargs} rootwait root=PARTLABEL=${rootfs} +verify=yes diff --git a/meta-aspeed/recipes-bsp/u-boot/libubootenv_%.bbappend b/meta-aspeed/recipes-bsp/u-boot/libubootenv_%.bbappend new file mode 100644 index 0000000000..c14a4bf952 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/libubootenv_%.bbappend @@ -0,0 +1,42 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +# The 32MB NOR, 64MB and 128MB NOR layouts use the same configuration +SRC_URI:append = " \ + file://fw_env_flash_nor.config \ + file://fw_env_ast2700_nor.config \ + file://fw_env_ast2600_mmc.config \ + file://fw_env_ast2700_ufs.config \ +" + +ENV_CONFIG_FILE = "fw_env_flash_nor.config" +ENV_CONFIG_FILE:aspeed-g7 = "fw_env_ast2700_nor.config" + +ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config" +ENV_CONFIG_FILE:df-phosphor-mmc:aspeed-g7 = "${@bb.utils.contains('MACHINE_FEATURES', 'mf-ufs', \ + 'fw_env_ast2700_ufs.config', 'fw_env_ast2600_mmc.config', d)}" + +do_install:append () { + install -d ${D}${sysconfdir} + install -m 644 ${UNPACKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config + + # Compatibility links: meta-phosphor hardcodes /sbin/fw_printenv and + # /sbin/fw_setenv (clear-once.service, phosphor-static-norootfs-init), + # matching the historical u-boot-fw-utils install path. . + install -d ${D}${base_sbindir} + ln -sr ${D}${bindir}/fw_printenv ${D}${base_sbindir}/fw_printenv + ln -sr ${D}${bindir}/fw_setenv ${D}${base_sbindir}/fw_setenv +} + +FILES:${PN}-bin:append = " \ + ${base_sbindir}/fw_printenv \ + ${base_sbindir}/fw_setenv \ +" + +# Install it with the tools so they can fall back when flash has no valid env. +RDEPENDS:${PN}-bin:append:aspeed-g7 = " u-boot-aspeed-env" + +# Pull in the tools and environment config together +RDEPENDS:${PN}:append = " ${PN}-bin" + +# fw_env.config is machine specific +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2026.10.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2026.10.bb new file mode 100644 index 0000000000..1ff7a33295 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2026.10.bb @@ -0,0 +1,33 @@ +require recipes-bsp/u-boot/u-boot-common.inc +require recipes-bsp/u-boot/u-boot.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +DEPENDS += "bc-native dtc-native gnutls-native python3-pyelftools-native" + +PROVIDES += "u-boot" + +# Install the default environment file expected by libubootenv. +UBOOT_INITIAL_ENV = "u-boot-initial-env" + +UBRANCH = "v2026.10-openbmc" +SRC_URI = "git://github.com/openbmc/u-boot.git;protocol=https;branch=${UBRANCH}" +SRCREV = "196cee41b40231fed472b52373ce1213d74287f3" + +UBOOT_ENV:df-phosphor-mmc = "u-boot-env" +UBOOT_ENV_SUFFIX:df-phosphor-mmc = "bin" +UBOOT_ENV_SRC:df-phosphor-mmc = "${UBOOT_ENV_TXT}" + +SRC_URI:append:df-phosphor-mmc:aspeed-g7 = " file://${UBOOT_ENV_TXT}" +UBOOT_ENV_SIZE:df-phosphor-mmc:aspeed-g7 = "0x20000" +UBOOT_ENV_TXT:df-phosphor-mmc:aspeed-g7 = "${@bb.utils.contains('MACHINE_FEATURES', 'mf-ufs', \ + 'u-boot-env-ast2700-ufs.txt', 'u-boot-env-ast2700.txt', d)}" + +do_compile:append() { + if [ -n "${UBOOT_ENV}" ] + then + # Generate default environment image + # add -r parameter if wants redundant environment image + ${B}/tools/mkenvimage -s ${UBOOT_ENV_SIZE} -o ${B}/${UBOOT_ENV_BINARY} ${UNPACKDIR}/${UBOOT_ENV_TXT} + fi +} |
