Patchwork [meta-fsl-arm-extra,2/2] u-boot-fslc: make wandboard use zImage by default

login
register
mail settings
Submitter John Weber
Date Dec. 31, 2013, 4:12 a.m.
Message ID <1388463161-17349-3-git-send-email-rjohnweber@gmail.com>
Download mbox | patch
Permalink /patch/63919/
State Superseded
Delegated to: Otavio Salvador
Headers show

Comments

John Weber - Dec. 31, 2013, 4:12 a.m.
Change the default environment to use zImage instead of uImage,
because using zImage does not require a LOADADDR assignment when
building the kernel to be consistent with the loadaddr environment
variable in u-boot, decreasing the chance for error.  This requires
changes to the default environment to load a file named zImage
instead of uImage, and to use the 'bootz' command instead of 'bootm'
when booting the kernel.

Also included in this patch is a change to fdt_addr to move it to
0x18000000, to avoid the space needed to load the kernel.

Signed-off-by: John Weber <rjohnweber@gmail.com>
---
 ...ard-Set-default-environment-to-use-zImage.patch |   95 ++++++++++++++++++++
 recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend    |    6 ++
 2 files changed, 101 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-fslc/0001-wandboard-Set-default-environment-to-use-zImage.patch
 create mode 100644 recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend
Otavio Salvador - Dec. 31, 2013, 11:21 p.m.
Hello John,

On Tue, Dec 31, 2013 at 2:12 AM, John Weber <rjohnweber@gmail.com> wrote:
> Change the default environment to use zImage instead of uImage,
> because using zImage does not require a LOADADDR assignment when
> building the kernel to be consistent with the loadaddr environment
> variable in u-boot, decreasing the chance for error.  This requires
> changes to the default environment to load a file named zImage
> instead of uImage, and to use the 'bootz' command instead of 'bootm'
> when booting the kernel.
>
> Also included in this patch is a change to fdt_addr to move it to
> 0x18000000, to avoid the space needed to load the kernel.
>
> Signed-off-by: John Weber <rjohnweber@gmail.com>

I have taken the patch you did and sent it to U-Boot mailing list.

I will await for a day for feedback and than push this to the github
repository; once I do it, I will send an update for the u-boot-fslc
recipe and this patch won't be need.

Your other patch to change the kernel image type will be applied
together with mine patch once I send it.

Patch

diff --git a/recipes-bsp/u-boot/u-boot-fslc/0001-wandboard-Set-default-environment-to-use-zImage.patch b/recipes-bsp/u-boot/u-boot-fslc/0001-wandboard-Set-default-environment-to-use-zImage.patch
new file mode 100644
index 0000000..3b8b71a
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-fslc/0001-wandboard-Set-default-environment-to-use-zImage.patch
@@ -0,0 +1,95 @@ 
+From c41e1f6ac541aa5c76328633b7776241e57d8fdd Mon Sep 17 00:00:00 2001
+From: John Weber <rjohnweber@gmail.com>
+Date: Mon, 30 Dec 2013 13:37:48 -0600
+Subject: [PATCH] wandboard: Set default environment to use zImage
+
+Upstream-Status: pending
+
+Signed-off-by: John Weber <rjohnweber@gmail.com>
+---
+ include/configs/wandboard.h |   22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
+index 442a984..7f702d9 100644
+--- a/include/configs/wandboard.h
++++ b/include/configs/wandboard.h
+@@ -107,13 +107,13 @@
+ 
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ 	"script=boot.scr\0" \
+-	"uimage=uImage\0" \
++	"image=zImage\0" \
+ 	"console=ttymxc0\0" \
+ 	"splashpos=m,m\0" \
+ 	"fdt_high=0xffffffff\0" \
+ 	"initrd_high=0xffffffff\0" \
+ 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+-	"fdt_addr=0x11000000\0" \
++	"fdt_addr=0x18000000\0" \
+ 	"boot_fdt=try\0" \
+ 	"ip_dyn=yes\0" \
+ 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+@@ -139,22 +139,22 @@
+ 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+ 	"bootscript=echo Running bootscript from mmc ...; " \
+ 		"source\0" \
+-	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
++	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+ 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+ 	"mmcboot=echo Booting from mmc ...; " \
+ 		"run mmcargs; " \
+ 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+ 			"if run loadfdt; then " \
+-				"bootm ${loadaddr} - ${fdt_addr}; " \
++				"bootz ${loadaddr} - ${fdt_addr}; " \
+ 			"else " \
+ 				"if test ${boot_fdt} = try; then " \
+-					"bootm; " \
++					"bootz; " \
+ 				"else " \
+ 					"echo WARN: Cannot load the DT; " \
+ 				"fi; " \
+ 			"fi; " \
+ 		"else " \
+-			"bootm; " \
++			"bootz; " \
+ 		"fi;\0" \
+ 	"netargs=setenv bootargs console=${console},${baudrate} " \
+ 		"root=/dev/nfs " \
+@@ -166,19 +166,19 @@
+ 		"else " \
+ 			"setenv get_cmd tftp; " \
+ 		"fi; " \
+-		"${get_cmd} ${uimage}; " \
++		"${get_cmd} ${image}; " \
+ 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+ 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+-				"bootm ${loadaddr} - ${fdt_addr}; " \
++				"bootz ${loadaddr} - ${fdt_addr}; " \
+ 			"else " \
+ 				"if test ${boot_fdt} = try; then " \
+-					"bootm; " \
++					"bootz; " \
+ 				"else " \
+ 					"echo WARN: Cannot load the DT; " \
+ 				"fi; " \
+ 			"fi; " \
+ 		"else " \
+-			"bootm; " \
++			"bootz; " \
+ 		"fi;\0"
+ 
+ #define CONFIG_BOOTCOMMAND \
+@@ -186,7 +186,7 @@
+ 		   "if run loadbootscript; then " \
+ 			   "run bootscript; " \
+ 		   "else " \
+-			   "if run loaduimage; then " \
++			   "if run loadimage; then " \
+ 				   "run mmcboot; " \
+ 			   "else run netboot; " \
+ 			   "fi; " \
+-- 
+1.7.9.5
+
diff --git a/recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend b/recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend
new file mode 100644
index 0000000..3ff3fc8
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend
@@ -0,0 +1,6 @@ 
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " \
+   file://0001-wandboard-Set-default-environment-to-use-zImage.patch \
+"
+