]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: JZ4740: require & include DT
authorPaul Burton <paul.burton@imgtec.com>
Sun, 24 May 2015 15:11:15 +0000 (16:11 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 21 Jun 2015 19:52:49 +0000 (21:52 +0200)
Require a DT for JZ4740 based systems, and add a stub one for the
qi_lb60 (Ben NanoNote) board. Devices will be migrated to being probed
via this DT over time.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/10132/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
arch/mips/boot/dts/Makefile
arch/mips/boot/dts/ingenic/Makefile [new file with mode: 0644]
arch/mips/boot/dts/ingenic/jz4740.dtsi [new file with mode: 0644]
arch/mips/boot/dts/ingenic/qi_lb60.dts [new file with mode: 0644]
arch/mips/jz4740/setup.c

index 006d8147ed611adf35c5cbf1e17f2a58e61d1ae1..9501d814ded5165e43fa615c7fe5c241280eb9a9 100644 (file)
@@ -300,6 +300,8 @@ config MACH_INGENIC
        select SYS_HAS_EARLY_PRINTK
        select HAVE_CLK
        select GENERIC_IRQ_CHIP
+       select BUILTIN_DTB
+       select USE_OF
 
 config LANTIQ
        bool "Lantiq based platforms"
index 5d95e4bd709a76e8ad2229c9abdad00c9b84a0cf..9c31b30890aa2f89915500e69bcad7ff4b5b07bd 100644 (file)
@@ -1,5 +1,6 @@
 dts-dirs       += brcm
 dts-dirs       += cavium-octeon
+dts-dirs       += ingenic
 dts-dirs       += lantiq
 dts-dirs       += mti
 dts-dirs       += netlogic
diff --git a/arch/mips/boot/dts/ingenic/Makefile b/arch/mips/boot/dts/ingenic/Makefile
new file mode 100644 (file)
index 0000000..0c84f0b
--- /dev/null
@@ -0,0 +1,9 @@
+dtb-$(CONFIG_JZ4740_QI_LB60)   += qi_lb60.dtb
+
+obj-y                          += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+
+# Force kbuild to make empty built-in.o if necessary
+obj-                           += dummy.o
+
+always                         := $(dtb-y)
+clean-files                    := *.dtb *.dtb.S
diff --git a/arch/mips/boot/dts/ingenic/jz4740.dtsi b/arch/mips/boot/dts/ingenic/jz4740.dtsi
new file mode 100644 (file)
index 0000000..c538691
--- /dev/null
@@ -0,0 +1,5 @@
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       compatible = "ingenic,jz4740";
+};
diff --git a/arch/mips/boot/dts/ingenic/qi_lb60.dts b/arch/mips/boot/dts/ingenic/qi_lb60.dts
new file mode 100644 (file)
index 0000000..0c0f639
--- /dev/null
@@ -0,0 +1,7 @@
+/dts-v1/;
+
+#include "jz4740.dtsi"
+
+/ {
+       compatible = "qi,lb60", "ingenic,jz4740";
+};
index ef796f97b99649bf89092b804ddb9f9c80f375c4..d6bb7a39fafe66e889b0def63d86c05b62823e0a 100644 (file)
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
+#include <linux/of_fdt.h>
+#include <linux/of_platform.h>
 
 #include <asm/bootinfo.h>
+#include <asm/prom.h>
 
 #include <asm/mach-jz4740/base.h>
 
@@ -53,8 +56,24 @@ void __init plat_mem_setup(void)
 {
        jz4740_reset_init();
        jz4740_detect_mem();
+       __dt_setup_arch(__dtb_start);
 }
 
+void __init device_tree_init(void)
+{
+       if (!initial_boot_params)
+               return;
+
+       unflatten_and_copy_device_tree();
+}
+
+static int __init populate_machine(void)
+{
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+       return 0;
+}
+arch_initcall(populate_machine);
+
 const char *get_system_type(void)
 {
        return "JZ4740";