Commit 15205fc0 authored by Paul Cercueil's avatar Paul Cercueil Committed by Paul Burton

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: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarPaul 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
parent 69a07a41
...@@ -390,7 +390,7 @@ config MACH_INGENIC ...@@ -390,7 +390,7 @@ config MACH_INGENIC
select GPIOLIB select GPIOLIB
select COMMON_CLK select COMMON_CLK
select GENERIC_IRQ_CHIP select GENERIC_IRQ_CHIP
select BUILTIN_DTB select BUILTIN_DTB if MIPS_NO_APPENDED_DTB
select USE_OF select USE_OF
select LIBFDT select LIBFDT
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define JZ4740_EMC_SDRAM_CTRL 0x80 #define JZ4740_EMC_SDRAM_CTRL 0x80
static void __init jz4740_detect_mem(void) static void __init jz4740_detect_mem(void)
{ {
void __iomem *jz_emc_base; void __iomem *jz_emc_base;
...@@ -66,15 +65,22 @@ static unsigned long __init get_board_mach_type(const void *fdt) ...@@ -66,15 +65,22 @@ static unsigned long __init get_board_mach_type(const void *fdt)
void __init plat_mem_setup(void) void __init plat_mem_setup(void)
{ {
int offset; int offset;
void *dtb;
jz4740_reset_init(); 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) if (offset < 0)
jz4740_detect_mem(); jz4740_detect_mem();
mips_machtype = get_board_mach_type(__dtb_start); mips_machtype = get_board_mach_type(dtb);
} }
void __init device_tree_init(void) void __init device_tree_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment