summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib32
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-07-09 08:21:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-07-09 08:21:15 +0200
commit64c720391a0c127dba33d1ae8aeba30b6a3c692d (patch)
tree1784bd58f6c7eb673cf10a1962214a39e2a87057 /arch/arm/lib32
parent1073955aa5fb777381de710ad314cdbf68fef189 (diff)
parent3fc9db5d2aa58e057e28f86a195077afd9e2bcf4 (diff)
downloadbarebox-64c720391a0c127dba33d1ae8aeba30b6a3c692d.tar.gz
barebox-64c720391a0c127dba33d1ae8aeba30b6a3c692d.tar.xz
Merge branch 'for-next/kill-oftree-f'
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib32')
-rw-r--r--arch/arm/lib32/bootm.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c
index b1ac2df731..63713acf59 100644
--- a/arch/arm/lib32/bootm.c
+++ b/arch/arm/lib32/bootm.c
@@ -26,6 +26,9 @@
#include <asm/armlinux.h>
#include <asm/system.h>
+/* If true, ignore device tree and boot with ATAGs */
+static int bootm_boot_atag;
+
/*
* sdram_start_and_size() - determine place for putting the kernel/oftree/initrd
*
@@ -165,7 +168,12 @@ static int __do_bootm_linux(struct image_data *data, unsigned long free_mem,
free_mem = PAGE_ALIGN(initrd_end + 1);
}
- if (!fdt) {
+ if (fdt && bootm_boot_atag) {
+ printf("Error: Boot with ATAGs forced, but kernel has an appended device tree\n");
+ return -EINVAL;
+ }
+
+ if (!fdt && !bootm_boot_atag) {
fdt = bootm_get_devicetree(data);
if (IS_ERR(fdt))
return PTR_ERR(fdt);
@@ -612,8 +620,13 @@ static struct binfmt_hook binfmt_barebox_hook = {
.exec = "bootm",
};
+BAREBOX_MAGICVAR_NAMED(global_bootm_boot_atag, global.bootm.boot_atag,
+ "If true, ignore device tree and boot using ATAGs");
+
static int armlinux_register_image_handler(void)
{
+ globalvar_add_simple_bool("bootm.boot_atag", &bootm_boot_atag);
+
register_image_handler(&barebox_handler);
register_image_handler(&uimage_handler);
register_image_handler(&rawimage_handler);