[meta-xilinx] [U-BOOT PATCH] zynq_common: Add uEnv.txt boot environment load support
Nathan Rossi
nathan.rossi at xilinx.com
Thu Aug 29 23:13:15 PDT 2013
Add support for using a uEnv.txt file for loading and or modifying the
existing boot environment during a Zynq "sdboot". If the environment
fails to load during the "sdboot" continue booting from SD normally.
This uEnv.txt and bootenv/uenv default environment variables are based
on the implementation used in omap3_beagle.h.
Signed-off-by: Nathan Rossi <nathan.rossi at xilinx.com>
---
Hi All,
This is a feature that has been requested by some users of the meta-xilinx
layer. It is the additional of an optional 'uEnv.txt' boot environment file
which allows the modification of the SD boot. It is very useful for development
purposes and also in production environments. (There are also some specific
development boards that would greatly benefit from this, specifcally the
Parallella board which cannot directly boot from SD card due to its use of SD_1
instead of SD_0, this would make boot environment modifications significantly
easier)
Philip has done an initial implementation of this feature see:
https://github.com/balister/meta-xilinx/commit/8b66cb1edb65c34c332888e907aec4333422af6b#L1R1
However I would like to see this accepted into the u-boot-xlnx for the next
release. So I have reworked Philip's initial implementation (based on some
comments from Michal).
When this is accepted into the master-next branch of u-boot-xlnx I will backport
it for use in the Yocto meta-xilinx layer.
Regards,
Nathan
---
include/configs/zynq_common.h | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/include/configs/zynq_common.h b/include/configs/zynq_common.h
index 762aaca..a7cadc4 100644
--- a/include/configs/zynq_common.h
+++ b/include/configs/zynq_common.h
@@ -237,11 +237,16 @@
"devicetree_image=devicetree.dtb\0" \
"bitstream_image=system.bit.bin\0" \
"loadbit_addr=0x100000\0" \
+ "loadbootenv_addr=0x2000000\0" \
"kernel_size=0x500000\0" \
"devicetree_size=0x20000\0" \
"ramdisk_size=0x5E0000\0" \
"fdt_high=0x20000000\0" \
"initrd_high=0x20000000\0" \
+ "bootenv=uEnv.txt\0" \
+ "loadbootenv=fatload mmc 0 ${loadbootenv_addr} ${bootenv}\0" \
+ "importbootenv=echo Importing environment from SD ...; " \
+ "env import -t ${loadbootenv_addr} $filesize\0" \
"mmc_loadbit_fat=echo Loading bitstream from SD/MMC/eMMC to RAM.. && " \
"mmcinfo && " \
"fatload mmc 0 ${loadbit_addr} ${bitstream_image} && " \
@@ -259,12 +264,23 @@
"echo Copying ramdisk... && " \
"sf read 0x2000000 0x620000 ${ramdisk_size} && " \
"bootm 0x3000000 0x2000000 0x2A00000\0" \
- "sdboot=echo Copying Linux from SD to RAM... && " \
- "mmcinfo && " \
- "fatload mmc 0 0x3000000 ${kernel_image} && " \
- "fatload mmc 0 0x2A00000 ${devicetree_image} && " \
- "fatload mmc 0 0x2000000 ${ramdisk_image} && " \
- "bootm 0x3000000 0x2000000 0x2A00000\0" \
+ "uenvboot=" \
+ "if run loadbootenv; then " \
+ "echo Loaded environment from ${bootenv}; " \
+ "run importbootenv; " \
+ "fi; " \
+ "if test -n $uenvcmd; then " \
+ "echo Running uenvcmd ...; " \
+ "run uenvcmd; " \
+ "fi\0" \
+ "sdboot=if mmcinfo; then " \
+ "run uenvboot; " \
+ "echo Copying Linux from SD to RAM... && " \
+ "fatload mmc 0 0x3000000 ${kernel_image} && " \
+ "fatload mmc 0 0x2A00000 ${devicetree_image} && " \
+ "fatload mmc 0 0x2000000 ${ramdisk_image} && " \
+ "bootm 0x3000000 0x2000000 0x2A00000; " \
+ "fi\0" \
"nandboot=echo Copying Linux from NAND flash to RAM... && " \
"nand read 0x3000000 0x100000 ${kernel_size} && " \
"nand read 0x2A00000 0x600000 ${devicetree_size} && " \
--
1.7.9.5
More information about the meta-xilinx
mailing list