summaryrefslogtreecommitdiffstats
path: root/arch/kvx/lib/bootm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/kvx/lib/bootm.c')
-rw-r--r--arch/kvx/lib/bootm.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/arch/kvx/lib/bootm.c b/arch/kvx/lib/bootm.c
index 4d17e1846d..4c77f676ec 100644
--- a/arch/kvx/lib/bootm.c
+++ b/arch/kvx/lib/bootm.c
@@ -17,7 +17,6 @@
#include <linux/kernel.h>
#include <asm/cache.h>
-#include <asm/bootm.h>
typedef void __noreturn (*boot_func_entry)(unsigned long, void *);
@@ -95,7 +94,7 @@ static int do_boot_elf(struct image_data *data, struct elf_image *elf)
goto err_free_fdt;
}
- entry = (boot_func_entry) data->os_address;
+ entry = (boot_func_entry) elf->entry;
ret = do_boot_entry(data, entry, fdt);
@@ -105,6 +104,27 @@ err_free_fdt:
return ret;
}
+static int do_bootm_fit(struct image_data *data)
+{
+ int ret;
+ struct elf_image *elf;
+
+ elf = elf_open_binary((void *) data->fit_kernel);
+ if (IS_ERR(elf))
+ return PTR_ERR(data->elf);
+
+ ret = elf_load(elf);
+ if (ret)
+ goto close_elf;
+
+ ret = do_boot_elf(data, elf);
+
+close_elf:
+ elf_close(elf);
+
+ return ret;
+}
+
static int do_bootm_elf(struct image_data *data)
{
int ret;
@@ -122,6 +142,12 @@ static struct image_handler elf_handler = {
.filetype = filetype_elf,
};
+static struct image_handler fit_handler = {
+ .name = "FIT",
+ .bootm = do_bootm_fit,
+ .filetype = filetype_oftree,
+};
+
static struct binfmt_hook binfmt_elf_hook = {
.type = filetype_elf,
.exec = "bootm",
@@ -131,6 +157,9 @@ static int kvx_register_image_handler(void)
{
register_image_handler(&elf_handler);
+ if (IS_ENABLED(CONFIG_FITIMAGE))
+ register_image_handler(&fit_handler);
+
binfmt_register(&binfmt_elf_hook);
return 0;