summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDalon Westergreen <dalon.westergreen@intel.com>2017-01-20 15:39:43 -0800
committerKhem Raj <raj.khem@gmail.com>2017-01-20 18:33:21 -0800
commitff7b0dfbc38b609b2018a4481deb86dd5e98769f (patch)
tree7d59a7d0f0ec440ae118b0fc7deb7ed690147f71
parentaf1bfa9cecb0cc4d1134f59909bb4f741c17b1a7 (diff)
downloadmeta-altera-ff7b0dfbc38b609b2018a4481deb86dd5e98769f.tar.gz
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 Initially add de0-nano-soc environment
-rw-r--r--classes/sdcard_image-socfpga.bbclass3
-rw-r--r--recipes-bsp/u-boot/u-boot-socfpga-env.inc7
-rw-r--r--recipes-bsp/u-boot/u-boot-socfpga_v2016.11.bb7
3 files changed, 11 insertions, 6 deletions
diff --git a/classes/sdcard_image-socfpga.bbclass b/classes/sdcard_image-socfpga.bbclass
index 8ac12b1..672ea6d 100644
--- a/classes/sdcard_image-socfpga.bbclass
+++ b/classes/sdcard_image-socfpga.bbclass
@@ -26,6 +26,7 @@ FAT_SPACE ?= "102400"
26 26
27# uBoot ENV offset 27# uBoot ENV offset
28SDIMG_UBOOT_ENV_OFFSET ?= "512" 28SDIMG_UBOOT_ENV_OFFSET ?= "512"
29ENV_BASE_NAME ??= "${UBOOT_CONFIG}"
29 30
30# Boot partition begin at sector 1024 31# Boot partition begin at sector 1024
31# This is required as for c5/a5 mainline uboot hard codes the location 32# This is required as for c5/a5 mainline uboot hard codes the location
@@ -173,7 +174,7 @@ IMAGE_CMD_socfpga-sdimg () {
173 fi 174 fi
174 175
175 if [ -e "${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin" ]; then 176 if [ -e "${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin" ]; then
176 dd if=${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin of=${SDIMG} bs=1 seek=${SDIMG_UBOOT_ENV_OFFSET} 177 dd if=${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin of=${SDIMG} conv=notrunc bs=1 seek=${SDIMG_UBOOT_ENV_OFFSET} && sync && sync
177 fi 178 fi
178 179
179} 180}
diff --git a/recipes-bsp/u-boot/u-boot-socfpga-env.inc b/recipes-bsp/u-boot/u-boot-socfpga-env.inc
index 55621b9..1798d27 100644
--- a/recipes-bsp/u-boot/u-boot-socfpga-env.inc
+++ b/recipes-bsp/u-boot/u-boot-socfpga-env.inc
@@ -10,13 +10,14 @@ ENV_BASE_NAME ??= "${UBOOT_CONFIG}"
10ENV_BASE_FILE = "${WORKDIR}/${ENV_BASE_NAME}.env" 10ENV_BASE_FILE = "${WORKDIR}/${ENV_BASE_NAME}.env"
11 11
12do_environment_mkimage() { 12do_environment_mkimage() {
13 if [ -e ${WORKDIR}/${PV}/${ENV_BASE_NAME}.env ]; then 13 if [ -e "${WORKDIR}/${ENV_BASE_NAME}.env" ]; then
14 mkenvimage -s ${ENV_SIZE} -o ${WORKDIR}/${ENV_BASE_NAME}.bin ${WORKDIR}/${PV}/${ENV_BASE_NAME}.env 14 mkenvimage -s ${ENV_SIZE} -o ${WORKDIR}/${ENV_BASE_NAME}.bin ${WORKDIR}/${ENV_BASE_NAME}.env
15 fi 15 fi
16} 16}
17 17
18do_deploy_append() { 18do_deploy_append() {
19 if [ -e ${WORKDIR}/${ENV_BASE_NAME}.bin]; then 19
20 if [ -e "${WORKDIR}/${ENV_BASE_NAME}.bin" ]; then
20 install -d ${DEPLOYDIR} 21 install -d ${DEPLOYDIR}
21 install -m 644 ${WORKDIR}/${ENV_BASE_NAME}.bin ${DEPLOYDIR}/u-boot-env-${ENV_BASE_NAME}.bin 22 install -m 644 ${WORKDIR}/${ENV_BASE_NAME}.bin ${DEPLOYDIR}/u-boot-env-${ENV_BASE_NAME}.bin
22 fi 23 fi
diff --git a/recipes-bsp/u-boot/u-boot-socfpga_v2016.11.bb b/recipes-bsp/u-boot/u-boot-socfpga_v2016.11.bb
index 356f88a..8dd0fc5 100644
--- a/recipes-bsp/u-boot/u-boot-socfpga_v2016.11.bb
+++ b/recipes-bsp/u-boot/u-boot-socfpga_v2016.11.bb
@@ -2,14 +2,17 @@ require u-boot-socfpga-common.inc
2require u-boot-socfpga-env.inc 2require u-boot-socfpga-env.inc
3require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc 3require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
4 4
5FILESEXTRAPATHS =. "files/v2016.11:"
6
5# This revision corresponds to the tag "v2016.11" 7# This revision corresponds to the tag "v2016.11"
6# We use the revision in order to avoid having to fetch it from the 8# We use the revision in order to avoid having to fetch it from the
7# repo during parse 9# repo during parse
8SRCREV = "29e0cfb4f77f7aa369136302cee14a91e22dca71" 10SRCREV = "29e0cfb4f77f7aa369136302cee14a91e22dca71"
9 11
12PR = "r1"
13
10SRC_URI_append = "\ 14SRC_URI_append = "\
11 file://v2016.11/de0-nano-soc.env \ 15 file://de0-nano-soc.env \
12 " 16 "
13PR = "r1"
14 17
15DEPENDS += "dtc-native" 18DEPENDS += "dtc-native"