summaryrefslogtreecommitdiffstats
path: root/arch/mips/jz4740
diff options
context:
space:
mode:
authorPaul Cercueil2019-02-21 23:43:10 +0100
committerPaul Burton2019-02-22 00:55:41 +0100
commit15205fc05482ba3d9574ded5bd4508f240f6ff52 (patch)
tree41f1ac6603722af776b12c3667508be271d1b367 /arch/mips/jz4740
parentMIPS: SGI-IP27: rework HUB interrupts (diff)
downloadkernel-qcow2-linux-15205fc05482ba3d9574ded5bd4508f240f6ff52.tar.gz
kernel-qcow2-linux-15205fc05482ba3d9574ded5bd4508f240f6ff52.tar.xz
kernel-qcow2-linux-15205fc05482ba3d9574ded5bd4508f240f6ff52.zip
MIPS: ingenic: Add support for appended devicetree
Add support for booting the kernel from an externally-appended devicetree, if no devicetree was built-in. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/mips/jz4740')
-rw-r--r--arch/mips/jz4740/setup.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c
index afb40f8bce96..7e63c54eb8d2 100644
--- a/arch/mips/jz4740/setup.c
+++ b/arch/mips/jz4740/setup.c
@@ -31,7 +31,6 @@
#define JZ4740_EMC_SDRAM_CTRL 0x80
-
static void __init jz4740_detect_mem(void)
{
void __iomem *jz_emc_base;
@@ -66,15 +65,22 @@ static unsigned long __init get_board_mach_type(const void *fdt)
void __init plat_mem_setup(void)
{
int offset;
+ void *dtb;
jz4740_reset_init();
- __dt_setup_arch(__dtb_start);
- offset = fdt_path_offset(__dtb_start, "/memory");
+ if (__dtb_start != __dtb_end)
+ dtb = __dtb_start;
+ else
+ dtb = (void *)fw_passed_dtb;
+
+ __dt_setup_arch(dtb);
+
+ offset = fdt_path_offset(dtb, "/memory");
if (offset < 0)
jz4740_detect_mem();
- mips_machtype = get_board_mach_type(__dtb_start);
+ mips_machtype = get_board_mach_type(dtb);
}
void __init device_tree_init(void)