Skip to contentSkip to conversation

ARM: davinci: da850: add pinctrl support

PATCH In review Kumar, Anil 2 participants 5 messages Jan 16, 2013 – Jan 21, 2013

Subsystems (4)
lore
Share & tools
lore
#1 lore raw

PATCH v5 1/3 ARM: davinci: da850: add pinctrl driver DT entries

In reply to Kumar, Anil

For DT, DaVinci platform can use pinctrl-single driver for handling padconf registers.

Enable PINCTRL Kconfig for MACH_DA8XX_DT platform. Add required pinctrl DT entries in da850 dts file.

Test procedure
1)Populate DT file with NAND node information. 2)Populate board DT file with pinmux information for NAND. 3)Boot and confirm NAND is detected by the kernel. 4)cat /proc/mtd to show partitions.

---
Cosmetic changes for pmx_core: pinmux@1c14120 DT node

:100644 100644 37dc5a3... 087ba28... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 fbada87... 160ebac... M arch/arm/boot/dts/da850.dtsi
:100644 100644 0153950... a075b3e... M arch/arm/mach-davinci/Kconfig

 arch/arm/boot/dts/da850-evm.dts |    3 +++
 arch/arm/boot/dts/da850.dtsi    |   10 ++++++++++
 arch/arm/mach-davinci/Kconfig   |    1 +
 3 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +3 -0
index 37dc5a3..087ba28 100644
@@ -15,6 +15,9 @@
 	model = "DA850/AM1808/OMAP-L138 EVM";
 
 	soc {
+		pmx_core: pinmux@1c14120 {
+			status = "okay";
+		};
 		serial0: serial@1c42000 {
 			status = "okay";
 		};
arch/arm/boot/dts/da850.dtsi +10 -0
index fbada87..160ebac 100644
@@ -29,6 +29,16 @@
 		#size-cells = <1>;
 		ranges = <0x0 0x01c00000 0x400000>;
 
+		pmx_core: pinmux@1c14120 {
+			compatible = "pinctrl-single";
+			reg = <0x14120 0x50>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			pinctrl-single,bit-per-mux;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0xffffffff>;
+			status = "disabled";
+		};
 		serial0: serial@1c42000 {
 			compatible = "ns16550a";
 			reg = <0x42000 0x100>;
arch/arm/mach-davinci/Kconfig +1 -0
index 0153950..a075b3e 100644
@@ -62,6 +62,7 @@ config MACH_DA8XX_DT
 	bool "Support DA8XX platforms using device tree"
 	default y
 	depends on ARCH_DAVINCI_DA8XX
+	select PINCTRL
 	help
 	  Say y here to include support for TI DaVinci DA850 based using
 	  Flattened Device Tree. More information at Documentation/devicetree
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v5 3/3 ARM: davinci: da850: add NAND driver DT entries

In reply to Kumar, Anil

Add NAND driver DT node and related pinctrl DT data to export NAND functionality on da850 evm.

---
:100644 100644 087ba28... 98c1a48... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 160ebac... f014f7b... M arch/arm/boot/dts/da850.dtsi

 arch/arm/boot/dts/da850-evm.dts |    5 +++++
 arch/arm/boot/dts/da850.dtsi    |   30 ++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +5 -0
index 087ba28..98c1a48 100644
@@ -28,4 +28,9 @@
 			status = "okay";
 		};
 	};
+	nand_cs3@62000000 {
+		status = "okay";
+		pinctrl-names = "default";
+		pinctrl-0 = <&nand_cs3_pins>;
+	};
 };
arch/arm/boot/dts/da850.dtsi +30 -0
index 160ebac..f014f7b 100644
@@ -38,6 +38,23 @@
 			pinctrl-single,register-width = <32>;
 			pinctrl-single,function-mask = <0xffffffff>;
 			status = "disabled";
+
+			nand_cs3_pins: pinmux_nand_pins {
+				pinctrl-single,bits = <
+					/* EMA_OE, EMA_WE */
+					0x1c 0x00110000  0x00ff0000
+					/* EMA_CS[4],EMA_CS[3]*/
+					0x1c 0x00000110  0x00000ff0
+					/*
+					 * EMA_D[0], EMA_D[1], EMA_D[2],
+					 * EMA_D[3], EMA_D[4], EMA_D[5],
+					 * EMA_D[6], EMA_D[7]
+					 */
+					0x24 0x11111111  0xffffffff
+					/* EMA_A[1], EMA_A[2] */
+					0x30 0x01100000  0x0ff00000
+				>;
+			};
 		};
 		serial0: serial@1c42000 {
 			compatible = "ns16550a";
@@ -67,4 +84,17 @@
 			status = "disabled";
 		};
 	};
+	nand_cs3@62000000 {
+		compatible = "ti,davinci-nand";
+		reg = <0x62000000 0x807ff
+			0x68000000 0x8000>;
+		ti,davinci-chipselect = <1>;
+		ti,davinci-mask-ale = <0>;
+		ti,davinci-mask-cle = <0>;
+		ti,davinci-mask-chipsel = <0>;
+		ti,davinci-ecc-mode = "hw";
+		ti,davinci-ecc-bits = <4>;
+		ti,davinci-nand-use-bbt;
+		status = "disabled";
+	};
 };
Signature · 1 line
1.7.4.1
#0 lore raw

v5 cover ARM: davinci: da850: add pinctrl support

This set of patches adds:

* Add pinctrl-single for handling Padconf registers.
* Add NAND node to export NAND functionality on da850 EVM.
* Add NAND pinctrl node to do pin mux according to pinctrl-single driver.

This series applies on top of tag next-20130107 git tree
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
and the following patch

-drivers/pinctrl: grab default handles from device core
https://patchwork.kernel.org/patch/1862231/

This series is tested on da850 EVM.

Changes since V4:

-Cosmetic changes.

Changes since V3:

-Move NAND related pinctrl DT data into the da850.dtsi file so it can
be reused.

Changes since V2:

-Move NAND pins configuration into the nand_cs3 DT node to avoid pins
configuration if it is not probed.

Changes since V1:

-Remove the binding documentation as already documented as part of
Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
-Enable PINCTRL Kconfig for MACH_DA8XX_DT platform only. -Fix the pinctrl driver node unit-address.
-Make separate patch for da8xx_omapl_defconfig changes.

Kumar, Anil (3):
ARM: davinci: da850: add pinctrl driver DT entries
ARM: davinci: da8xx defconfig: enable pinctrl config option
ARM: davinci: da850: add NAND driver DT entries

 arch/arm/boot/dts/da850-evm.dts        |    8 ++++++
 arch/arm/boot/dts/da850.dtsi           |   40 ++++++++++++++++++++++++++++++++
 arch/arm/configs/da8xx_omapl_defconfig |    1 +
 arch/arm/mach-davinci/Kconfig          |    1 +
 4 files changed, 50 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH v5 2/3 ARM: davinci: da8xx defconfig: enable pinctrl config option

Enable pinctrl related config option in da8xx_omapl_defconfig

---
:100644 100644 f292239... 0892db4... M arch/arm/configs/da8xx_omapl_defconfig

 arch/arm/configs/da8xx_omapl_defconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/configs/da8xx_omapl_defconfig +1 -0
index f292239..0892db4 100644
@@ -81,6 +81,7 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DAVINCI=y
+CONFIG_PINCTRL_SINGLE=y
 # CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
 CONFIG_REGULATOR=y
Signature · 1 line
1.7.4.1
#4 lore raw

Re: [PATCH V5 3/3] ARM: davinci: da850: add NAND driver DT entries

In reply to Kumar, Anil

Hi Anil,

Quoted 4 lines · Anil

Add NAND driver DT node and related pinctrl DT data to export NAND functionality on da850 evm.

I applied all three patches in this series.

arch/arm/boot/dts/da850.dtsi line 90

Quoted 4 lines
arch/arm/boot/dts/da850.dtsi +4 -0
+	nand_cs3 at 62000000 {
+		compatible = "ti,davinci-nand";
+		reg = <0x62000000 0x807ff
+			0x68000000 0x8000>;

While applying I changed the indentation of this line so the two addresses are aligned.

Thanks,
Sekhar