2017-03-09 14:52:56

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 0/2] ARM64: dts: meson-gxbb-odroidc2: Add GPIO lines names

This patchset adds the GPIO lines names to describe the /real/ GPIO usage on
the Odroid-C2 board. These names are useful to have a clear and human readable
decription of the line usage.

The second patch is not specifically tied to the names but was found using
these descriptions since they did not match.

Here is an extract of the GPIO debugfs output :

# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-13, parent: platform/c8100000.aobus:pinctrl@14, aobus-banks:
gpio-0 (UART_TX_AO_A )
gpio-1 (UART_RX_AO_A )
gpio-2 (VCCK En )
gpio-3 (TF 3V3/1V8 En |? ) out lo
gpio-4 (USB HUB nRESET )
gpio-5 (USB OTG Power En |USB_OTG_PWR ) out lo
gpio-6 (J7 Header Pin2 )
gpio-7 (IR In )
gpio-8 (J7 Header Pin4 )
gpio-9 (J7 Header Pin6 )
gpio-10 (J7 Header Pin5 )
gpio-11 (J7 Header Pin7 )
gpio-12 (HDMI CEC )
gpio-13 (SYS LED |c2:blue:alive ) out hi
gpiochip1: GPIOs 14-132, parent: platform/c8834000.periphs:pinctrl@4b0, periphs-banks:
gpio-14 (Eth MDIO )
gpio-15 (Eth MDC )
gpio-16 (Eth RGMII RX Clk )
gpio-17 (Eth RX DV )
gpio-18 (Eth RX D0 )
gpio-19 (Eth RX D1 )
gpio-20 (Eth RX D2 )
gpio-21 (Eth RX D3 )
gpio-22 (Eth RGMII TX Clk )
[...]
gpio-115 (J2 Header Pin15 )
gpio-116 (J2 Header Pin12 )
gpio-117 (J2 Header Pin13 )
gpio-118 (J2 Header Pin8 )
gpio-119 (J2 Header Pin10 )
gpio-120 ( )
gpio-121 ( )
gpio-122 ( )
gpio-123 ( )
gpio-124 ( )
gpio-125 (J2 Header Pin11 )
gpio-126 ( )
gpio-127 (J2 Header Pin7 )
gpio-128 ( )
gpio-129 ( )
gpio-130 ( )
gpio-131 ( )
gpio-132 ( )

And the 'lsgpio' tool using the new char interface for GPIO handling :
# lsgpio
GPIO chip: gpiochip1, "periphs-banks", 119 GPIO lines
line 0: "Eth MDIO" unused
line 1: "Eth MDC" unused
line 2: "Eth RGMII RX Clk" unused
line 3: "Eth RX DV" unused
line 4: "Eth RX D0" unused
line 5: "Eth RX D1" unused
line 6: "Eth RX D2" unused
line 7: "Eth RX D3" unused
line 8: "Eth RGMII TX Clk" unused
line 9: "Eth TX En" unused
line 10: "Eth TX D0" unused
line 11: "Eth TX D1" unused
line 12: "Eth TX D2" unused
line 13: "Eth TX D3" unused
line 14: "Eth PHY nRESET" unused
line 15: "Eth PHY Intc" unused
line 16: "HDMI HPD" unused
line 17: "HDMI DDC SDA" unused
line 18: "HDMI DDC SCL" unused
line 19: unnamed unused
line 20: "eMMC D0" unused
line 21: "eMMC D1" unused
line 22: "eMMC D2" unused
line 23: "eMMC D3" unused
line 24: "eMMC D4" unused
[...]
line 115: unnamed unused
line 116: unnamed unused
line 117: unnamed unused
line 118: unnamed unused
GPIO chip: gpiochip0, "aobus-banks", 14 GPIO lines
line 0: "UART_TX_AO_A" unused
line 1: "UART_RX_AO_A" unused
line 2: "VCCK En" unused
line 3: "TF 3V3/1V8 En" "?" [kernel output]
line 4: "USB HUB nRESET" unused
line 5: "USB OTG Power En" "USB_OTG_PWR" [kernel output]
line 6: "J7 Header Pin2" unused
line 7: "IR In" unused
line 8: "J7 Header Pin4" unused
line 9: "J7 Header Pin6" unused
line 10: "J7 Header Pin5" unused
line 11: "J7 Header Pin7" unused
line 12: "HDMI CEC" unused
line 13: "SYS LED" "c2:blue:alive" [kernel output active-low]

Neil Armstrong (2):
ARM64: dts: meson-gxbb-odroidc2: Add GPIO lines names
ARM64: dts: meson-gxbb-odroidc2: Fix TFLASH VDD regulator GPIO line

.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 53 +++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)

--
1.9.1


2017-03-09 14:52:57

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 1/2] ARM64: dts: meson-gxbb-odroidc2: Add GPIO lines names

This patch describes the GPIO lines usage on the Odroid-C2 board.

This is useful in the debugfs gpio file and using the cdev gpio API.

Signed-off-by: Neil Armstrong <[email protected]>
---
.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index c59403a..def5aed 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -165,6 +165,57 @@
};
};

+&pinctrl_aobus {
+ gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En",
+ "USB HUB nRESET", "USB OTG Power En",
+ "J7 Header Pin2", "IR In", "J7 Header Pin4",
+ "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7",
+ "HDMI CEC", "SYS LED";
+};
+
+&pinctrl_periphs {
+ gpio-line-names = /* Bank GPIOZ */
+ "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk",
+ "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
+ "Eth RX D3", "Eth RGMII TX Clk", "Eth TX En",
+ "Eth TX D0", "Eth TX D1", "Eth TX D2", "Eth TX D3",
+ "Eth PHY nRESET", "Eth PHY Intc",
+ /* Bank GPIOH */
+ "HDMI HPD", "HDMI DDC SDA", "HDMI DDC SCL", "",
+ /* Bank BOOT */
+ "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", "eMMC D4",
+ "eMMC D5", "eMMC D6", "eMMC D7", "eMMC Clk",
+ "eMMC Reset", "eMMC CMD",
+ "", "", "", "", "", "", "",
+ /* Bank CARD */
+ "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
+ "SDCard D3", "SDCard D2", "SDCard Det",
+ /* Bank GPIODV */
+ "", "", "", "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "", "",
+ "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK",
+ "PWM D", "PWM B",
+ /* Bank GPIOY */
+ "Revision Bit0", "Revision Bit1", "",
+ "J2 Header Pin35", "", "", "", "J2 Header Pin36",
+ "J2 Header Pin31", "", "", "", "TF VDD En",
+ "J2 Header Pin32", "J2 Header Pin26", "", "",
+ /* Bank GPIOX */
+ "J2 Header Pin29", "J2 Header Pin24",
+ "J2 Header Pin23", "J2 Header Pin22",
+ "J2 Header Pin21", "J2 Header Pin18",
+ "J2 Header Pin33", "J2 Header Pin19",
+ "J2 Header Pin16", "J2 Header Pin15",
+ "J2 Header Pin12", "J2 Header Pin13",
+ "J2 Header Pin8", "J2 Header Pin10",
+ "", "", "", "", "",
+ "J2 Header Pin11", "", "J2 Header Pin7",
+ /* Bank GPIOCLK */
+ "", "", "", "",
+ /* GPIO_TEST_N */
+ "";
+};
+
&ir {
status = "okay";
pinctrl-0 = <&remote_input_ao_pins>;
--
1.9.1

2017-03-09 14:53:33

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 2/2] ARM64: dts: meson-gxbb-odroidc2: Fix TFLASH VDD regulator GPIO line

The wrong GPIO line was provided here.

Fixes: ef8d2ffedf18 ("ARM64: dts: meson-gxbb: add MMC support")
Signed-off-by: Neil Armstrong <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index def5aed..a03b9b2 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -96,7 +96,7 @@
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;

- gpio = <&gpio_ao GPIOAO_12 GPIO_ACTIVE_HIGH>;
+ gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

--
1.9.1

2017-03-15 09:49:14

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/2] ARM64: dts: meson-gxbb-odroidc2: Add GPIO lines names

On Thu, Mar 9, 2017 at 3:52 PM, Neil Armstrong <[email protected]> wrote:

> This patch describes the GPIO lines usage on the Odroid-C2 board.
>
> This is useful in the debugfs gpio file and using the cdev gpio API.
>
> Signed-off-by: Neil Armstrong <[email protected]>

Very helpful.
Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2017-03-22 18:08:23

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 0/2] ARM64: dts: meson-gxbb-odroidc2: Add GPIO lines names

Neil Armstrong <[email protected]> writes:

> This patchset adds the GPIO lines names to describe the /real/ GPIO usage on
> the Odroid-C2 board. These names are useful to have a clear and human readable
> decription of the line usage.

Applied to v4.12/dt64,

Thanks,

Kevin