summaryrefslogtreecommitdiff
path: root/common/image-fit.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-19 21:11:24 -0600
committerSimon Glass <sjg@chromium.org>2014-10-22 09:03:06 -0600
commit90268b878bd830f2fc9b1e225d96009efe331cd1 (patch)
tree680cddba7c37d284971ff23d0b4b66611b4cf019 /common/image-fit.c
parent381197788dbf8bb94f96ec9e03b6b81618187260 (diff)
x86: Support loading kernel setup from a FIT
Add a new setup@ section to the FIT which can be used to provide a setup binary for booting Linux on x86. This makes it possible to boot x86 from a FIT. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/image-fit.c')
-rw-r--r--common/image-fit.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/image-fit.c b/common/image-fit.c
index 2b9e71a8dc..2016d1e7dd 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1497,6 +1497,8 @@ static const char *fit_get_image_type_property(int type)
return FIT_KERNEL_PROP;
case IH_TYPE_RAMDISK:
return FIT_RAMDISK_PROP;
+ case IH_TYPE_X86_SETUP:
+ return FIT_SETUP_PROP;
}
return "unknown";
@@ -1693,3 +1695,23 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
return noffset;
}
+
+int boot_get_setup_fit(bootm_headers_t *images, uint8_t arch,
+ ulong *setup_start, ulong *setup_len)
+{
+ int noffset;
+ ulong addr;
+ ulong len;
+ int ret;
+
+ addr = map_to_sysmem(images->fit_hdr_os);
+ noffset = fit_get_node_from_config(images, FIT_SETUP_PROP, addr);
+ if (noffset < 0)
+ return noffset;
+
+ ret = fit_image_load(images, addr, NULL, NULL, arch,
+ IH_TYPE_X86_SETUP, BOOTSTAGE_ID_FIT_SETUP_START,
+ FIT_LOAD_REQUIRED, setup_start, &len);
+
+ return ret;
+}