From fb8728b073ffca2acc0bdaf7f76c3a7c7b8073dc Mon Sep 17 00:00:00 2001 From: Dalon Westergreen Date: Fri, 20 Jan 2017 15:39:43 -0800 Subject: add support to generate uboot environment images create uboot environment images to populate the sdcard images. This allows non-default uboot environments to be used without the need for changing / patching uboot --- classes/sdcard_image-socfpga.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/sdcard_image-socfpga.bbclass b/classes/sdcard_image-socfpga.bbclass index 879c2c1..8ac12b1 100644 --- a/classes/sdcard_image-socfpga.bbclass +++ b/classes/sdcard_image-socfpga.bbclass @@ -24,6 +24,9 @@ BOOT_SPACE ?= "2048" # Fat partition size FAT_SPACE ?= "102400" +# uBoot ENV offset +SDIMG_UBOOT_ENV_OFFSET ?= "512" + # Boot partition begin at sector 1024 # This is required as for c5/a5 mainline uboot hard codes the location # of the uboot image in the sdcard to 0xa00 sector @@ -167,6 +170,10 @@ IMAGE_CMD_socfpga-sdimg () { dd if=${DEPLOY_DIR_IMAGE}/${SPL_BINARY} of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync else bbfatal "${SPL_BINARY} does not exist." - fi + fi + + if [ -e "${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin" ]; then + dd if=${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin of=${SDIMG} bs=1 seek=${SDIMG_UBOOT_ENV_OFFSET} + fi } -- cgit v1.2.3-54-g00ecf