Skip to contentSkip to conversation

Use zImage for Wandboard

PATCH Applied John Weber 2 participants 5 messages Dec 31, 2013

lore
Share & tools
lore

John Weber

author
#0 lore raw

cover Use zImage for Wandboard

These two patches go together. The first one changes KERNEL_IMAGETYPE to zImage. This causes the kernel build to produce and install a zImage rather than a uImage (U-boot formatted kernel image). uImage requires that LOADADDR be assigned during kernel build, and that it be the same as the default loadaddr in the u-boot environment. This change simplifies the process by reducing the need for LOADADDR entirely, allowing u-boot to load zImage anywhere.

The second patch changes the default u-boot environment to use zImage via a bbappend and patch to u-boot-fslc.

These have been tested to work with 3.0.35 kernels, as well as 3.10.17 kernels with flattened device trees.

John Weber (2):
wandboard: Set KERNEL_IMAGETYPE to zImage
u-boot-fslc: make wandboard use zImage by default

 conf/machine/include/wandboard.inc                 |    2 +
 ...ard-Set-default-environment-to-use-zImage.patch |   95 ++++++++++++++++++++
 recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend    |    6 ++
 3 files changed, 103 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
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/2 wandboard: Set KERNEL_IMAGETYPE to zImage

---
 conf/machine/include/wandboard.inc |    2 ++
 1 file changed, 2 insertions(+)
conf/machine/include/wandboard.inc +2 -0
index 5e83ad5..03d350d 100644
@@ -8,3 +8,5 @@ PREFERRED_PROVIDER_virtual/kernel ?= "linux-wandboard"
 SERIAL_CONSOLE = "115200 ttymxc0"
 
 MACHINE_FEATURES += "pci touchscreen"
+
+KERNEL_IMAGETYPE = "zImage"
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [meta-fsl-arm-extra][PATCH 1/2] wandboard: Set KERNEL_IMAGETYPE to zImage

Quoted 2 lines · John Weber

Queued in my tree.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
author
#3 lore raw

PATCH 2/2 u-boot-fslc: make wandboard use zImage by default

In reply to John Weber

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.

---
 ...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
recipes-bsp/u-boot/u-boot-fslc/0001-wandboard-Set-default-environment-to-use-zImage.patch new file +95 -0
new file mode 100644
index 0000000..3b8b71a
@@ -0,0 +1,95 @@
+From c41e1f6ac541aa5c76328633b7776241e57d8fdd Mon Sep 17 00:00:00 2001
+From: John Weber <[email protected]>
+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 <[email protected]>
+---
+ 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
+
recipes-bsp/u-boot/u-boot-fslc_2013.10.bbappend new file +6 -0
new file mode 100644
index 0000000..3ff3fc8
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " \
+   file://0001-wandboard-Set-default-environment-to-use-zImage.patch \
+"
+
Signature · 1 line
1.7.9.5
#4 lore raw

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

Hello John,

Quoted 8 lines · John Weber

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.

Quoted 4 lines

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.

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.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750