MIPS: NI 169445 board support
authorNathan Sullivan <nathan.sullivan@ni.com>
Tue, 18 Jul 2017 18:29:09 +0000 (13:29 -0500)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 29 Aug 2017 13:21:51 +0000 (15:21 +0200)
Support the National Instruments 169445 board.

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
Acked-by: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/16782/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Documentation/devicetree/bindings/mips/ni.txt [new file with mode: 0644]
arch/mips/boot/dts/Makefile
arch/mips/boot/dts/ni/169445.dts [new file with mode: 0644]
arch/mips/boot/dts/ni/Makefile [new file with mode: 0644]
arch/mips/configs/generic/board-ni169445.config [new file with mode: 0644]
arch/mips/generic/Kconfig
arch/mips/generic/vmlinux.its.S

diff --git a/Documentation/devicetree/bindings/mips/ni.txt b/Documentation/devicetree/bindings/mips/ni.txt
new file mode 100644 (file)
index 0000000..722bf2d
--- /dev/null
@@ -0,0 +1,7 @@
+National Instruments MIPS platforms
+
+required root node properties:
+       - compatible: must be "ni,169445"
+
+CPU Nodes
+       - compatible: must be "mti,mips14KEc"
index b9db49203e0c08a1d427fee24864074891c146b2..cbac26ce063ef2954472d9ec0cae42855c7b35d7 100644 (file)
@@ -5,6 +5,7 @@ dts-dirs        += ingenic
 dts-dirs       += lantiq
 dts-dirs       += mti
 dts-dirs       += netlogic
+dts-dirs       += ni
 dts-dirs       += pic32
 dts-dirs       += qca
 dts-dirs       += ralink
diff --git a/arch/mips/boot/dts/ni/169445.dts b/arch/mips/boot/dts/ni/169445.dts
new file mode 100644 (file)
index 0000000..5389ef4
--- /dev/null
@@ -0,0 +1,100 @@
+/dts-v1/;
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       compatible = "ni,169445";
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "mti,mips14KEc";
+                       clocks = <&baseclk>;
+                       reg = <0>;
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x10000000>;
+       };
+
+       baseclk: baseclock {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <50000000>;
+       };
+
+       cpu_intc: interrupt-controller {
+               #address-cells = <0>;
+               compatible = "mti,cpu-interrupt-controller";
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+
+       ahb@1f300000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x1f300000 0x80FFF>;
+
+               gpio1: gpio@10 {
+                       compatible = "ni,169445-nand-gpio";
+                       reg = <0x10 0x4>;
+                       reg-names = "dat";
+                       gpio-controller;
+                       #gpio-cells = <2>;
+               };
+
+               gpio2: gpio@14 {
+                       compatible = "ni,169445-nand-gpio";
+                       reg = <0x14 0x4>;
+                       reg-names = "dat";
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       no-output;
+               };
+
+               nand@0 {
+                       compatible = "gpio-control-nand";
+                       nand-on-flash-bbt;
+                       nand-ecc-mode = "soft_bch";
+                       nand-ecc-step-size = <512>;
+                       nand-ecc-strength = <4>;
+                       reg = <0x0 4>;
+                       gpios = <&gpio2 0 0>, /* rdy */
+                               <&gpio1 1 0>, /* nce */
+                               <&gpio1 2 0>, /* ale */
+                               <&gpio1 3 0>, /* cle */
+                               <&gpio1 4 0>; /* nwp */
+               };
+
+               serial@80000 {
+                       compatible = "ns16550a";
+                       reg = <0x80000 0x1000>;
+                       interrupt-parent = <&cpu_intc>;
+                       interrupts = <6>;
+                       clocks = <&baseclk>;
+                       reg-shift = <0>;
+               };
+
+               ethernet@40000 {
+                       compatible = "snps,dwmac-4.10a";
+                       interrupt-parent = <&cpu_intc>;
+                       interrupts = <5>;
+                       interrupt-names = "macirq";
+                       reg = <0x40000 0x2000>;
+                       clock-names = "stmmaceth", "pclk";
+                       clocks = <&baseclk>, <&baseclk>;
+
+                       phy-mode = "rgmii";
+
+                       fixed-link {
+                               speed = <1000>;
+                               full-duplex;
+                       };
+               };
+       };
+};
diff --git a/arch/mips/boot/dts/ni/Makefile b/arch/mips/boot/dts/ni/Makefile
new file mode 100644 (file)
index 0000000..66cfdff
--- /dev/null
@@ -0,0 +1,7 @@
+dtb-$(CONFIG_FIT_IMAGE_FDT_NI169445)   += 169445.dtb
+
+# 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/configs/generic/board-ni169445.config b/arch/mips/configs/generic/board-ni169445.config
new file mode 100644 (file)
index 0000000..0bae1f8
--- /dev/null
@@ -0,0 +1,27 @@
+CONFIG_FIT_IMAGE_FDT_NI169445=y
+
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_GENERIC_PLATFORM=y
+
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CMDLINE_PARTS=y
+
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_BCH=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_GPIO=y
+CONFIG_MTD_NAND_IDS=y
+
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BLOCK=y
+
+CONFIG_NETDEVICES=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
+CONFIG_DWMAC_GENERIC=y
index 51ffbbaddee2e27c770eeb1da89e6dcc3514e8df..e0436aaf7f389e9a6f04d042975eaa29d45020c1 100644 (file)
@@ -36,4 +36,10 @@ config FIT_IMAGE_FDT_BOSTON
          enable this if you wish to boot on a MIPS Boston board, as it is
          expected by the bootloader.
 
+config FIT_IMAGE_FDT_NI169445
+       bool "Include FDT for NI 169445"
+       help
+         Enable this to include the FDT for the 169445 platform from
+         National Instruments in the FIT kernel image.
+
 endif
index 3390e2f80b8014a9a8c6c8c39555de460cd5bb48..0083e1af9a9190deeac37d92f55066f1848e54bc 100644 (file)
        };
 };
 #endif /* CONFIG_FIT_IMAGE_FDT_BOSTON */
+
+#ifdef CONFIG_FIT_IMAGE_FDT_NI169445
+/ {
+       images {
+               fdt@ni169445 {
+                       description = "NI 169445 device tree";
+                       data = /incbin/("boot/dts/ni/169445.dtb");
+                       type = "flat_dt";
+                       arch = "mips";
+                       compression = "none";
+                       hash@0 {
+                               algo = "sha1";
+                       };
+               };
+       };
+
+       configurations {
+               conf@ni169445 {
+                       description = "NI 169445 Linux Kernel";
+                       kernel = "kernel@0";
+                       fdt = "fdt@ni169445";
+               };
+       };
+};
+#endif /* CONFIG_FIT_IMAGE_FDT_NI169445 */