Pin multiplexing on AM62

Device Information:

  • Board: Verdin AM62 Dual 1GB Wi-Fi / Bluetooth IT
  • Carrier Board: Yavia Carrier Board V1.0A
  • Operating System: TorizonCore

I went through the pin multiplexing and device tree documentations Toradex provides, however, I am still new to device tree overlays and need further assistance with changing the pin functionalities of SODIMM 30,32,34 and 36 and use them as GPIO.

From Linux sources I see that those pins are used by pinctrl_mcasp0 which I am disabling with

&pinctrl_mcasp0 { status = “disabled”; }

However, I am still struggling with pin control nodes. Any example of how to multiplex pins on Verdin AM62 WB module will be greatly appreciated.

Hi @baska ,

From Linux sources I see that those pins are used by pinctrl_mcasp0 which I am disabling with

&pinctrl_mcasp0 { status = “disabled”; }

Did you try applying an overlay? You need to reference the label of the node (&mcasp0), not the pinctrl group (pinctrl_mcasp0) it uses. So to disable mcasp0 the overlay syntax should be similar to this:

&mcasp0 {
    status = "disabled";
};

If you need a reference on how the pin muxing is done for the AM62 you can take a look at our device tree:

The first steps would be to create a pinctrl group inside the pin controller (main_pmx0). In this group you reference the nodes you want and each one set with the function you want. You do this by using AM62X_IOPAD, as defined here:

The AM62X reference manual and the AM62X datasheet have the info needed for AM62X_IOPAD.

Let me know if you need more help.

Best regards,
Lucas Akira

1 Like

Hi @baska ,

I was able to get SODIMM 30, 32, 34 and 36 enabled as GPIO on the Verdin AM62 with Torizon OS 6.4.0 using the following DT Overlay (I named it verdin-am62_mcasp0_pins_gpio_overlay.dts):

/dts-v1/;
/plugin/;

#include <k3-pinctrl.h>

/ {
    compatible = "toradex,verdin-am62";
};

&mcasp0 {
    status = "disabled";
};


&main_pmx0 {

    pinctrl_mcasp0_gpio: main-mcasp0-pins-gpio {
		pinctrl-single,pins = <
			AM62X_IOPAD(0x01a4, PIN_INPUT,  7) /* (B20) MCASP0_ACLKX.GPIO1_11  */ /* SODIMM 30 */
			AM62X_IOPAD(0x01a8, PIN_INPUT,  7) /* (D20) MCASP0_AFSX.GPIO1_12   */ /* SODIMM 32 */
			AM62X_IOPAD(0x01a0, PIN_INPUT,  7) /* (E18) MCASP0_AXR0.GPIO1_10  */  /* SODIMM 34 */
			AM62X_IOPAD(0x019c, PIN_INPUT,  7) /* (B18) MCASP0_AXR1.GPIO1_9  */   /* SODIMM 36 */
		>;
	};
};

&main_gpio0 {
	pinctrl-0 = <&pinctrl_ctrl_sleep_moci>,
		    <&pinctrl_gpio_5>,
		    <&pinctrl_gpio_6>,
		    <&pinctrl_gpio_7>,
		    <&pinctrl_gpio_8>,
		    <&pinctrl_mcasp0_gpio>;
};

You can create a custom Torizon OS image with the overlay above using TorizonCore Builder:

Since you’re using the Verdin AM62 you should use put these values into the include-dirs field of tcbuild.yaml:

    include-dirs:
      - linux/arch/arm64/boot/dts/ti/
      - linux/include/

Where linux is the kernel sourced from the link below:

$ git clone -b toradex_ti-linux-6.1.y git://git.toradex.com/linux-toradex.git linux

Once you have tcbuild.yaml set up you just need to run torizoncore-builder build to create the custom Torizon OS image which you can flash using Toradex Easy Installer.

I’m leaving the tcbuild.yaml that I’ve used, if you need a starting point:

tcbuild_verdin_am62_mcasp0_pins_gpio.yaml (4.6 KB)

EDIT: Corrected kernel git clone command

Best regards,
Lucas Akira

2 Likes