summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2012-03-14 21:52:45 +0000
committerWolfgang Denk <wd@denx.de>2012-03-30 22:58:55 +0200
commit44f074c771c4b70d250b0d7ed2f7513488c678bb (patch)
treea221e090d7b40f9a35bb35ced1eecd27b512063e /arch/arm/lib
parent1102d8d72afab0151123812dd227d2c2b6291cb3 (diff)
downloadu-boot-imx-44f074c771c4b70d250b0d7ed2f7513488c678bb.zip
u-boot-imx-44f074c771c4b70d250b0d7ed2f7513488c678bb.tar.gz
u-boot-imx-44f074c771c4b70d250b0d7ed2f7513488c678bb.tar.bz2
BOOT: Add "bootz" command to boot Linux zImage on ARM
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported. Tested on i.MX28 based DENX M28EVK Tested on PXA270 based Voipac PXA270. NOTE: This currently only supports ARM, but other architectures can be easily added by defining bootz_setup(). Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Warren <TWarren@nvidia.com> Cc: albert.u.boot@aribaud.net Cc: afleming@gmail.com, Cc: Simon Glass <sjg@chromium.org>, Cc: Stephen Warren <swarren@nvidia.com> Cc: Nicolas Pitre <nico@fluxnic.net> Cc: Wolfgang Denk <wd@denx.de> Cc: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/bootm.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 160ba55..1c1bee6 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -359,3 +359,33 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
boot_jump_linux(images);
return 0;
}
+
+#ifdef CONFIG_CMD_BOOTZ
+
+struct zimage_header {
+ uint32_t code[9];
+ uint32_t zi_magic;
+ uint32_t zi_start;
+ uint32_t zi_end;
+};
+
+#define LINUX_ARM_ZIMAGE_MAGIC 0x016f2818
+
+int bootz_setup(void *image, void **start, void **end)
+{
+ struct zimage_header *zi = (struct zimage_header *)image;
+
+ if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC) {
+ puts("Bad Linux ARM zImage magic!\n");
+ return 1;
+ }
+
+ *start = (void *)zi->zi_start;
+ *end = (void *)zi->zi_end;
+
+ debug("Kernel image @ 0x%08x [ 0x%08x - 0x%08x ]\n",
+ (uint32_t)image, (uint32_t)*start, (uint32_t)*end);
+
+ return 0;
+}
+#endif /* CONFIG_CMD_BOOTZ */