From 9de803be49cd866de93ac9cdc0f0539f52d71d8b Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Thu, 5 Sep 2013 16:40:41 +1000 Subject: u-boot-xlnx: Add uEnv.txt support * Backport uEnv.txt support from upstream master-next Signed-off-by: Nathan Rossi --- .../zynq-Increase-number-of-arguments.patch | 29 +++++++++ ...-Add-uEnv.txt-boot-environment-load-suppo.patch | 72 ++++++++++++++++++++++ recipes-bsp/u-boot/u-boot-xlnx_2013.01.bb | 13 ++-- recipes-bsp/u-boot/u-boot-xlnx_2013.07.bb | 5 ++ 4 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 recipes-bsp/u-boot/u-boot-xlnx/zynq-Increase-number-of-arguments.patch create mode 100644 recipes-bsp/u-boot/u-boot-xlnx/zynq_common-Add-uEnv.txt-boot-environment-load-suppo.patch diff --git a/recipes-bsp/u-boot/u-boot-xlnx/zynq-Increase-number-of-arguments.patch b/recipes-bsp/u-boot/u-boot-xlnx/zynq-Increase-number-of-arguments.patch new file mode 100644 index 00000000..22c9fb67 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-xlnx/zynq-Increase-number-of-arguments.patch @@ -0,0 +1,29 @@ +From: Michal Simek +Date: Wed, 4 Sep 2013 08:59:37 +0200 +Subject: [PATCH] zynq: Increase number of arguments + +The main reason is that with adding option to load +variables from SD user can create longer user commands. + +Signed-off-by: Michal Simek +Upstream-Status: Backport +--- + include/configs/zynq_common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/configs/zynq_common.h b/include/configs/zynq_common.h +index a7cadc4..e83c6de 100644 +--- a/include/configs/zynq_common.h ++++ b/include/configs/zynq_common.h +@@ -105,7 +105,7 @@ + #define CONFIG_AUTO_COMPLETE + #define CONFIG_SYS_LONGHELP + #define CONFIG_BOARD_LATE_INIT +-#define CONFIG_SYS_MAXARGS 16 ++#define CONFIG_SYS_MAXARGS 32 + #define CONFIG_SYS_CBSIZE 2048 + #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) +-- +1.7.9.5 + diff --git a/recipes-bsp/u-boot/u-boot-xlnx/zynq_common-Add-uEnv.txt-boot-environment-load-suppo.patch b/recipes-bsp/u-boot/u-boot-xlnx/zynq_common-Add-uEnv.txt-boot-environment-load-suppo.patch new file mode 100644 index 00000000..d0c3d3e6 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-xlnx/zynq_common-Add-uEnv.txt-boot-environment-load-suppo.patch @@ -0,0 +1,72 @@ +From: Nathan Rossi +Date: Fri, 30 Aug 2013 16:13:15 +1000 +Subject: [PATCH] zynq_common: Add uEnv.txt boot environment load support + +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 +Signed-off-by: Michal Simek +Upstream-Status: Backport +--- + 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 + diff --git a/recipes-bsp/u-boot/u-boot-xlnx_2013.01.bb b/recipes-bsp/u-boot/u-boot-xlnx_2013.01.bb index 9e4036cc..8239c46e 100644 --- a/recipes-bsp/u-boot/u-boot-xlnx_2013.01.bb +++ b/recipes-bsp/u-boot/u-boot-xlnx_2013.01.bb @@ -8,9 +8,10 @@ PR = "r1" include u-boot-xlnx.inc -SRC_URI += " \ - file://microblaze_bootm_Add_support_for_loading_initrd.patch \ - file://microblaze_bootm_Fix_coding_style_issues.patch \ - file://microblaze_Fix_coding_style_for_bootb.patch \ - " - +SRC_URI_append += " \ + file://microblaze_bootm_Add_support_for_loading_initrd.patch \ + file://microblaze_bootm_Fix_coding_style_issues.patch \ + file://microblaze_Fix_coding_style_for_bootb.patch \ + file://zynq_common-Add-uEnv.txt-boot-environment-load-suppo.patch \ + file://zynq-Increase-number-of-arguments.patch \ + " diff --git a/recipes-bsp/u-boot/u-boot-xlnx_2013.07.bb b/recipes-bsp/u-boot/u-boot-xlnx_2013.07.bb index af0b459e..8ec99eb0 100644 --- a/recipes-bsp/u-boot/u-boot-xlnx_2013.07.bb +++ b/recipes-bsp/u-boot/u-boot-xlnx_2013.07.bb @@ -5,3 +5,8 @@ PV = "v2013.07${XILINX_EXTENSION}+git${SRCPV}" PR = "r1" include u-boot-xlnx.inc + +SRC_URI_append += " \ + file://zynq_common-Add-uEnv.txt-boot-environment-load-suppo.patch \ + file://zynq-Increase-number-of-arguments.patch \ + " -- cgit v1.2.3-54-g00ecf