From b83ba0b9df56f8404ccc6ebcc7050fb8294f0f20 Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer Date: Wed, 27 Jan 2021 14:24:30 +0100 Subject: MIPS: of: Introduce helper function to get DTB Selection of the DTB to be used was burried in more or less readable code in head.S. Move this code into a inline helper function and use it. Signed-off-by: Thomas Bogendoerfer Acked-by: Florian Fainelli --- arch/mips/bmips/setup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'arch/mips/bmips/setup.c') diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c index 10e31d91ca8f..95f8f10d8697 100644 --- a/arch/mips/bmips/setup.c +++ b/arch/mips/bmips/setup.c @@ -161,11 +161,10 @@ void __init plat_mem_setup(void) /* intended to somewhat resemble ARM; see Documentation/arm/booting.rst */ if (fw_arg0 == 0 && fw_arg1 == 0xffffffff) dtb = phys_to_virt(fw_arg2); - else if (fw_passed_dtb) /* UHI interface or appended dtb */ - dtb = (void *)fw_passed_dtb; - else if (&__dtb_start != &__dtb_end) - dtb = (void *)__dtb_start; else + dtb = get_fdt(); + + if (!dtb) panic("no dtb found"); __dt_setup_arch(dtb); -- cgit v1.2.3