summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2016-07-12 20:28:14 +0200
committerTom Rini <trini@konsulko.com>2016-07-22 09:53:00 -0400
commit431889d6ad9a39846636716478d504aa7ff976fc (patch)
tree13351d0f1ecc3b96ab3d896b68c0322a95ea171b /common
parentbf55cd4f3e3bc0ebf92c81bde1921f983e999451 (diff)
spl: zImage support in Falcon mode
Other payload than uImage is currently considered to be raw U-Boot image. Check also for zImage in Falcon mode. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index e6a1d794255..b7ec333c8a5 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -56,6 +56,15 @@ __weak int spl_start_uboot(void)
puts("SPL: Direct Linux boot not active!\n");
return 1;
}
+
+/*
+ * Weak default function for arch specific zImage check. Return zero
+ * and fill start and end address if image is recognized.
+ */
+int __weak bootz_setup(ulong image, ulong *start, ulong *end)
+{
+ return 1;
+}
#endif
/*
@@ -124,6 +133,20 @@ int spl_parse_image_header(const struct image_header *header)
/* Signature not found, proceed to other boot methods. */
return -EINVAL;
#else
+#ifdef CONFIG_SPL_OS_BOOT
+ ulong start, end;
+
+ if (!bootz_setup((ulong)header, &start, &end)) {
+ spl_image.name = "Linux";
+ spl_image.os = IH_OS_LINUX;
+ spl_image.load_addr = CONFIG_SYS_LOAD_ADDR;
+ spl_image.entry_point = CONFIG_SYS_LOAD_ADDR;
+ spl_image.size = end - start;
+ debug("spl: payload zImage, load addr: 0x%x size: %d\n",
+ spl_image.load_addr, spl_image.size);
+ return 0;
+ }
+#endif
/* Signature not found - assume u-boot.bin */
debug("mkimage signature not found - ih_magic = %x\n",
header->ih_magic);