Skip to content

Commit

Permalink
MIPS: BMIPS: Support APPENDED_DTB
Browse files Browse the repository at this point in the history
Use appended DTB when available.

Signed-off-by: Jaedon Shin <[email protected]>
Cc: Kevin Cernekee <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/14337/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
jaedon authored and ralfbaechle committed Oct 6, 2016
1 parent a2c510a commit d66698e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/mips/bmips/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/of_platform.h>
#include <linux/libfdt.h>
#include <linux/smp.h>
#include <asm/addrspace.h>
#include <asm/bmips.h>
Expand Down Expand Up @@ -152,6 +153,8 @@ void __init plat_time_init(void)
mips_hpt_frequency = freq;
}

extern const char __appended_dtb;

void __init plat_mem_setup(void)
{
void *dtb;
Expand All @@ -161,6 +164,11 @@ void __init plat_mem_setup(void)
ioport_resource.start = 0;
ioport_resource.end = ~0;

#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
if (!fdt_check_header(&__appended_dtb))
dtb = (void *)&__appended_dtb;
else
#endif
/* intended to somewhat resemble ARM; see Documentation/arm/Booting */
if (fw_arg0 == 0 && fw_arg1 == 0xffffffff)
dtb = phys_to_virt(fw_arg2);
Expand Down

0 comments on commit d66698e

Please sign in to comment.