[PATCH v1 22/23] board: nbxv3: enable GPIO controllers with line names and hogs

Vincent Jardin <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <20260817153144.1951036-23-vjardin__24857.4714920082$1786981127$gmane$org@free.fr>
Label every pin via gpio-line-names so `gpio status` prints meaningful names.

Most pads on this module are alt function consumed (UART, IIC, SDHC,
XSPI, RGMII); those keep an "altfn:" prefixed name, not connected pins
"nc", and the lines with a real GPIO identity.

defconfig: CONFIG_MPC8XXX_GPIO ("fsl,qoriq-gpio" driver),
CONFIG_CMD_GPIO, and CONFIG_GPIO_HOG so the hogs can be applied.

Signed-off-by: Vincent Jardin <[email protected]>
---

 arch/arm/dts/fsl-lx2160a-nbxv3.dts | 161 +++++++++++++++++++++++++++++
 configs/nbxv3_tfa_defconfig        |   3 +
 2 files changed, 164 insertions(+)

diff --git a/arch/arm/dts/fsl-lx2160a-nbxv3.dts b/arch/arm/dts/fsl-lx2160a-nbxv3.dts
index d2e4cb53bf1..40b76cec333 100644
--- a/arch/arm/dts/fsl-lx2160a-nbxv3.dts
+++ b/arch/arm/dts/fsl-lx2160a-nbxv3.dts
@@ -368,3 +368,164 @@
 &wdt0 {
 	timeout-sec = <120>;
 };
+
+/* GPIO misc helper namings based on lx2160arm documentation */
+&gpio0 {
+	gpio-line-names =
+		"nc", "nc",
+		"altfn:iic1-scl",
+		"altfn:iic1-sda",
+		"altfn:uart4-sin",
+		"altfn:uart4-sout",
+		"altfn:uart2-sin",
+		"altfn:uart2-sout-cfg-rcw-src0",
+		"altfn:uart3-sin",
+		"altfn:uart3-sout",
+		"altfn:uart1-sin",
+		"altfn:uart1-sout-cfg-rcw-src1",
+		"altfn:spi3-pcs3",
+		"altfn:spi3-pcs2",
+		"altfn:spi3-pcs1",
+		"altfn:spi3-pcs0",
+		"altfn:spi1-sck",
+		"altfn:spi1-sin",
+		"altfn:spi1-pcs2",
+		"altfn:spi1-pcs1",
+		"altfn:spi1-pcs0-u1700-zl30733",
+		"altfn:spi1-sout",
+		"altfn:iic6-sda",
+		"altfn:iic6-scl",
+		"altfn:spi3-sin",
+		"altfn:spi3-sout",
+		"altfn:iic4-sda",
+		"altfn:iic4-scl",
+		"altfn:iic3-sda",
+		"altfn:iic3-scl",
+		"altfn:iic2-sda",
+		"altfn:iic2-scl";
+};
+
+&gpio1 {
+	gpio-line-names =
+		"nc", "nc", "nc", "nc", "nc", "nc",
+		"cfg-rcw-src2",
+		"cfg-rcw-src3",
+		"reset-req-b",
+		"altfn:sdhc2-clk-u700-emmc",
+		"altfn:sdhc2-ds-u700-emmc",
+		"altfn:sdhc2-dat0-u700-emmc",
+		"altfn:sdhc2-dat1-u700-emmc",
+		"altfn:sdhc2-dat2-u700-emmc",
+		"altfn:sdhc2-dat3-u700-emmc",
+		"altfn:sdhc2-dat4-u700-emmc",
+		"altfn:sdhc2-dat5-u700-emmc",
+		"altfn:sdhc2-dat6-u700-emmc",
+		"altfn:sdhc2-dat7-u700-emmc",
+		"altfn:sdhc2-cmd-u700-emmc",
+		"cfg-svr1",
+		"altfn:xspi1-cs0-u1000-u1100-gd55lb02gf",
+		"altfn:xspi1-sck-cfg-eng-use0",
+		"thermtrip",
+		"altfn:xspi1-data0-mosi",
+		"altfn:xspi1-data1-miso",
+		"nc",
+		"nc",
+		"u1000-u1100-gd55lb02gf-reset#",
+		"pltrst#",
+		"nc",
+		"ethsw-reset#";
+
+	pltrst-hog {
+		gpio-hog;
+		gpios = <29 1>;
+		output-low;
+		line-name = "pltrst-deassert";
+	};
+
+	thermtrip-hog {
+		gpio-hog;
+		gpios = <23 0>;
+		output-low;
+		line-name = "thermtrip-deassert";
+	};
+
+	flash-reset-hog {
+		gpio-hog;
+		gpios = <28 1>;
+		output-low;
+		line-name = "flash-reset-deassert";
+	};
+
+	ethsw-reset-hog {
+		gpio-hog;
+		gpios = <31 0>;
+		output-high;
+		line-name = "ethsw-reset-deassert";
+	};
+};
+
+&gpio2 {
+	gpio-line-names =
+		"irq00#",
+		"i2c2-alert#",
+		"i2c4-alert#",
+		"i2c6-alert#",
+		"u800-tca9539-int#",
+		"spi3-alert#",
+		"wake0",
+		"wake1",
+		"carrier-hot#",
+		"u1300-rtl8211fd-int#",
+		"ethsw-int#",
+		"nc",
+		"nc",
+		"u1700-zl30733-clk-gpio0",
+		"u1700-zl30733-clk-gpio1",
+		"u1700-zl30733-clk-gpio2",
+		"u1700-zl30733-clk-gpio3",
+		"nc", "nc", "nc", "nc", "nc", "nc", "nc", "nc",
+		"nc", "nc", "nc", "nc", "nc", "nc", "nc";
+};
+
+&gpio3 {
+	gpio-line-names =
+		"altfn:ec1-txd3-rgmii1",
+		"altfn:ec1-txd2-rgmii1",
+		"altfn:ec1-txd1-rgmii1",
+		"altfn:ec1-txd0-rgmii1",
+		"altfn:ec1-tx-en-rgmii1",
+		"altfn:ec1-gtx-clk-rgmii1",
+		"altfn:ec1-rxd3-rgmii1",
+		"altfn:ec1-rxd2-rgmii1",
+		"altfn:ec1-rxd1-rgmii1",
+		"altfn:ec1-rxd0-rgmii1",
+		"altfn:ec1-rx-clk-rgmii1",
+		"altfn:ec1-rx-dv-rgmii1",
+		"nc",
+		"nc",
+		"ptp-refclk-in",
+		"nc",
+		"nc",
+		"nc",
+		"nc",
+		"nc",
+		"nc",
+		"nc",
+		"nc",
+		"u1700-zl30733-pps-out",
+		"nc",
+		"ethsw-mdio-en",
+		"usb01-oc#",
+		"nc",
+		"usb01-oc#",
+		"altfn:spi3-sck",
+		"nc",
+		"nc";
+
+	ethsw-mdio-en-hog {
+		gpio-hog;
+		gpios = <25 0>;
+		output-low;
+		line-name = "ethsw-mdio-en";
+	};
+};
diff --git a/configs/nbxv3_tfa_defconfig b/configs/nbxv3_tfa_defconfig
index 040353c4a03..a4c8419f0c3 100644
--- a/configs/nbxv3_tfa_defconfig
+++ b/configs/nbxv3_tfa_defconfig
@@ -40,6 +40,7 @@ CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
 CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=5
 CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
 CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
@@ -58,7 +59,9 @@ CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
 CONFIG_SYS_FSL_DDR_INTLV_256B=y
+CONFIG_GPIO_HOG=y
 CONFIG_DM_PCA953X=y
+CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_I2C_MUX=y
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.