summaryrefslogtreecommitdiff
path: root/arch/mips/ath79
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-01-27 16:24:30 +0300
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-02-04 15:34:51 +0300
commitb83ba0b9df56f8404ccc6ebcc7050fb8294f0f20 (patch)
tree8ddc0b7e76974718408e826aa83e7b7084193bb9 /arch/mips/ath79
parenta056aacd2df2ec8134ed3baffd7fb6ba02874652 (diff)
downloadlinux-b83ba0b9df56f8404ccc6ebcc7050fb8294f0f20.tar.xz
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 <tsbogend@alpha.franken.de> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'arch/mips/ath79')
-rw-r--r--arch/mips/ath79/setup.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 7e7bf9c2ad26..891f495c4c3c 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -213,16 +213,17 @@ unsigned int get_c0_compare_int(void)
void __init plat_mem_setup(void)
{
- unsigned long fdt_start;
+ void *dtb;
set_io_port_base(KSEG1);
/* Get the position of the FDT passed by the bootloader */
- fdt_start = fw_getenvl("fdt_start");
- if (fdt_start)
- __dt_setup_arch((void *)KSEG0ADDR(fdt_start));
- else if (fw_passed_dtb)
- __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));
+ dtb = (void *)fw_getenvl("fdt_start");
+ if (dtb == NULL)
+ dtb = get_fdt();
+
+ if (dtb)
+ __dt_setup_arch((void *)KSEG0ADDR(dtb));
ath79_reset_base = ioremap(AR71XX_RESET_BASE,
AR71XX_RESET_SIZE);