summaryrefslogtreecommitdiff
path: root/meta-aspeed
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2020-07-08 21:47:10 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-07-17 23:22:05 +0300
commit8d6b91c51d315883c446d4d11f538baeacb0bed7 (patch)
treeea17fc11ee0e52a48cfdf474aefdf02d2433cbd6 /meta-aspeed
parente477865c81b6f0eb9886c5368bbda73082d8bd9f (diff)
downloadopenbmc-8d6b91c51d315883c446d4d11f538baeacb0bed7.tar.xz
u-boot-aspeed: Generate default env for eMMC
Generate a default environment to boot an eMMC based on a txt file. Populate the generated environment image into the eMMC. (From meta-aspeed rev: fdc603c73b2dc8851ce2d1684e9c71a5ce51a5b8) Change-Id: I93944b183b7907202b02854e931593d62603ae77 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-aspeed')
-rw-r--r--meta-aspeed/conf/machine/include/aspeed.inc5
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2600.txt9
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb14
-rw-r--r--meta-aspeed/wic/emmc-aspeed.wks.in2
4 files changed, 28 insertions, 2 deletions
diff --git a/meta-aspeed/conf/machine/include/aspeed.inc b/meta-aspeed/conf/machine/include/aspeed.inc
index c3c5f18c2..046553b16 100644
--- a/meta-aspeed/conf/machine/include/aspeed.inc
+++ b/meta-aspeed/conf/machine/include/aspeed.inc
@@ -14,7 +14,10 @@ INITRAMFS_IMAGE ?= "aspeed-image-initramfs"
INITRAMFS_FSTYPES ?= "cpio.xz"
WKS_FILE ?= "emmc-aspeed.wks.in"
-WKS_FILE_DEPENDS ?= "virtual/kernel"
+WKS_FILE_DEPENDS ?= " \
+ virtual/bootloader \
+ virtual/kernel \
+"
WKS_HOSTFW_SIZE ?= "5G"
IMAGE_BOOT_FILES ?= "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE};fitImage"
diff --git a/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2600.txt b/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2600.txt
new file mode 100644
index 000000000..47a474c92
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2600.txt
@@ -0,0 +1,9 @@
+bootargs=console=ttyS4,115200n8
+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=if test "${bootside}" = "b"; then run bootb; run boota; else run boota; run bootb; fi
+bootdelay=2
+bootside=a
+loadaddr=0x83000000
+rootfs=rofs-a
+setmmcargs=setenv bootargs ${bootargs} rootwait root=PARTLABEL=${rootfs}
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb
index 3ecd17ce6..99bcafc09 100644
--- a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb
@@ -6,3 +6,17 @@ require u-boot-aspeed.inc
PROVIDES += "u-boot"
DEPENDS += "bc-native dtc-native"
+
+SRC_URI_append_df-phosphor-mmc = " file://u-boot-env-ast2600.txt"
+
+UBOOT_ENV_SIZE_df-phosphor-mmc = "0x10000"
+UBOOT_ENV_df-phosphor-mmc = "u-boot-env"
+UBOOT_ENV_SUFFIX_df-phosphor-mmc = "bin"
+
+do_compile_append() {
+ if [ -n "${UBOOT_ENV}" ]
+ then
+ # Generate redundant environment image
+ ${B}/tools/mkenvimage -r -s ${UBOOT_ENV_SIZE} -o ${WORKDIR}/${UBOOT_ENV_BINARY} ${WORKDIR}/u-boot-env-ast2600.txt
+ fi
+}
diff --git a/meta-aspeed/wic/emmc-aspeed.wks.in b/meta-aspeed/wic/emmc-aspeed.wks.in
index 816352176..ace5f47af 100644
--- a/meta-aspeed/wic/emmc-aspeed.wks.in
+++ b/meta-aspeed/wic/emmc-aspeed.wks.in
@@ -21,7 +21,7 @@
bootloader --ptable gpt
-part --align 4 --fixed-size 1M --label u-boot-env
+part --align 4 --fixed-size 1M --source rawcopy --sourceparams="file=${DEPLOY_DIR_IMAGE}/u-boot-env.bin"
part --fstype=ext4 --fixed-size 64M --source bootimg-partition --label boot-a
part --fstype=ext4 --fixed-size 64M --source bootimg-partition --label boot-b
part --fstype=ext4 --fixed-size 1G --source rootfs --label rofs-a