Hello Toradex Community,
I’m working on a custom carrier board for the Verdin AM62 and using Yocto to build my image. I’m basing my device tree on the Mallow carrier board but have disabled certain peripherals (like CAN, SD, I2C, UARTs, etc.) that are not needed for our design by setting their status to "disabled" in a custom overlay.
Now, I want to repurpose the freed-up pins (specifically from the disabled SD1 interface) as GPIOs. I added the necessary pinmux entries under &pinctrl_main and assigned them to &main_gpio0, but after that, the board doesn’t boot.
Could someone guide me on the correct way to repurpose these pins as GPIOs after disabling the peripherals? Are there any known caveats when modifying pinctrl-0 of main_gpio0, or is there a preferred method such as using GPIO hogs for such use cases?
Any insights or examples from similar implementations would be greatly appreciated!
file : k3-am62-verdin.dtsi // Provided by Toradex; not modified
&main_pmx0 {
/* Verdin PWM_1 */
pinctrl_epwm0_a: main-epwm0a-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x01b4, PIN_OUTPUT, 2) /* (A13) SPI0_CS0.EHRPWM0_A */ /* SODIMM 15 */
>;
};
/* Verdin SD_1 */
pinctrl_sdhci1: main-mmc1-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x23c, PIN_INPUT, 0) /* (A21) MMC1_CMD */ /* SODIMM 74 */
AM62X_IOPAD(0x234, PIN_INPUT, 0) /* (B22) MMC1_CLK */ /* SODIMM 78 */
AM62X_IOPAD(0x230, PIN_INPUT, 0) /* (A22) MMC1_DAT0 */ /* SODIMM 80 */
AM62X_IOPAD(0x22c, PIN_INPUT, 0) /* (B21) MMC1_DAT1 */ /* SODIMM 82 */
AM62X_IOPAD(0x228, PIN_INPUT, 0) /* (C21) MMC1_DAT2 */ /* SODIMM 70 */
AM62X_IOPAD(0x224, PIN_INPUT, 0) /* (D22) MMC1_DAT3 */ /* SODIMM 72 */
>;
};
};
my overlay
/ SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
* Copyright 2023 Toradex
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h>
#include "k3-pinctrl.h"
/ {
compatible = "toradex,verdin-am62";
};
/* Disable Verdin CAN_1 */
&main_mcan0 {
status = "disabled";
};
/* Disable Verdin CAN_2 */
&mcu_mcan0 {
status = "disabled";
};
/* Verdin PWM_3 DSI */
&epwm1 {
status = "disabled";
};
/* Verdin I2C_2 DSI */
&main_i2c2 {
status = "disabled";
};
/* Verdin UART_1 */
&main_uart1 {
status = "disabled";
};
/* Verdin UART_2 */
&wkup_uart0 {
status = "disabled";
};
/* Verdin UART_4 */
&mcu_uart0 {
status = "disabled";
};
/* Verdin USB_1 */
&usbss0 {
status = "disabled";
};
&usb0 {
status = "disabled";
};
/* Verdin SD_1 */
&sdhci1 {
status = "disabled";
};
/* Verdin CTRL_WAKE1_MICO# */
&verdin_gpio_keys {
status = "disabled";
};
/* Verdin PCIE_1_RESET# */
&verdin_pcie_1_reset_hog {
status = "disabled";
};
/* Verdin I2C_4 CSI */
&main_i2c3 {
status = "disabled";
};
machine boot up nicely
after adding this
/* Pinmux for repurposed peripherals as GPIOs */
&pinctrl_main {
/* Repurpose SD1 pins */
pinctrl_gpio_sd_repurpose: sd-gpio-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x23c, PIN_OUTPUT, 7) /* MMC1_CMD --> GPIO0_78, SODIMM 74 */
AM62X_IOPAD(0x234, PIN_OUTPUT, 7) /* MMC1_CLK --> GPIO0_77, SODIMM 78 */
AM62X_IOPAD(0x230, PIN_OUTPUT, 7) /* MMC1_DAT0 --> GPIO0_76, SODIMM 80 */
AM62X_IOPAD(0x22c, PIN_OUTPUT, 7) /* MMC1_DAT1 --> GPIO0_75, SODIMM 82 */
AM62X_IOPAD(0x228, PIN_OUTPUT, 7) /* MMC1_DAT2 --> GPIO0_74, SODIMM 70 */
AM62X_IOPAD(0x224, PIN_OUTPUT, 7) /* MMC1_DAT3 --> GPIO0_73, SODIMM 72 */
>;
};
};
/* Attach repurposed pins to GPIO controller */
&main_gpio0 {
pinctrl-names = "default";
pinctrl-0 = <
&pinctrl_gpio_sd_repurpose
>;
};
Machine not at all booting
Thanks in advance,
Uday
