Hello,
I have been trying to multiplex the PWM 1 pin (SODDIM_15) on the Verdin iMX8M Plus Quad 4GB Wi-Fi / Bluetooth IT V1.1B as GPIO active low to interface with a custom break out board for the Mallow carrier board. When I build the device tree and install it on the board gpioinfo returns
gpiochip4 - 32 lines:
line 0: "SODIMM_42" unused input active-high
line 1: "SODIMM_46" unused input active-high
line 2: "SODIMM_187" unused input active-high
line 3: "SODIMM_20" unused input active-high
line 4: "SODIMM_22" unused input active-high
line 5: "SODIMM_15" unused input active-high
The following is the device tree source, verdin-mallow-COMPANY.dts
#include "imx8mp-pinfunc.h"
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/gpio/gpio.h>
#include "imx8mp-verdin-wifi-mallow.dts"
/ {
model = "Custom relay board for COMPANY";
compatible = "toradex,verdin-imx8mp-wifi-mallow",
"toradex,verdin-imx8mp-wifi",
"toradex,verdin-imx8mp",
"fsl,imx8mp";
newgpios {
compatible = "gpio";
pinctrl-names = "default";
pinctrl-0 = <&my_gpio>;
mygpio_sodimm_15 {
label = "newgpio";
gpios = <&gpio5 5 GPIO_ACTIVE_LOW>;
default-state = "on";
};
};
};
&pwm1 {
status = "disabled";
};
&pwm2 {
status = "disabled";
};
&iomuxc {
my_gpio: add_gpio_grp {
fsl,pins = <
MX8MP_IOMUXC_SPDIF_EXT_CLK__GPIO5_IO05 0x1C0
>;
};
};
The device tree gets compiled by the yocto and appears to be loaded by the kernel as the output of cat /proc/device-tree/model is
Custom relay board for COMPANY
But the output of
cat /sys/kernel/debug/pinctrl/pinctrl-handles
does not show my custom group loaded
Requested pin control handlers their pinmux maps:
device: 30330000.pinctrl current state: default
state: default
type: MUX_GROUP controller 30330000.pinctrl group: gpio1grp (10) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_GPIO1_IO00 (5)config 00000184
type: MUX_GROUP controller 30330000.pinctrl group: gpio2grp (11) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_GPIO1_IO01 (6)config 000001c4
type: MUX_GROUP controller 30330000.pinctrl group: gpio3grp (12) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_GPIO1_IO05 (10)config 00000184
type: MUX_GROUP controller 30330000.pinctrl group: gpio4grp (13) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_GPIO1_IO06 (11)config 00000184
type: MUX_GROUP controller 30330000.pinctrl group: gpio7grp (16) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_SAI1_RXD1 (85)config 00000184
type: MUX_GROUP controller 30330000.pinctrl group: gpio8grp (17) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_SAI1_RXC (83)config 00000184
type: MUX_GROUP controller 30330000.pinctrl group: gpiohog2grp (21) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_SAI3_MCLK (116)config 000001c4
type: MUX_GROUP controller 30330000.pinctrl group: gpiohog3grp (22) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_GPIO1_IO15 (20)config 000001c4
type: MUX_GROUP controller 30330000.pinctrl group: gpiohog4grp (23) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_UART4_RXD (142)config 000001c4
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_UART4_TXD (143)config 000001c4
type: MUX_GROUP controller 30330000.pinctrl group: hdmihoggrp (25) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_CEC (146)config 00000019
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_DDC_SCL (144)config 000001c3
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_DDC_SDA (145)config 000001c3
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_HPD (147)config 00000019
Any advice/insights on how to proceed?
My output of tdx-info is as follows
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.148-6.7.0-devel+git.bfdbfb2c85fb #1 SMP PREEMPT T hu Jun 20 15:59:41 UTC 2024
Kernel command line: root=PARTUUID=c8ef2bc5-02 ro rootwait console=tty1 con sole=ttymxc2,115200 consoleblank=0 earlycon
Distro name: NAME="COMPANY-OS"
Distro version: VERSION_ID=6.7.0-devel-20240704110142-build.0
Distro variant: -
Hostname: verdin-imx8mp-15289197
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Custom relay board for COMPANY
Toradex version: 0058 V1.1B
Serial number: 15289197
Processor arch: aarch64
------------------------------------------------------------
UPDATE:
It seems to be an issue with the label name, as when I changed the label the device tree gets changed as expected.
I would appreciate an explanation on why this is the case
#include "imx8mp-pinfunc.h"
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/gpio/gpio.h>
#include "imx8mp-verdin-wifi-mallow.dts"
/ {
model = "Custom relay board for COMPANY";
compatible = "toradex,verdin-imx8mp-wifi-mallow",
"toradex,verdin-imx8mp-wifi",
"toradex,verdin-imx8mp",
"fsl,imx8mp";
};
&{/}
{
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_my_led>;
mygpio_sodimm_15 {
label = "newgpio";
gpios = <&gpio5 5 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
default-state = "on";
};
};
};
&pwm1 {
status = "disabled";
};
&pwm2 {
status = "disabled";
};
&iomuxc {
pinctrl_my_led: myledgrp {
fsl,pins = <
MX8MP_IOMUXC_SPDIF_EXT_CLK__GPIO5_IO05 0x1C0
>;
};
};