Hi,
My .dtbo is not changing pinxmux settings.
From here I can see that my overlay for changing pins with offsets 0xd4, 0xcc, 0xd0 to mode 7 (GPIO) is loaded:
root@iotlab:/sys/firmware/devicetree/base/ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/BB-GPIO-PINS # cat pinctrl-single,pins |
hexdump -C
00000000 00 00 00 d4 00 00 00 07 00 00 00 cc 00 00 00 07 |................|
00000010 00 00 00 d0 00 00 00 07 |........|
00000018
But when I go here, I still see these in default configuration 0x08 - MODE0 (specifically these are used for HDMI):
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # ls
gpio-ranges pinmux-functions pins
pingroups pinmux-pins
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pins
| grep 8d4
pin 53 (PIN53) 44e108d4 00000008 pinctrl-single
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pins
| grep 8d0
pin 52 (PIN52) 44e108d0 00000008 pinctrl-single
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pins
| grep 8cc
pin 51 (PIN51) 44e108cc 00000008 pinctrl-single
If I check here, it is clear that these are used by nxp_hdmi_bonelt_pins
> root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pinmu
> x-pins | grep 53
> pin 53 (PIN53): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pinmu
x-pins | grep 52
pin 52 (PIN52): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pinmu
x-pins | grep 51
pin 51 (PIN51): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single #
nxp_hdmi_bonelt_pins are defined in am335x-boneblack-common.dtsi where it is clear that are set for MODE0
&am33xx_pinmux {
nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLUP, MUX_MODE7)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA0, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA1, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA2, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA3, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA4, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA5, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA6, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA7, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA8, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA9, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA10, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA11, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA12, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA13, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA14, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_DATA15, PIN_OUTPUT, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
>;
};
So my pins are defined with nxp_hdmi_bonelt_pins but I was thinking that my overlay will change its mode.
Here is my boot.scr
# Set environment variables
setenv console ttyO0,115200n8
setenv loadaddr 0x82000000
setenv fdtaddr 0x88000000
setenv overlayaddr 0x89000000
setenv rootpart /dev/mmcblk0p2
# Loading kernel and device tree from the second (ext4) partition
echo Booting from the first partition...
load mmc 0:1 ${loadaddr} boot/uImage
load mmc 0:1 ${fdtaddr} boot/dtbs/v5.4.106-ti-r42/am335x-boneblack.dtb
load mmc 0:1 ${overlayaddr} boot/dtbs/v5.4.106-ti-r42/overlays/BB-GPIO.dtbo
# Apply the Device Tree Overlay
fdt addr ${fdtaddr}
fdt resize 8192
#load mmc 0:1 ${overlayaddr} boot/dtbs/v5.4.106-ti-r42/overlays/BB-GPIO.dtbo
# Load the Device Tree Overlay
echo Applying Device Tree Overlay...
fdt apply ${overlayaddr}
# Set boot arguments for SD card boot
setenv bootargs console=${console} root=${rootpart} rootwait rw
setenv autoload no
# Boot the loaded kernel
bootm ${loadaddr} - ${fdtaddr}
And here is my BB-GPIO.dts which i compile to BB-GPIO.dtbo
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* Part of the tree to bind the overlay to */
part-number = "BB-GPIO";
version = "00A0";
/* Define the pins */
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
pinctrl_test: BB-GPIO-PINS {
pinctrl-single,pins = <
0x0d4 0x07 /* P8_33: mode 7 (GPIO) */
0x0cc 0x07 /* P8_34: mode 7 (GPIO) */
0x0d0 0x07 /* P8_35: mode 7 (GPIO) */
>;
};
};
};
/* Apply the pin settings */
fragment@1 {
target = <&ocp>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_test>;
status = "okay";
};
};
};
};
I build images with buildroot.
Kernel version: v5.4.106-ti-r42
U-boot version: v2024.01
dtc version: 1.6.1
I tried to use newer Kernel versions, older u-boot version but without any success. Tried as well with other pins, but the behaviour was the same.
Can someone please point out where the issue can be and why my overlay is not setting pins to the desired mode? it is like kernel overwrites my overlay somehow.
Thank you very much for any hint!