[BBB] my .dtbo not changing pinmux settings

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!

Ok,
I deleted all HDMI related driver support in the kernel settings and now I see my pins like:

pin 53 (PIN53): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 54 (PIN54): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 55 (PIN55): (MUX UNCLAIMED) (GPIO UNCLAIMED)

root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pins 
| grep 8d4
pin 53 (PIN53) 44e108d4 0000002f pinctrl-single 
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pins 
| grep 8d0
pin 52 (PIN52) 44e108d0 0000002f pinctrl-single 
root@iotlab:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single # cat pins 
| grep 8cc
pin 51 (PIN51) 44e108cc 0000002f pinctrl-single

Now it is not mode 0, because it is 0x27 and I can control pins as GPIOs but my overlay with setting pins to 0x07 is not applied. I tried to revert back to mode 0 but still pins remain 0x27.

Again, I clearly can see this like my overlay is there:

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

Can anyone please give some kind of support so I figure out why my .dtbo is visible but not chaning function of the pinmux?
Thanks!

[SOLVED]
No need to delete HDMI drivers. It was just required to change .dts like this:

/dts-v1/;
/plugin/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,am335x-boneblack";

    fragment@0 {
        target = <&ocp>;
        __overlay__ {
            custom_gpio: custom_gpio {
                compatible = "gpio-leds";
                pinctrl-names = "default";
                pinctrl-0 = <&bb_gpio_pins>;

                gpio0_9 {
                    label = "gpio0_9:pin53";
                    gpios = <&gpio0 9 0>;
                    default-state = "off";
                };

                gpio2_17 {
                    label = "gpio2_17:pin51";
                    gpios = <&gpio2 17 0>;
                    default-state = "off";
                };


                gpio0_8 {
                    label = "gpio0_8:pin52";
                    gpios = <&gpio0 8 0>;
                    default-state = "off";
                };


            };
        };
    };

    fragment@1 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            bb_gpio_pins: pinmux_bb_gpio_pins {
                pinctrl-single,pins = <
                    0xd4 0x07   /* P8_33: mode 7 (GPIO0_9) */
                    0xcc 0x07  /* P8_34: mode 7 (GPIO2_17) */
                    0xd0 0x07  /* P8_35: mode 7 (GPIO0_8) */
                >;
            };
        };
    };
};

Cheers!