diff options
author | Paul Cercueil <paul@crapouillou.net> | 2019-02-22 01:43:10 +0300 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-02-22 02:55:41 +0300 |
commit | 15205fc05482ba3d9574ded5bd4508f240f6ff52 (patch) | |
tree | 41f1ac6603722af776b12c3667508be271d1b367 /arch/mips/jz4740 | |
parent | 69a07a41d908f9df48393bbab179daded8cfab66 (diff) | |
download | linux-15205fc05482ba3d9574ded5bd4508f240f6ff52.tar.xz |
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.c | 14 |
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) |