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>
This commit is contained in:
Marek Vasut
2012-03-14 21:52:45 +00:00
committed by Wolfgang Denk
parent 1102d8d72a
commit 44f074c771
4 changed files with 172 additions and 10 deletions

View File

@@ -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 */