Skip to content

Commit 15205fc

Browse files
pcercueipaulburton
authored andcommitted
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
1 parent 69a07a4 commit 15205fc

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ config MACH_INGENIC
390390
select GPIOLIB
391391
select COMMON_CLK
392392
select GENERIC_IRQ_CHIP
393-
select BUILTIN_DTB
393+
select BUILTIN_DTB if MIPS_NO_APPENDED_DTB
394394
select USE_OF
395395
select LIBFDT
396396

arch/mips/jz4740/setup.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
#define JZ4740_EMC_SDRAM_CTRL 0x80
3333

34-
3534
static void __init jz4740_detect_mem(void)
3635
{
3736
void __iomem *jz_emc_base;
@@ -66,15 +65,22 @@ static unsigned long __init get_board_mach_type(const void *fdt)
6665
void __init plat_mem_setup(void)
6766
{
6867
int offset;
68+
void *dtb;
6969

7070
jz4740_reset_init();
71-
__dt_setup_arch(__dtb_start);
7271

73-
offset = fdt_path_offset(__dtb_start, "/memory");
72+
if (__dtb_start != __dtb_end)
73+
dtb = __dtb_start;
74+
else
75+
dtb = (void *)fw_passed_dtb;
76+
77+
__dt_setup_arch(dtb);
78+
79+
offset = fdt_path_offset(dtb, "/memory");
7480
if (offset < 0)
7581
jz4740_detect_mem();
7682

77-
mips_machtype = get_board_mach_type(__dtb_start);
83+
mips_machtype = get_board_mach_type(dtb);
7884
}
7985

8086
void __init device_tree_init(void)

0 commit comments

Comments
 (0)