Skip to contentSkip to conversation

NI 169445 board support

PATCH Superseded Nathan Sullivan 3 participants 5 messages Mar 8, 2017 – Mar 15, 2017

Subsystems (4)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 NI 169445 board support

Add support for the National Instruments 169445 board

----
Changes from v2:

- Hand write the board config fragment, and make it more minimal.
- Add myself as the maintainer of new dirs and files.

#1 lore raw

PATCH 1/2 gpio: mmio: add support for NI 169445 NAND GPIO

The GPIO-based NAND controller on National Instruments 169445 hardware exposes a set of simple lines for the control signals.

---
 .../bindings/gpio/ni,169445-nand-gpio.txt          | 36 ++++++++++++++++++++++
 drivers/gpio/gpio-mmio.c                           |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt new file +36 -0
new file mode 100644
index 0000000..ca2c14f
@@ -0,0 +1,36 @@
+Bindings for the National Instruments 169445 GPIO NAND controller
+
+The 169445 GPIO NAND controller has two memory mapped GPIO registers, one
+for input (the ready signal) and one for output (control signals).  It is
+intended to be used with the GPIO NAND driver.
+
+Required properties:
+	- compatible: should be "ni,169445-nand-gpio"
+	- reg-names: must contain
+		"dat" - data register
+	- reg: address + size pairs describing the GPIO register sets;
+		order must correspond with the order of entries in reg-names
+	- #gpio-cells: must be set to 2. The first cell is the pin number and
+			the second cell is used to specify the gpio polarity:
+			0 = active high
+			1 = active low
+	- gpio-controller: Marks the device node as a gpio controller.
+
+Examples:
+	gpio1: nand-gpio-out@1f300010 {
+		compatible = "ni,169445-nand-gpio";
+		reg = <0x1f300010 0x4>;
+		reg-names = "dat";
+		gpio-controller;
+		#gpio-cells = <2>;
+		ngpios = <5>;
+	};
+
+	gpio2: nand-gpio-in@1f300014 {
+		compatible = "ni,169445-nand-gpio";
+		reg = <0x1f300014 0x4>;
+		reg-names = "dat";
+		gpio-controller;
+		#gpio-cells = <2>;
+		ngpios = <1>;
+	};
drivers/gpio/gpio-mmio.c +1 -0
index d7d03ad..f7da40e 100644
@@ -575,6 +575,7 @@ static void __iomem *bgpio_map(struct platform_device *pdev,
 static const struct of_device_id bgpio_of_match[] = {
 	{ .compatible = "brcm,bcm6345-gpio" },
 	{ .compatible = "wd,mbl-gpio" },
+	{ .compatible = "ni,169445-nand-gpio" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, bgpio_of_match);
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH 1/2] gpio: mmio: add support for NI 169445 NAND GPIO

Quoted 32 lines · CET Nathan Sullivan

The GPIO-based NAND controller on National Instruments 169445 hardware exposes a set of simple lines for the control signals.

---
 .../bindings/gpio/ni,169445-nand-gpio.txt          | 36 ++++++++++++++++++++++
 drivers/gpio/gpio-mmio.c                           |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt new file +16 -0
new file mode 100644
index 0000000..ca2c14f
@@ -0,0 +1,36 @@
+Bindings for the National Instruments 169445 GPIO NAND controller
+
+The 169445 GPIO NAND controller has two memory mapped GPIO registers, one
+for input (the ready signal) and one for output (control signals).  It is
+intended to be used with the GPIO NAND driver.
+
+Required properties:
+	- compatible: should be "ni,169445-nand-gpio"
+	- reg-names: must contain
+		"dat" - data register
+	- reg: address + size pairs describing the GPIO register sets;
+		order must correspond with the order of entries in reg-names
+	- #gpio-cells: must be set to 2. The first cell is the pin number and
+			the second cell is used to specify the gpio polarity:
+			0 = active high
+			1 = active low

Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt line 26

Quoted 10 lines
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt new file +10 -0
+	- gpio-controller: Marks the device node as a gpio controller.
+
+Examples:
+	gpio1: nand-gpio-out@1f300010 {
+		compatible = "ni,169445-nand-gpio";
+		reg = <0x1f300010 0x4>;
+		reg-names = "dat";
+		gpio-controller;
+		#gpio-cells = <2>;
+		ngpios = <5>;

ngpios? Where is this parameter parsed? Is there a description for it in the Documentation?

Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt line 29

Quoted 3 lines
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt new file +3 -0
+	};
+
+	gpio2: nand-gpio-in@1f300014 {

^^ I assume this GPIO only has input? Is this right? If so you can specify the following dt property:

	no-output;

So, all gpios can only be inputs.

Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt line 35

Quoted 6 lines
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt new file +6 -0
+		compatible = "ni,169445-nand-gpio";
+		reg = <0x1f300014 0x4>;
+		reg-names = "dat";
+		gpio-controller;
+		#gpio-cells = <2>;
+		ngpios = <1>;

Same as above.

I think you should could either add a parser for the ngpios property. by adding of_property_read_u16(&pdev->dev, "ngpios", &gc->ngpio); in the right place. or remove the property.

drivers/gpio/gpio-mmio.c static void __iomem *bgpio_map(struct platform_device *pdev, · line 578

Quoted 10 lines
Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt new file +1 -0
+	};
drivers/gpio/gpio-mmio.c +1 -0
index d7d03ad..f7da40e 100644
@@ -575,6 +575,7 @@ static void __iomem *bgpio_map(struct platform_device *pdev,
 static const struct of_device_id bgpio_of_match[] = {
 	{ .compatible = "brcm,bcm6345-gpio" },
 	{ .compatible = "wd,mbl-gpio" },
+	{ .compatible = "ni,169445-nand-gpio" },

Maybe you could add this entry above the wd,mbl-gpio. So it's in alphabetical order. That's said, it's fine the way it is.

Quoted 4 lines
drivers/gpio/gpio-mmio.c +0 -0
 	{ }
 };
 MODULE_DEVICE_TABLE(of, bgpio_of_match);
#3 lore raw

Re: [PATCH 1/2] gpio: mmio: add support for NI 169445 NAND GPIO

In reply to Nathan Sullivan
Quoted 4 lines · Nathan Sullivan

The GPIO-based NAND controller on National Instruments 169445 hardware exposes a set of simple lines for the control signals.

Oh a newer patch with comments exist. I take out the other patch then and wait for v3.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH 2/2 MIPS: NI 169445 board support

In reply to Nathan Sullivan

Support the National Instruments 169445 board.

---
 Documentation/devicetree/bindings/mips/ni.txt   |   7 ++
 MAINTAINERS                                     |   8 ++
 arch/mips/boot/dts/Makefile                     |   1 +
 arch/mips/boot/dts/ni/169445.dts                | 101 ++++++++++++++++++++++++
 arch/mips/boot/dts/ni/Makefile                  |   7 ++
 arch/mips/configs/generic/board-ni169445.config |  27 +++++++
 arch/mips/generic/Kconfig                       |   6 ++
 arch/mips/generic/vmlinux.its.S                 |  25 ++++++
 8 files changed, 182 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/ni.txt
 create mode 100644 arch/mips/boot/dts/ni/169445.dts
 create mode 100644 arch/mips/boot/dts/ni/Makefile
 create mode 100644 arch/mips/configs/generic/board-ni169445.config
Documentation/devicetree/bindings/mips/ni.txt new file +7 -0
new file mode 100644
index 0000000..722bf2d
@@ -0,0 +1,7 @@
+National Instruments MIPS platforms
+
+required root node properties:
+	- compatible: must be "ni,169445"
+
+CPU Nodes
+	- compatible: must be "mti,mips14KEc"
MAINTAINERS +8 -0
index c265a5f..b72f059 100644
@@ -8887,6 +8887,14 @@ F:	include/linux/sunrpc/
 F:	include/uapi/linux/nfs*
 F:	include/uapi/linux/sunrpc/
 
+NI169445 MIPS ARCHITECTURE
+M:	Nathan Sullivan <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	arch/mips/boot/dts/ni/
+F:	arch/mips/configs/generic/board-ni169445.config
+F:	Documentation/devicetree/bindings/mips/ni.txt
+
 NILFS2 FILESYSTEM
 M:	Ryusuke Konishi <[email protected]>
 L:	[email protected]
arch/mips/boot/dts/Makefile +1 -0
index b9db492..27b0f37 100644
@@ -4,6 +4,7 @@ dts-dirs	+= img
 dts-dirs	+= ingenic
 dts-dirs	+= lantiq
 dts-dirs	+= mti
+dts-dirs	+= ni
 dts-dirs	+= netlogic
 dts-dirs	+= pic32
 dts-dirs	+= qca
arch/mips/boot/dts/ni/169445.dts new file +101 -0

101 lines not on this page · raw message

arch/mips/boot/dts/ni/Makefile new file +7 -0
new file mode 100644
index 0000000..66cfdff
@@ -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
arch/mips/configs/generic/board-ni169445.config new file +27 -0
new file mode 100644
index 0000000..0bae1f8
@@ -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
arch/mips/generic/Kconfig +6 -0
index a606b3f..fbf0813 100644
@@ -16,4 +16,10 @@ config LEGACY_BOARD_SEAD3
 	  Enable this to include support for booting on MIPS SEAD-3 FPGA-based
 	  development boards, which boot using a legacy boot protocol.
 
+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
arch/mips/generic/vmlinux.its.S +25 -0
index f67fbf1..de851f7 100644
@@ -29,3 +29,28 @@
 		};
 	};
 };
+
+#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
Signature · 1 line
2.1.4