Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Paul Cercueil and committed by
Paul Burton
15205fc0 69a07a41

+11 -5
+1 -1
arch/mips/Kconfig
··· 390 390 select GPIOLIB 391 391 select COMMON_CLK 392 392 select GENERIC_IRQ_CHIP 393 - select BUILTIN_DTB 393 + select BUILTIN_DTB if MIPS_NO_APPENDED_DTB 394 394 select USE_OF 395 395 select LIBFDT 396 396
+10 -4
arch/mips/jz4740/setup.c
··· 31 31 32 32 #define JZ4740_EMC_SDRAM_CTRL 0x80 33 33 34 - 35 34 static void __init jz4740_detect_mem(void) 36 35 { 37 36 void __iomem *jz_emc_base; ··· 65 66 void __init plat_mem_setup(void) 66 67 { 67 68 int offset; 69 + void *dtb; 68 70 69 71 jz4740_reset_init(); 70 - __dt_setup_arch(__dtb_start); 71 72 72 - offset = fdt_path_offset(__dtb_start, "/memory"); 73 + if (__dtb_start != __dtb_end) 74 + dtb = __dtb_start; 75 + else 76 + dtb = (void *)fw_passed_dtb; 77 + 78 + __dt_setup_arch(dtb); 79 + 80 + offset = fdt_path_offset(dtb, "/memory"); 73 81 if (offset < 0) 74 82 jz4740_detect_mem(); 75 83 76 - mips_machtype = get_board_mach_type(__dtb_start); 84 + mips_machtype = get_board_mach_type(dtb); 77 85 } 78 86 79 87 void __init device_tree_init(void)