DT labels for connector device mapping
Subsystems (4)
Rob Herring
maintainercover DT labels for connector device mapping
Having a common connector interface across different platforms can be problematic for determining which SOC device is connected to which connector pins. The standard DT property "label" is intended to provide a human readable name for a device and can be used to provide this information. Then userspace can can read the label to determine the device mapping. For example:
for f in $(ls -d /sys/class/tty/tty*); do
label=$(cat $f/device/of_node/label)
if [ "$label" = "LS-UART1" ]; then
# you've found UART1, so do something with it. # $f/dev is the major:minor for the /dev node
fi
done
This series adds labels on hikey and dragonboard 410c devices for the low speed and high speed connectors. Not tested at all.
BTW, there are no platform maintainers listed for these files. Setting them should be enforced for the dts files as DT maintainers mainly review binding docs, not dts files.
Rob
Rob Herring (3):
arm64: dts: apq8016-sbc: enable UART0 on LS connector
arm64: dts: apq8016-sbc: add label properties for UART, I2C, and SPI
arm64: dts: hikey: add label properties to UARTs
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 7 +++++++ arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 14 ++++++++++++++ 2 files changed, 21 insertions(+)
Signature · 1 line
2.5.0
Rob Herring
maintainerPATCH 1/3 arm64: dts: apq8016-sbc: enable UART0 on LS connector
The LS UART0 is not used by anything else and should be enabled for expansion boards.
--- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +7 -0
@@ -27,6 +27,13 @@ }; soc { + serial at 78af000 { + status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&blsp1_uart1_default>; + pinctrl-1 = <&blsp1_uart1_sleep>; + }; + serial at 78b0000 { status = "okay"; pinctrl-names = "default", "sleep";
Signature · 1 line
2.5.0
Rob Herring
maintainerPATCH 2/3 arm64: dts: apq8016-sbc: add label properties for UART, I2C, and SPI
In reply to Rob HerringAdd label properties to provide a way to identify UART, I2C and SPI ports based on their connector names. This follows naming convention in 96boards CE spec. Ports without external connections are not labelled.
--- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +7 -0
@@ -28,6 +28,7 @@ soc { serial at 78af000 { + label = "LS-UART0"; status = "okay"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&blsp1_uart1_default>;
@@ -35,6 +36,7 @@ }; serial at 78b0000 { + label = "LS-UART1"; status = "okay"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&blsp1_uart2_default>;
@@ -43,26 +45,31 @@ i2c at 78b6000 { /* On Low speed expansion */ + label = "LS-I2C0"; status = "okay"; }; i2c at 78b8000 { /* On High speed expansion */ + label = "HS-I2C2"; status = "okay"; }; i2c at 78ba000 { /* On Low speed expansion */ + label = "LS-I2C1"; status = "okay"; }; spi at 78b7000 { /* On High speed expansion */ + label = "HS-SPI1"; status = "okay"; }; spi at 78b9000 { /* On Low speed expansion */ + label = "LS-SPI0"; status = "okay"; };
Signature · 1 line
2.5.0
PATCH 2/3 arm64: dts: apq8016-sbc: add label properties for UART, I2C, and SPI
Quoted 7 lines · Rob Herring
Add label properties to provide a way to identify UART, I2C and SPI ports based on their connector names. This follows naming convention in 96boards CE spec. Ports without external connections are not labelled.
Signed-off-by Rob Herring <[email protected]>Cc Srinivas Kandagatla <[email protected]>Cc Andy Gross <[email protected]>
Tested this on my db410c (along with script from cover letter) and it works great.
Kevin
Rob Herring
maintainerPATCH 3/3 arm64: dts: hikey: add label properties to UARTs
In reply to Rob HerringAdd label properties to provide a way to identify UARTs based on their board or connector name. This follows naming convention in 96boards CE spec. Ports without external connections are not labelled.
--- arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +7 -0
@@ -32,3 +32,10 @@ reg = <0x0 0x0 0x0 0x40000000>; }; }; + +&uart2 { + label = "LS-UART0"; +}; +&uart3 { + label = "LS-UART1"; +};
Signature · 1 line
2.5.0
cover DT labels for connector device mapping
In reply to Rob HerringQuoted 15 lines · Rob Herring
Having a common connector interface across different platforms can be problematic for determining which SOC device is connected to which connector pins. The standard DT property "label" is intended to provide a human readable name for a device and can be used to provide this information. Then userspace can can read the label to determine the device mapping. For example:
for f in $(ls -d
/sys/class/tty/tty*); do
label=$(cat $f/device/of_node/label)
if [ "$label" = "LS-UART1" ]; then
# you've found UART1, so do something with it. # $f/dev is the major:minor for the /dev node
fi
done
Quoted 2 lines
This series adds labels on hikey and dragonboard 410c devices for the low speed and high speed connectors. Not tested at all.
should we then use the line-name property on the GPIOs to have a common naming convention across all 96Boards boards?
Rob Herring
maintainercover DT labels for connector device mapping
Quoted 16 lines · Jorge Ramirez-Ortiz
Quoted 15 lines · Rob Herring
Having a common connector interface across different platforms can be problematic for determining which SOC device is connected to which connector pins. The standard DT property "label" is intended to provide a human readable name for a device and can be used to provide this information. Then userspace can can read the label to determine the device mapping. For example:
for f in $(ls -d
/sys/class/tty/tty*); do
label=$(cat $f/device/of_node/label)
if [ "$label" = "LS-UART1" ]; then
# you've found UART1, so do something with it. # $f/dev is the major:minor for the /dev node
fi
done
Quoted 5 lines
Quoted 2 lines
This series adds labels on hikey and dragonboard 410c devices for the low speed and high speed connectors. Not tested at all.
should we then use the line-name property on the GPIOs to have a common naming convention across all 96Boards boards?
I left GPIOs out purpose, but they do need to be handled. I'm not certain that gpio-hogs is what we want to use here. The other cases have no s/w impact as label is ignored. The same is not true of gpio-hogs. Also, if we consider that we may want to describe GPIO connections to daughterboards with DT overlays, then we wound not want the gpio-hogs in the DT. That gets into a whole other set of issues needing a way to remap connector signals to have overlays which work across different base boards.
Rob
Olof Johansson
Appliedcover DT labels for connector device mapping
In reply to Rob HerringQuoted 22 lines · Rob Herring
Having a common connector interface across different platforms can be problematic for determining which SOC device is connected to which connector pins. The standard DT property "label" is intended to provide a human readable name for a device and can be used to provide this information. Then userspace can can read the label to determine the device mapping. For example:
for f in $(ls -d
/sys/class/tty/tty*); do
label=$(cat $f/device/of_node/label)
if [ "$label" = "LS-UART1" ]; then
# you've found UART1, so do something with it. # $f/dev is the major:minor for the /dev node
fi
doneThis series adds labels on hikey and dragonboard 410c devices for the low speed and high speed connectors. Not tested at all.
BTW, there are no platform maintainers listed for these files. Setting them should be enforced for the dts files as DT maintainers mainly review binding docs, not dts files.
Quoted 6 lines
Rob
Rob Herring (3):
arm64: dts: apq8016-sbc: enable UART0 on LS connector
arm64: dts: apq8016-sbc: add label properties for UART, I2C, and SPI
arm64: dts: hikey: add label properties to UARTs
Applied all 3 to next/dt64.
-Olof