diff options
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/jz4740/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/jz4740/setup.c | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index eb70c2d0a6a9..d5acb9e96d59 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -302,6 +302,7 @@ config MACH_INGENIC select GENERIC_IRQ_CHIP select BUILTIN_DTB select USE_OF + select LIBFDT config LANTIQ bool "Lantiq based platforms" diff --git a/arch/mips/jz4740/Makefile b/arch/mips/jz4740/Makefile index 7636432af6ee..70a9578cc6db 100644 --- a/arch/mips/jz4740/Makefile +++ b/arch/mips/jz4740/Makefile @@ -7,6 +7,8 @@ obj-y += prom.o time.o reset.o setup.o \ gpio.o platform.o timer.o serial.o +CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt + # board specific support obj-$(CONFIG_JZ4740_QI_LB60) += board-qi_lb60.o diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c index 8c08d7dcda66..1bed3cb062b3 100644 --- a/arch/mips/jz4740/setup.c +++ b/arch/mips/jz4740/setup.c @@ -18,6 +18,7 @@ #include <linux/io.h> #include <linux/irqchip.h> #include <linux/kernel.h> +#include <linux/libfdt.h> #include <linux/of_fdt.h> #include <linux/of_platform.h> @@ -55,9 +56,14 @@ static void __init jz4740_detect_mem(void) void __init plat_mem_setup(void) { + int offset; + jz4740_reset_init(); - jz4740_detect_mem(); __dt_setup_arch(__dtb_start); + + offset = fdt_path_offset(__dtb_start, "/memory"); + if (offset < 0) + jz4740_detect_mem(); } void __init device_tree_init(void) |