Skip to contentSkip to conversation

ARM: davinci: da850: add pinctrl support

PATCH New Kumar, Anil 2 participants 8 messages Dec 7, 2012 – Jan 8, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Kumar, Anil (2):
ARM: davinci: da850: add pinctrl driver entries
ARM: davinci: da850: add NAND driver entries

 .../devicetree/bindings/arm/davinci/pinctrl.txt    |   29 ++++++++++++++++++++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/da850-evm.dts                    |   22 +++++++++++++++
 arch/arm/boot/dts/da850.dtsi                       |   23 +++++++++++++++
 arch/arm/configs/da8xx_omapl_defconfig             |    1 +
 5 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/davinci/pinctrl.txt
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/2 ARM: davinci: da850: add pinctrl driver entries

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

Enable PINCTRL Kconfig for all DaVinci 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.

---
:000000 100644 0000000... f999d9e... A Documentation/devicetree/bindings/arm/davinci/pinctrl.txt
:100644 100644 06e0adf... 54a5405... M arch/arm/Kconfig
:100644 100644 37dc5a3... 8cac9d2... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 fbada87... 94471bc... M arch/arm/boot/dts/da850.dtsi
:100644 100644 f292239... 0892db4... M arch/arm/configs/da8xx_omapl_defconfig

 .../devicetree/bindings/arm/davinci/pinctrl.txt    |   29 ++++++++++++++++++++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/da850-evm.dts                    |    3 ++
 arch/arm/boot/dts/da850.dtsi                       |   10 +++++++
 arch/arm/configs/da8xx_omapl_defconfig             |    1 +
 5 files changed, 44 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +29 -0
new file mode 100644
index 0000000..f999d9e
@@ -0,0 +1,29 @@
+* Texas Instruments Davinci pinctrl-single
+
+This file provides information, what the device node for the
+davinci pinctrl-single interface contain.
+
+Required properties:
+- compatible: "pinctrl-single";
+
+- reg : offset and length of the register set for the mux registers
+
+- pinctrl-single,bit-per-mux: mask of allowed pinmux function bits in the
+  pinmux register
+
+- pinctrl-single,register-width: pinmux register access width in bits
+
+- pinctrl-single,function-mask:  mask of allowed pinmux function bits in
+  the pinmux register
+
+Example:
+pmx_core:pinmux at 14120 {
+		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>;
+};
+~
arch/arm/Kconfig +1 -0
index 06e0adf..54a5405 100644
@@ -924,6 +924,7 @@ config ARCH_DAVINCI
 	select GENERIC_IRQ_CHIP
 	select HAVE_IDE
 	select NEED_MACH_GPIO_H
+	select PINCTRL
 	select USE_OF
 	select ZONE_DMA
 	help
arch/arm/boot/dts/da850-evm.dts +3 -0
index 37dc5a3..8cac9d2 100644
@@ -15,6 +15,9 @@
 	model = "DA850/AM1808/OMAP-L138 EVM";
 
 	soc {
+		pmx_core:pinmux at 14120 {
+			status = "okay";
+		};
 		serial0: serial at 1c42000 {
 			status = "okay";
 		};
arch/arm/boot/dts/da850.dtsi +10 -0
index fbada87..94471bc 100644
@@ -29,6 +29,16 @@
 		#size-cells = <1>;
 		ranges = <0x0 0x01c00000 0x400000>;
 
+		pmx_core:pinmux at 14120 {
+			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 at 1c42000 {
 			compatible = "ns16550a";
 			reg = <0x42000 0x100>;
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
#2 lore raw

PATCH 1/2 ARM: davinci: da850: add pinctrl driver entries

Hi Anil,

Quoted 50 lines · Anil

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

Enable PINCTRL Kconfig for all DaVinci 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.

---
:000000 100644 0000000... f999d9e... A Documentation/devicetree/bindings/arm/davinci/pinctrl.txt
:100644 100644 06e0adf... 54a5405... M arch/arm/Kconfig
:100644 100644 37dc5a3... 8cac9d2... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 fbada87... 94471bc... M arch/arm/boot/dts/da850.dtsi
:100644 100644 f292239... 0892db4... M arch/arm/configs/da8xx_omapl_defconfig

 .../devicetree/bindings/arm/davinci/pinctrl.txt    |   29 ++++++++++++++++++++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/da850-evm.dts                    |    3 ++
 arch/arm/boot/dts/da850.dtsi                       |   10 +++++++
 arch/arm/configs/da8xx_omapl_defconfig             |    1 +
 5 files changed, 44 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +18 -0
new file mode 100644
index 0000000..f999d9e
@@ -0,0 +1,29 @@
+* Texas Instruments Davinci pinctrl-single
+
+This file provides information, what the device node for the
+davinci pinctrl-single interface contain.
+
+Required properties:
+- compatible: "pinctrl-single";
+
+- reg : offset and length of the register set for the mux registers
+
+- pinctrl-single,bit-per-mux: mask of allowed pinmux function bits in the
+  pinmux register
+
+- pinctrl-single,register-width: pinmux register access width in bits
+
+- pinctrl-single,function-mask:  mask of allowed pinmux function bits in
+  the pinmux register
+

Documentation/devicetree/bindings/arm/davinci/pinctrl.txt line 28

Quoted 10 lines
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +10 -0
+Example:
+pmx_core:pinmux at 14120 {
+		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>;
+};

These bindings are already documented as part of Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt. No need to repeat.

arch/arm/Kconfig config ARCH_DAVINCI · line 927

Quoted 10 lines
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +1 -0
+~
arch/arm/Kconfig +1 -0
index 06e0adf..54a5405 100644
@@ -924,6 +924,7 @@ config ARCH_DAVINCI
 	select GENERIC_IRQ_CHIP
 	select HAVE_IDE
 	select NEED_MACH_GPIO_H
+	select PINCTRL

No need to force this across DaVinci. You can select only for MACH_DA8XX_DT.

arch/arm/boot/dts/da850-evm.dts line 18

Quoted 12 lines
arch/arm/Kconfig +0 -0
 	select USE_OF
 	select ZONE_DMA
 	help
arch/arm/boot/dts/da850-evm.dts +1 -0
index 37dc5a3..8cac9d2 100644
@@ -15,6 +15,9 @@
 	model = "DA850/AM1808/OMAP-L138 EVM";
 
 	soc {
+		pmx_core:pinmux at 14120 {

'pmx_core:pinmux at 1c14120' instead like the way uart is defined?

arch/arm/configs/da8xx_omapl_defconfig

Quoted 30 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
+			status = "okay";
+		};
 		serial0: serial at 1c42000 {
 			status = "okay";
 		};
arch/arm/boot/dts/da850.dtsi +10 -0
index fbada87..94471bc 100644
@@ -29,6 +29,16 @@
 		#size-cells = <1>;
 		ranges = <0x0 0x01c00000 0x400000>;
 
+		pmx_core:pinmux at 14120 {
+			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 at 1c42000 {
 			compatible = "ns16550a";
 			reg = <0x42000 0x100>;
arch/arm/configs/da8xx_omapl_defconfig +0 -0
index f292239..0892db4 100644

I would like the defconfig changes to be separated out into a different patch.

Thanks,
Sekhar

#3 lore raw

PATCH 1/2 ARM: davinci: da850: add pinctrl driver entries

Quoted 59 lines · Sekhar

Hi Anil,

Quoted 56 lines · Anil

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

Enable PINCTRL Kconfig for all DaVinci 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.

---
:000000 100644 0000000... f999d9e... A Documentation/devicetree/bindings/arm/davinci/pinctrl.txt
:100644 100644 06e0adf... 54a5405... M arch/arm/Kconfig
:100644 100644 37dc5a3... 8cac9d2... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 fbada87... 94471bc... M arch/arm/boot/dts/da850.dtsi
:100644 100644 f292239... 0892db4... M arch/arm/configs/da8xx_omapl_defconfig

 .../devicetree/bindings/arm/davinci/pinctrl.txt    |   29 ++++++++++++++++++++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/da850-evm.dts                    |    3 ++
 arch/arm/boot/dts/da850.dtsi                       |   10 +++++++
 arch/arm/configs/da8xx_omapl_defconfig             |    1 +
 5 files changed, 44 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +24 -0
new file mode 100644
index 0000000..f999d9e
@@ -0,0 +1,29 @@
+* Texas Instruments Davinci pinctrl-single
+
+This file provides information, what the device node for the
+davinci pinctrl-single interface contain.
+
+Required properties:
+- compatible: "pinctrl-single";
+
+- reg : offset and length of the register set for the mux registers
+
+- pinctrl-single,bit-per-mux: mask of allowed pinmux function bits in the
+  pinmux register
+
+- pinctrl-single,register-width: pinmux register access width in bits
+
+- pinctrl-single,function-mask:  mask of allowed pinmux function bits in
+  the pinmux register
+
+Example:
+pmx_core:pinmux at 14120 {
+		compatible = "pinctrl-single";
+		reg = <0x14120 0x50>;
+		#address-cells = <1>;
+		#size-cells = <0>;
Quoted 8 lines

Documentation/devicetree/bindings/arm/davinci/pinctrl.txt line 28

Quoted 4 lines
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +4 -0
+		pinctrl-single,bit-per-mux;
+		pinctrl-single,register-width = <32>;
+		pinctrl-single,function-mask = <0xffffffff>;
+};

These bindings are already documented as part of Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt. No need to repeat.

Ok I will remove this documentation in next patch series.

Quoted 13 lines

arch/arm/Kconfig config ARCH_DAVINCI · line 927

Quoted 11 lines
Documentation/devicetree/bindings/arm/davinci/pinctrl.txt new file +1 -0
+~
arch/arm/Kconfig +1 -0
index 06e0adf..54a5405 100644
@@ -924,6 +924,7 @@ config ARCH_DAVINCI
 	select GENERIC_IRQ_CHIP
 	select HAVE_IDE
 	select NEED_MACH_GPIO_H
+	select PINCTRL

No need to force this across DaVinci. You can select only for MACH_DA8XX_DT.

Ok I will do for MACH_DA8XX_DT only in next patch series.

Quoted 11 lines
Quoted 11 lines
arch/arm/Kconfig +0 -0
 	select USE_OF
 	select ZONE_DMA
 	help
arch/arm/boot/dts/da850-evm.dts +0 -0
index 37dc5a3..8cac9d2 100644
@@ -15,6 +15,9 @@
 	model = "DA850/AM1808/OMAP-L138 EVM";
 
Quoted 4 lines

arch/arm/boot/dts/da850-evm.dts line 18

Quoted 2 lines
arch/arm/boot/dts/da850-evm.dts +1 -0
 	soc {
+		pmx_core:pinmux at 14120 {

'pmx_core:pinmux at 1c14120' instead like the way uart is defined?

Sorry, I will correct this in next patch series.

Quoted 26 lines
Quoted 26 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
+			status = "okay";
+		};
 		serial0: serial at 1c42000 {
 			status = "okay";
 		};
arch/arm/boot/dts/da850.dtsi +10 -0
index fbada87..94471bc 100644
@@ -29,6 +29,16 @@
 		#size-cells = <1>;
 		ranges = <0x0 0x01c00000 0x400000>;
 
+		pmx_core:pinmux at 14120 {
+			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 at 1c42000 {
 			compatible = "ns16550a";
Quoted 8 lines

arch/arm/configs/da8xx_omapl_defconfig

Quoted 5 lines
arch/arm/boot/dts/da850.dtsi +0 -0
 			reg = <0x42000 0x100>;
arch/arm/configs/da8xx_omapl_defconfig +0 -0
index f292239..0892db4 100644

I would like the defconfig changes to be separated out into a different patch.

Ok, I will make separate patch for this in next patch series.

Quoted 4 lines

Thanks,
Sekhar

#4 lore raw

PATCH 2/2 ARM: davinci: da850: add NAND driver entries

In reply to Kumar, Anil

Add NAND driver entries to export NAND functionality on da850 EVM and NAND pinctrl node to do pin mux according to pinctrl-single driver.

---
Depend on link:
http://www.spinics.net/lists/linux-doc/msg07535.html

:100644 100644 8cac9d2... 05b558a... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 94471bc... f198ee8... M arch/arm/boot/dts/da850.dtsi

 arch/arm/boot/dts/da850-evm.dts |   19 +++++++++++++++++++
 arch/arm/boot/dts/da850.dtsi    |   13 +++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +19 -0
index 8cac9d2..05b558a 100644
@@ -28,4 +28,23 @@
 			status = "okay";
 		};
 	};
+	nand_cs3 at 62000000 {
+		status = "okay";
+	};
+};
+&pmx_core{
+	pinctrl-names = "default";
+	pinctrl-0 = <
+		&nand_cs3_pins
+	>;
+
+	nand_cs3_pins: pinmux_nand_pins {
+		pinctrl-single,bits = <
+			0x1c 0x00110000  0x00ff0000     /* EMA_OE, EMA_WE */
+			0x1c 0x00000110  0x00000ff0     /* EMA_CS[4],EMA_CS[3]*/
+			0x24 0x11111111  0xffffffff     /* EMA_D[0], EMA_D[1], EMA_D[2], EMA_D[3],
+							   EMA_D[4], EMA_D[5], EMA_D[6], EMA_D[7] */
+			0x30 0x01100000  0x0ff00000     /* EMA_A[1], EMA_A[2] */
+		>;
+	};
 };
arch/arm/boot/dts/da850.dtsi +13 -0
index 94471bc..f198ee8 100644
@@ -67,4 +67,17 @@
 			status = "disabled";
 		};
 	};
+	nand_cs3 at 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
#5 lore raw

cover ARM: davinci: da850: add pinctrl support

In reply to Kumar, Anil

Hi All,

As pinctrl-single is required for handling Pad configuration of various DaVinci module(for e.g mcasp, i2c etc) with DT. Hence for this patch if there are no review comments, could you pull this patch ?

Thanks,
Anil

Quoted 22 lines · Anil

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.

Kumar, Anil (2):
ARM: davinci: da850: add pinctrl driver entries
ARM: davinci: da850: add NAND driver entries

 .../devicetree/bindings/arm/davinci/pinctrl.txt    |   29 ++++++++++++++++++++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/da850-evm.dts                    |   22 +++++++++++++++
 arch/arm/boot/dts/da850.dtsi                       |   23 +++++++++++++++
 arch/arm/configs/da8xx_omapl_defconfig             |    1 +
 5 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/davinci/pinctrl.txt
Signature · 1 line
1.7.4.1
#6 lore raw

cover ARM: davinci: da850: add pinctrl support

In reply to Kumar, Anil

Hi,

Gentle Ping. As there are no review comments on this patch series, could you please pull this patch ?

Thanks,
Anil

Quoted 34 lines · Anil

Hi All,

As pinctrl-single is required for handling Pad configuration of various DaVinci module(for e.g mcasp, i2c etc) with DT. Hence for this patch if there are no review comments, could you pull this patch ?

Thanks,
Anil

Quoted 22 lines · Anil

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.

Kumar, Anil (2):
ARM: davinci: da850: add pinctrl driver entries
ARM: davinci: da850: add NAND driver entries

 .../devicetree/bindings/arm/davinci/pinctrl.txt    |   29 ++++++++++++++++++++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/da850-evm.dts                    |   22 +++++++++++++++
 arch/arm/boot/dts/da850.dtsi                       |   23 +++++++++++++++
 arch/arm/configs/da8xx_omapl_defconfig             |    1 +
 5 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/davinci/pinctrl.txt
Signature · 1 line
1.7.4.1
#7 lore raw

cover ARM: davinci: da850: add pinctrl support

Quoted 4 lines · Anil

Hi,

Gentle Ping. As there are no review comments on this patch series, could you please pull this patch ?

Most folks are just getting back from holidays. Please wait some more for reviews to happen.

Thanks,
Sekhar