2016-04-27 14:11:56

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH 0/5] ARM:Keystone: Add pinmuxing support

Unlike most Keystone 2 devices, K2G supports pinmuxing of its pins. This
patch series enables pinmuxing for Keystone 2 devices.

Franklin S Cooper Jr (1):
ARM: keystone: defconfig: Enable PINCTRL SINGLE for Keystone 2

Lokesh Vutla (3):
ARM: Keystone: Enable PINCTRL for Keystone ARCH
ARM: dts: keystone: Header file for pinctrl constants
ARM: dts: k2g-evm: Add pinmuxing for UART0

Vitaly Andrianov (1):
ARM: dts: k2g: Add pinctrl support

arch/arm/boot/dts/keystone-k2g-evm.dts | 11 ++++++++++
arch/arm/boot/dts/keystone-k2g.dtsi | 8 +++++++
arch/arm/configs/keystone_defconfig | 1 +
arch/arm/mach-keystone/Kconfig | 1 +
include/dt-bindings/pinctrl/keystone.h | 39 ++++++++++++++++++++++++++++++++++
5 files changed, 60 insertions(+)
create mode 100644 include/dt-bindings/pinctrl/keystone.h

--
2.7.0


2016-04-27 14:11:58

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH 2/5] ARM: keystone: defconfig: Enable PINCTRL SINGLE for Keystone 2

Newer Keystone 2 devices utilize pinmuxing. Enable PINCTRL SINGLE
which is used to handle pinmuxing.

Signed-off-by: Franklin S Cooper Jr <[email protected]>
---
arch/arm/configs/keystone_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index 5bcc9cf..d068421 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -208,3 +208,4 @@ CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
+CONFIG_PINCTRL_SINGLE=y
--
2.7.0

2016-04-27 14:12:02

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH 3/5] ARM: dts: k2g: Add pinctrl support

From: Vitaly Andrianov <[email protected]>

Add pinctrl support.

Signed-off-by: Vitaly Andrianov <[email protected]>
Signed-off-by: Franklin S Cooper Jr <[email protected]>
Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Dave Gerlach <[email protected]>
---
arch/arm/boot/dts/keystone-k2g.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2g.dtsi b/arch/arm/boot/dts/keystone-k2g.dtsi
index 7ff2796..b99e879 100644
--- a/arch/arm/boot/dts/keystone-k2g.dtsi
+++ b/arch/arm/boot/dts/keystone-k2g.dtsi
@@ -75,6 +75,13 @@
ranges = <0x0 0x0 0x0 0xc0000000>;
dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>;

+ k2g_pinctrl: pinmux@02621000 {
+ compatible = "pinctrl-single";
+ reg = <0x02621000 0x410>;
+ pinctrl-single,register-width = <32>;
+ pinctrl-single,function-mask = <0x001b0007>;
+ };
+
uart0: serial@02530c00 {
compatible = "ns16550a";
current-speed = <115200>;
--
2.7.0

2016-04-27 14:12:18

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH 5/5] ARM: dts: k2g-evm: Add pinmuxing for UART0

From: Lokesh Vutla <[email protected]>

Avoid depending on the bootloader or the ROM for configuring the pinmux by
explicitly setting the pinmux here.

Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Franklin S Cooper Jr <[email protected]>
Signed-off-by: Tero Kristo <[email protected]>
Signed-off-by: Dave Gerlach <[email protected]>
---
arch/arm/boot/dts/keystone-k2g-evm.dts | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2g-evm.dts b/arch/arm/boot/dts/keystone-k2g-evm.dts
index 5bfd9e7..692fcbb 100644
--- a/arch/arm/boot/dts/keystone-k2g-evm.dts
+++ b/arch/arm/boot/dts/keystone-k2g-evm.dts
@@ -27,6 +27,17 @@

};

+&k2g_pinctrl {
+ uart0_pins: pinmux_uart0_pins {
+ pinctrl-single,pins = <
+ K2G_CORE_IOPAD(0x11cc) (BUFFER_CLASS_B | PULL_DISABLE | MUX_MODE0) /* uart0_rxd.uart0_rxd */
+ K2G_CORE_IOPAD(0x11d0) (BUFFER_CLASS_B | PIN_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
+ >;
+ };
+};
+
&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins>;
status = "okay";
};
--
2.7.0

2016-04-27 14:12:39

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH 4/5] ARM: dts: keystone: Header file for pinctrl constants

From: Lokesh Vutla <[email protected]>

The pinctrl IP used in some of the Keystone 2 devices differ vs other
TI SoCs. Therefore, create a Keystone specific pinctrl header.

Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Franklin S Cooper Jr <[email protected]>
Signed-off-by: Tero Kristo <[email protected]>
Signed-off-by: Dave Gerlach <[email protected]>
---
arch/arm/boot/dts/keystone-k2g.dtsi | 1 +
include/dt-bindings/pinctrl/keystone.h | 39 ++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
create mode 100644 include/dt-bindings/pinctrl/keystone.h

diff --git a/arch/arm/boot/dts/keystone-k2g.dtsi b/arch/arm/boot/dts/keystone-k2g.dtsi
index b99e879..3372615 100644
--- a/arch/arm/boot/dts/keystone-k2g.dtsi
+++ b/arch/arm/boot/dts/keystone-k2g.dtsi
@@ -14,6 +14,7 @@
*/

#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/pinctrl/keystone.h>
#include "skeleton.dtsi"

/ {
diff --git a/include/dt-bindings/pinctrl/keystone.h b/include/dt-bindings/pinctrl/keystone.h
new file mode 100644
index 0000000..7f97d77
--- /dev/null
+++ b/include/dt-bindings/pinctrl/keystone.h
@@ -0,0 +1,39 @@
+/*
+ * This header provides constants for Keystone pinctrl bindings.
+ *
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _DT_BINDINGS_PINCTRL_KEYSTONE_H
+#define _DT_BINDINGS_PINCTRL_KEYSTONE_H
+
+#define MUX_MODE0 0
+#define MUX_MODE1 1
+#define MUX_MODE2 2
+#define MUX_MODE3 3
+#define MUX_MODE4 4
+#define MUX_MODE5 5
+
+#define BUFFER_CLASS_B (0 << 19)
+#define BUFFER_CLASS_C (1 << 19)
+#define BUFFER_CLASS_D (2 << 19)
+#define BUFFER_CLASS_E (3 << 19)
+
+#define PULL_DISABLE (1 << 16)
+#define PIN_PULLUP (1 << 17)
+#define PIN_PULLDOWN (0 << 17)
+
+#define KEYSTONE_IOPAD_OFFSET(pa, offset) (((pa) & 0xffff) - (offset))
+
+#define K2G_CORE_IOPAD(pa) KEYSTONE_IOPAD_OFFSET((pa), 0x1000)
+
+#endif
--
2.7.0

2016-04-27 14:13:38

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH 1/5] ARM: Keystone: Enable PINCTRL for Keystone ARCH

From: Lokesh Vutla <[email protected]>

Some Keystone 2 devices utilize pinmuxing which requires PINCTRL
to be enabled. Therefore, enable PINCTRL for all Keystone 2 devices.

Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Franklin S Cooper Jr <[email protected]>
Signed-off-by: Dave Gerlach <[email protected]>
---
arch/arm/mach-keystone/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
index ea955f6db..7a432ee 100644
--- a/arch/arm/mach-keystone/Kconfig
+++ b/arch/arm/mach-keystone/Kconfig
@@ -11,6 +11,7 @@ config ARCH_KEYSTONE
select ZONE_DMA if ARM_LPAE
select MIGHT_HAVE_PCI
select PCI_DOMAINS if PCI
+ select PINCTRL
help
Support for boards based on the Texas Instruments Keystone family of
SoCs.
--
2.7.0