arm: dts: sun7i-a20-bananapi: name the GPIO lines
Subsystems (2)
PATCH 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
This names the GPIO lines on the Banana Pi board in accordance with the A20_Banana_Pi v1.4 Specification.
This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linux Wallej patch.
--- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)
arch/arm/boot/dts/sun7i-a20-bananapi.dts +60 -0
@@ -178,6 +178,66 @@ }; &pio { + /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + * LSEC = Low Speed External Connector + * HSEC = High Speed External Connector + */ + gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "[USB0-DRV]", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "SCL", "SDA", "", "", + "", "", "", "", "", "", "", "", + /* PC */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PD */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PE */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PF */ + "[SD0-D1]", "[SD0-D0]", "[SD0-CLK]", "[SD0-CMD]", "[SD0-D3]", + "[SD0-D2]", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PG */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PH */ + "TXD0", "RXD0", "IO-1", "PH3", "[USB0-IDDET]", "PH5", "", "", + "", "", "[SD0-DET]", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "[EMAC-PWR-EN]", + "[LED1]", "NC", "NC", "NC", "", "", "", "", + /* PI */ + "", "", "", "IO-GCLK", "NC", "NC", "NC", "NC", + "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "", + "", "", "", "", "", "", "", ""; + usb0_id_detect_pin: usb0_id_detect_pin at 0 { allwinner,pins = "PH4"; allwinner,function = "gpio_in";
Signature · 1 line
2.7.4
PATCH 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 7 lines · Oleksij Rempel
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Quoted 6 lines
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linux Wallej patch.
LinuS
Quoted 6 lines
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>
Nice usecase!
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 189
Quoted 9 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +9
-0+ /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + * LSEC = Low Speed External Connector + * HSEC = High Speed External Connector + */
So maybe we should make this naming convention a suggested standard. People seem to like it.
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 201
Quoted 12 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +12
-0+ gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "[USB0-DRV]", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "SCL", "SDA", "", "",
Are these bit-banged SCL and SDA for doing I2C with GPIO? Otherwise you probably want to name them "[SCL]" and "[SDA]"
Quoted 1 line
+ "TXD0", "RXD0", "IO-1", "PH3", "[USB0-IDDET]", "PH5", "", "",
Same here. You probably want "[TXD0]" etc unless you're bit-banging the serial port. "IO-1" sounds like a real GPIO though and should probably be named like that without [] and "PH3" what is that really? A device-muxed pin or some kind of GPIO?
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 232
Quoted 2 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +2
-0+ "", "", "[SD0-DET]", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "[EMAC-PWR-EN]",
So these seem correct too.
Quoted 1 line
+ "[LED1]", "NC", "NC", "NC", "", "", "", "",
"LED1" seems like the right name, if this is a GPIO used to drive a LED.
Quoted 1 line
+ "", "", "", "IO-GCLK", "NC", "NC", "NC", "NC",
WHat is IO-GCLK? A real GPIO line used for toggling a clock? Or a hardware clock signal? In the first case it it correctly named, in the other case it should be "[IO-GCLK]".
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 238
Quoted 3 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +3
-0+ "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "",
Looks right.
Yours,
Linus Walleij
PATCH 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 19 lines · Linus Walleij
Quoted 7 lines · Oleksij Rempel
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Quoted 6 lines
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linux Wallej patch.
LinuS
Quoted 1 line
Quoted 16 lines
Quoted 5 lines
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>Nice usecase!
Quoted 8 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +8
-0+ /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + * LSEC = Low Speed External Connector + * HSEC = High Speed External Connector
I don't see LSEC/HSEC used anywhere?
Quoted 4 lines
Quoted 1 line
+ */
So maybe we should make this naming convention a suggested standard. People seem to like it.
One question about this whole thing: how extensively should we add the names? Only for exposed pins? Or every pin that's routed/used?
Quoted 13 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 201
Quoted 12 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +12
-0+ gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "[USB0-DRV]", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "SCL", "SDA", "", "",
Quoted 2 lines
Are these bit-banged SCL and SDA for doing I2C with GPIO? Otherwise you probably want to name them "[SCL]" and "[SDA]"
There's an actual I2C controller backing them.
Quoted 7 lines
Quoted 2 lines
+ "TXD0", "RXD0", "IO-1", "PH3", "[USB0-IDDET]", "PH5", "", "",
Same here. You probably want "[TXD0]" etc unless you're bit-banging the serial port. "IO-1" sounds like a real GPIO though and should probably be named like that without [] and "PH3" what is that really? A device-muxed pin or some kind of GPIO?
PH3 is actually the pin name. The vendor uses "IO-7" and "IO-8" as function names for PH3 and PH5, but actually names them "NC":
http://www.bananapi.org/p/product.html
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 232
Quoted 3 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +2
-0+ "", "", "[SD0-DET]", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "[EMAC-PWR-EN]",So these seem correct too.
Quoted 1 line
+ "[LED1]", "NC", "NC", "NC", "", "", "", "",
"LED1" seems like the right name, if this is a GPIO used to drive a LED.
This is GPIO based.
Quoted 6 lines
Quoted 2 lines
+ "", "", "", "IO-GCLK", "NC", "NC", "NC", "NC",
WHat is IO-GCLK? A real GPIO line used for toggling a clock? Or a hardware clock signal? In the first case it it correctly named, in the other case it should be "[IO-GCLK]".
According to the schematics this is a PWM output.
Regards
ChenYu
Quoted 9 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 238
Quoted 4 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +3
-0+ "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "",Looks right.
Yours,
Linus Walleij
PATCH 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 11 lines · Chen-Yu Tsai
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Oleksij Rempel
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linux Wallej patch.
LinuS
oops... :)
Quoted 18 lines
Quoted 17 lines
Quoted 6 lines
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>Nice usecase!
Quoted 8 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +8
-0+ /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + * LSEC = Low Speed External Connector + * HSEC = High Speed External Connector
Quoted 1 line
I don't see LSEC/HSEC used anywhere?
ok, will remove it. Probably it will be better to have it in common place some where by the Docs?
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
+ */
So maybe we should make this naming convention a suggested standard. People seem to like it.
Why should i invent some thing new, some Docs with suggested names will be good.
Quoted 2 lines
One question about this whole thing: how extensively should we add the names? Only for exposed pins? Or every pin that's routed/used?
Depends on HW. Even on production system i had cases where i need to jump in and use some random pin for debugging. So, hawing it in devicetree can help to reduce time later.
But i would prefer to have some kind of merged names: Names provided by SoC descriptor (real pin names or locations) and names provided by board design.
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +12
-0+ gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "[USB0-DRV]", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "SCL", "SDA", "", "",
Quoted 4 lines
Quoted 2 lines
Are these bit-banged SCL and SDA for doing I2C with GPIO? Otherwise you probably want to name them "[SCL]" and "[SDA]"
There's an actual I2C controller backing them.
Ok, i will fix it.
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
+ "TXD0", "RXD0", "IO-1", "PH3", "[USB0-IDDET]", "PH5", "", "",
Same here. You probably want "[TXD0]" etc unless you're bit-banging the serial port. "IO-1" sounds like a real GPIO though and should probably be named like that without [] and "PH3" what is that really? A device-muxed pin or some kind of GPIO?
PH3 is actually the pin name. The vendor uses "IO-7" and "IO-8" as function names for PH3 and PH5, but actually names them "NC":
Not in:
https://linux-sunxi.org/images/9/9d/A20_Bananapi_Schematic.pdf
which was used for this patch.
Quoted 6 lines
http://www.bananapi.org/p/product.html
Quoted 4 lines
Quoted 3 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +2
-0+ "", "", "[SD0-DET]", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "[EMAC-PWR-EN]",
Quoted 8 lines
Quoted 6 lines
So these seem correct too.
Quoted 1 line
+ "[LED1]", "NC", "NC", "NC", "", "", "", "",
"LED1" seems like the right name, if this is a GPIO used to drive a LED.
This is GPIO based.
This was not clear to me, marking GPIO pin as peripheral, at moment of writing and testing it was a allocated by led driver. Bit for example IO-GCLK was free to use for GPIO :).. so do [] actually make sense?
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
+ "", "", "", "IO-GCLK", "NC", "NC", "NC", "NC",
WHat is IO-GCLK? A real GPIO line used for toggling a clock? Or a hardware clock signal? In the first case it it correctly named, in the other case it should be "[IO-GCLK]".
According to the schematics this is a PWM output.
there are two names:
SoC name: PWM1
Connector name: IO-GCLK
Which should be used. IMO it was user friendly to use connector name.
Quoted 12 lines
Regards
ChenYuQuoted 9 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 238
Quoted 4 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +3
-0+ "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "",Looks right.
Yours,
Linus Walleij
PATCH 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 4 lines · fixed-term.Oleksij.Rempel
Quoted 2 lines · Chen-Yu Tsai
On Fri, Jul 22, 2016 at 10:55 PM, Linus Walleij
<[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
"LED1" seems like the right name, if this is a GPIO used to drive a LED.
This is GPIO based.
This was not clear to me, marking GPIO pin as peripheral, at moment of writing and testing it was a allocated by led driver. Bit for example IO-GCLK was free to use for GPIO :).. so do [] actually make sense?
I would say if the hardware is used in GPIO mode, i.e. if the hardware registers of the GPIO block is written to activate the LED, then it is "LED1".
If there would be a specific LED driver block that disables the GPIO block to be used for the same lines and have its registers elsewhere, it would be "[LED1]".
So proper names "FOO" is for the case where the GPIO output is used as GPIO.
Yours,
Linus Walleij
PATCH 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
This names the GPIO lines on the Banana Pi board in accordance with the A20_Banana_Pi v1.4 Specification.
This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linux Wallej patch.
--- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
arch/arm/boot/dts/sun7i-a20-bananapi.dts +58 -0
@@ -178,6 +178,64 @@ }; &pio { + /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + */ + gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "USB0-DRV", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "[SCL]", "[SDA]", "", "", + "", "", "", "", "", "", "", "", + /* PC */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PD */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PE */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PF */ + "[SD0-D1]", "[SD0-D0]", "[SD0-CLK]", "[SD0-CMD]", "[SD0-D3]", + "[SD0-D2]", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PG */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PH */ + "TXD0", "RXD0", "IO-1", "IO-8", "USB0-IDDET", "IO-7", "", "", + "", "", "SD0-DET", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "EMAC-PWR-EN", + "LED1", "NC", "NC", "NC", "", "", "", "", + /* PI */ + "", "", "", "[IO-GCLK]", "NC", "NC", "NC", "NC", + "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "", + "", "", "", "", "", "", "", ""; + usb0_id_detect_pin: usb0_id_detect_pin at 0 { allwinner,pins = "PH4"; allwinner,function = "gpio_in";
Signature · 1 line
2.7.4
PATCH v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
In reply to Linus WalleijThis names the GPIO lines on the Banana Pi board in accordance with the A20_Banana_Pi v1.4 Specification.
This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linus Wallej patch.
--- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
arch/arm/boot/dts/sun7i-a20-bananapi.dts +58 -0
@@ -178,6 +178,64 @@ }; &pio { + /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + */ + gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "USB0-DRV", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "[SCL]", "[SDA]", "", "", + "", "", "", "", "", "", "", "", + /* PC */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PD */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PE */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PF */ + "[SD0-D1]", "[SD0-D0]", "[SD0-CLK]", "[SD0-CMD]", "[SD0-D3]", + "[SD0-D2]", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PG */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PH */ + "TXD0", "RXD0", "IO-1", "IO-8", "USB0-IDDET", "IO-7", "", "", + "", "", "SD0-DET", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "EMAC-PWR-EN", + "LED1", "NC", "NC", "NC", "", "", "", "", + /* PI */ + "", "", "", "[IO-GCLK]", "NC", "NC", "NC", "NC", + "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "", + "", "", "", "", "", "", "", ""; + usb0_id_detect_pin: usb0_id_detect_pin at 0 { allwinner,pins = "PH4"; allwinner,function = "gpio_in";
Signature · 1 line
2.7.4
PATCH v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 12 lines · Oleksij Rempel
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Quoted 7 lines
Ps: most of the text was taken from Linus Wallej patch.
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>
Yours,
Linus Walleij
PATCH v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Am 08.08.2016 um 19:51 schrieb Linus Walleij:
Quoted 22 lines · Oleksij Rempel
Quoted 13 lines
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Quoted 7 lines
Ps: most of the text was taken from Linus Wallej patch.
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>
Quoted 4 lines
Acked-by Linus Walleij <[email protected]>Yours,
Linus Walleij
Hm... i assume this patch was lost. Should i resend it?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170428/8543b817/attachment.sig>
PATCH v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 23 lines · Oleksij Rempel
Am 08.08.2016 um 19:51 schrieb Linus Walleij:
Quoted 22 lines · Oleksij Rempel
Quoted 20 lines
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linus Wallej patch.
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>
Quoted 6 lines
Quoted 4 lines
Acked-by Linus Walleij <[email protected]>Yours,
Linus WalleijHm... i assume this patch was lost. Should i resend it?
Yes, but I'm not applying DTS patches. Make sure that the sunxi maintainers get it and merge it.
Yours,
Linus Walleij
PATCH v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Am 28.04.2017 um 10:45 schrieb Linus Walleij:
Quoted 24 lines · Oleksij Rempel
Quoted 23 lines
Am 08.08.2016 um 19:51 schrieb Linus Walleij:
Quoted 22 lines · Oleksij Rempel
Quoted 20 lines
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Ps: most of the text was taken from Linus Wallej patch.
Cc devicetree at vger.kernel.orgCc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Signed-off-by Oleksij Rempel <[email protected]>
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Acked-by Linus Walleij <[email protected]>Hm... i assume this patch was lost. Should i resend it?
Yes, but I'm not applying DTS patches. Make sure that the sunxi maintainers get it and merge it.
Chen-Yu Tsai - ping.
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170428/8788475c/attachment.sig>
PATCH RESEND v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
In reply to Linus WalleijThis names the GPIO lines on the Banana Pi board in accordance with the A20_Banana_Pi v1.4 Specification.
This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
--- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)
arch/arm/boot/dts/sun7i-a20-bananapi.dts +60 -0
@@ -178,6 +178,66 @@ }; &pio { + /* + * Legend: proper name = the GPIO line is used as GPIO + * NC = not connected (not routed from the SoC) + * "[PER]" = pin is muxed for peripheral (not GPIO) + * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + * LSEC = Low Speed External Connector + * HSEC = High Speed External Connector + */ + gpio-line-names = + /* PA */ + "[ERXD3]", "[ERXD2]", "[ERXD1]", "[ERXD0]", "[ETXD3]", + "[ETXD2]", "[ETXD1]", "[ETXD0]", + "[ERXCK]", "[ERXERR]", "[ERXDV]", "[EMDC]", "[EMDIO]", + "[ETXEN]", "[ETXCK]", "[ECRS]", + "[ECOL]", "[ETXERR]", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PB */ + "[PMU-SCK]", "[PMU-SDA]", "", "", "", "NC", "NC", "NC", + "NC", "[USB0-DRV]", "NC", "NC", "NC", "NC", "", "", + "", "", "", "", "SCL", "SDA", "", "", + "", "", "", "", "", "", "", "", + /* PC */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PD */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PE */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PF */ + "[SD0-D1]", "[SD0-D0]", "[SD0-CLK]", "[SD0-CMD]", "[SD0-D3]", + "[SD0-D2]", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PG */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* PH */ + "TXD0", "RXD0", "IO-1", "PH3", "[USB0-IDDET]", "PH5", "", "", + "", "", "[SD0-DET]", "", "", "", "", "", + "NC", "", "", "", "IO-4", "IO-5", "NC", "[EMAC-PWR-EN]", + "[LED1]", "NC", "NC", "NC", "", "", "", "", + /* PI */ + "", "", "", "IO-GCLK", "NC", "NC", "NC", "NC", + "NC", "NC", "[SPI-CE0]", "[SPI-CLK]", "[SPI-MOSI]", + "[SPI-MISO]", "[SPI-CE1]", "NC", + "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "", + "", "", "", "", "", "", "", ""; + usb0_id_detect_pin: usb0_id_detect_pin at 0 { pins = "PH4"; function = "gpio_in";
Signature · 1 line
2.7.4
PATCH RESEND v2 1/1 arm: dts: sun7i-a20-bananapi: name the GPIO lines
Quoted 27 lines · Oleksij Rempel
This names the GPIO lines on the Banana Pi board in accordance with the
A20_Banana_Piv1.4 Specification.This will make these line names reflect through to userspace so that they can easily be identified and used with the new character device ABI.
Some care has been taken to name all lines, not just those used by the external connectors, also lines that are muxed into some other function than GPIO: these are named "[FOO]" so that users can see with lsgpio what all lines are used for.
Signed-off-by Oleksij Rempel <[email protected]>Acked-by Linus Walleij <[email protected]>Cc devicetree at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc Chen-Yu Tsai <[email protected]>Cc Maxime Ripard <[email protected]>--- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)arch/arm/boot/dts/sun7i-a20-bananapi.dts +0
-0
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 182
Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +2
-0@@ -178,6 +178,66 @@ }; &pio { + /* + * Legend: proper name = the GPIO line is used as GPIO
I'm not convinced that a legend here is helpful in any way. No end user is going to even search for it here.
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 183
Quoted 1 line
arch/arm/boot/dts/sun7i-a20-bananapi.dts +1
-0+ * NC = not connected (not routed from the SoC)
Judging from the binding documentation, this should be the same than "".
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 184
Quoted 1 line
arch/arm/boot/dts/sun7i-a20-bananapi.dts +1
-0+ * "[PER]" = pin is muxed for peripheral (not GPIO)
We don't need the brackets. You have no guarantee that it is actually muxed, and will need to get that info from somewhere else either way. This is also not a syntax that is in the generic binding definition.
arch/arm/boot/dts/sun7i-a20-bananapi.dts line 188
Quoted 4 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts +4
-0+ * "" = no idea, schematic doesn't say, could be + * unrouted (not connected to any external pin) + * LSEC = Low Speed External Connector + * HSEC = High Speed External Connector
And both of those are not used.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170504/86a6ce79/attachment.sig>