How to disable all HDMI used pins?

Yes, I can provide further info @SuicidalLabRat :

Are you using Yocto to build your OS image? …if so, which version (i.e. Dunfell , Kirkstone, other)?

I am on Dunfell for the purposes of meta-ti compilation (had some issues with kirkstone and did not investigate that further yet).

lukasz@vmks:~/udemy-yocto/src/build-ti$ bitbake-layers show-layers
NOTE: Starting bitbake server...
layer                 path                                      priority
==========================================================================
meta                  /home/lukasz/udemy-yocto/src/poky/meta    5
meta-poky             /home/lukasz/udemy-yocto/src/poky/meta-poky  5
meta-arm-toolchain    /home/lukasz/udemy-yocto/src/meta-arm/meta-arm-toolchain  30
meta-arm              /home/lukasz/udemy-yocto/src/meta-arm/meta-arm  6
meta-ti               /home/lukasz/udemy-yocto/src/meta-ti      6
meta-oe               /home/lukasz/udemy-yocto/src/meta-openembedded/meta-oe  6
Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "beaglebone"
DISTRO               = "poky"
DISTRO_VERSION       = "3.1.30"
TUNE_FEATURES        = "arm armv7a vfp thumb neon callconvention-hard"
TARGET_FPU           = "hard"
meta
meta-poky            = "dunfell:dbe19706ec01c1eaa1d377a792e7d825054050b0"
meta-arm-toolchain
meta-arm             = "dunfell:b75b8ce1ac10dc3521c0f710a4cf79bc7e985cfd"
meta-ti              = "dunfell:86bafdd779a0a7a021369213a633125b95bc6178"
meta-oe              = "dunfell:fc632d5bb0936e91e4e0191547b9aa8ca47b4ffe"

In the device tree, what are you wanting to dissable

If I base my build on am335x-boneblack.dts, I want to disable the HDMI pins. If I base it on the am335x-bonegreen.dts, then just the UART2.

In the device tree, what are you wanting to enable and configure (that isnt already in the BBB dt)?

These are my pins assignements for the project:

So I need:

  • 32 output push-pull pins,
  • 16 PRU (0 or 1, whichever applicable) inputs (the input part config will be probably done in the PRU code, I just need the mode 5 or 6 in the device tree),
  • UART1 config.

So initially based on the suggestions from @RobertCNelson , I used the am335x-bonegreen.dts and started the attempts to provide a device tree overlay that would disable UART2 and configure the pins as needed above. For unknown reason, as shown in the prior posts I could not properly overlay the pins. Thats why I started to wonder whether it would not be better to replace the am335x-bonegreen.dts completely with a custom setting for my HW and compile it along with bitbake, but I don’t know how to do that (yet).

I would appreciate your further feedback, thank you for your help already!

If you are implementing a personal DIY project, or a very limited EDU research project, then sticking with Dunfell is fine. Anything else, and you really need to move to a newer release. The kernel changes are pretty fundamental between 4 and 5.
That being said, you need a “meta-your_layer” that includes a “recipe-kernel/linex/” and appropriate append and files/*dtsi files

If you are implementing a personal DIY project, or a very limited EDU research project, then sticking with Dunfell is fine. Anything else, and you really need to move to a newer release. The kernel changes are pretty fundamental between 4 and 5.

It is a hobby open source project, but I dont mind going Kirkstone. Like said the only reason here was an issue with the meta-ti layer, so I just tried to offload this project with initial, multiple problems…

That being said, you need a “meta-your_layer” that includes a “recipe-kernel/linex/” and appropriate append and files/*dtsi files

Yes, I am trying to figure out how to do this exactly. But why the dtsi approach? It seems counter intuitive to create a new “header” file, instead of usimg the existing ones and create a new base dts file or an additional device tree overlay (since my custom hw is a “cape”)?

Well look at that @RobertCNelson @SuicidalLabRat :

/dts-v1/;
/plugin/;

/ {
    fragment@0 {
        target = <&uart2>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <>;
            status = "disabled";
        };
    };

    fragment@1 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&my_pins>;

            my_pins: pinmux_my_pins {
                pinctrl-single,pins = <
                    0x0e0 0x06
                    0x0e8 0x06
                    0x0e4 0x06
                 >;
            };

        };
    };
};
root@beaglebone:~# cat /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pingroups
registered pin groups:
group: pinmux_my_pins
pin 56 (PIN56)
pin 58 (PIN58)
pin 57 (PIN57)

What I did, is on all my repos go from Dunfell to Kirkstone… No other changes.

Thats great!
Bear in mind, kirkstone implements kernel 5, which has moved off sysfs, so your interface to GPIO is no longer character files in /sys/class/gpio/gpioN/

Although I didn’t know this was the moment of the “cut”, I was already using gpiod with Dunfell, so one issue less here at least :stuck_out_tongue:

Thank you both for the help @RobertCNelson and @SuicidalLabRat

Hi again @RobertCNelson and @SuicidalLabRat ,

Due to numerous issues I am facing with meta-ti-bsp layer in kirkstone, I started to test the meta-yocto-bsp instead. These errors do not occur there, but the problem is my device tree overlay cannot be loaded anymore via extlinux.conf file… At boot I get:

U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
WDT:   Started wdt@44e35000 with servicing (60s timeout)
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... <ethaddr> not set. Validating first E-fuse MAC
Net:   eth2: ethernet@4a100000, eth3: usb_ether
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1:      Yocto
Retrieving file: /zImage
append: root=PARTUUID=18e99beb-02 rootwait console=ttyS0,115200
Retrieving file: /am335x-bonegreen.dtb
Invalid fdtoverlay_addr_r for loading overlays
Kernel image @ 0x82000000 [ 0x000000 - 0x77b738 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ffed000, end 8ffff9dc ... OK

I tried adding the fdtoverlay_addr_r variable to the extlinux.conf, but then:

Ignoring unknown command:    fdtoverlay_addr_r

Do you have any idea how to overcome this…?

@bremenpl Hi, I meet same situation with you, what I do is:

  1. comment hdmi pins config in arch/arm/boot/dts/am335x-bbb-bone-buses.dtsi as:
diff --git a/arch/arm/boot/dts/am335x-bbb-bone-buses.dtsi b/arch/arm/boot/dts/am335x-bbb-bone-buses.dtsi
index c70e3c167..5a5d99695 100644
--- a/arch/arm/boot/dts/am335x-bbb-bone-buses.dtsi
+++ b/arch/arm/boot/dts/am335x-bbb-bone-buses.dtsi
@@ -130,47 +130,47 @@ AM33XX_PADCONF(AM335X_PIN_GPMC_AD7, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad7.mmc
 		>;
 	};
 
-	nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
-		pinctrl-single,pins = <
-			AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3)
-			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)
-		>;
-	};
+	/* nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { */
+		/* pinctrl-single,pins = < */
+			/* AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3) */
+			/* 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) */
+		/* >; */
+	/* }; */
 
-	nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
-		pinctrl-single,pins = <
-			AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3)
-		>;
-	};
+	/* nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { */
+		/* pinctrl-single,pins = < */
+			/* AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3) */
+		/* >; */
+	/* }; */
 
-	mcasp0_pins: mcasp0_pins {
-		pinctrl-single,pins = <
-			AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKX, PIN_INPUT_PULLUP, MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */
-			AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKR, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/
-			AM33XX_PADCONF(AM335X_PIN_MCASP0_FSX, PIN_OUTPUT_PULLUP, MUX_MODE0)
-			AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKX, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
-			AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_a11.GPIO1_27 */
-		>;
-	};
+	/* mcasp0_pins: mcasp0_pins { */
+		/* pinctrl-single,pins = < */
+			/* AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKX, PIN_INPUT_PULLUP, MUX_MODE0) [> mcasp0_ahcklx.mcasp0_ahclkx <] */
+			/* AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKR, PIN_OUTPUT_PULLDOWN, MUX_MODE2) [> mcasp0_ahclkr.mcasp0_axr2<] */
+			/* AM33XX_PADCONF(AM335X_PIN_MCASP0_FSX, PIN_OUTPUT_PULLUP, MUX_MODE0) */
+			/* AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKX, PIN_OUTPUT_PULLDOWN, MUX_MODE0) */
+			/* AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_OUTPUT_PULLDOWN, MUX_MODE7) [> gpmc_a11.GPIO1_27 <] */
+		/* >; */
+	/* }; */
 };
 
 // ADC

  1. add a overlay dts file such as:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/display/tda998x.h>
#include <dt-bindings/interrupt-controller/irq.h>

/*
 * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
 */
&{/chosen} {
	overlays {
		BBB-DISABLENHDMI.kernel = __TIMESTAMP__;
	};
};

/*
 * Free up the pins used by the cape from the pinmux helpers.
 */
&ocp {
	P8_45_pinmux { status = "disabled"; };	/* lcd_data0 */
	P8_46_pinmux { status = "disabled"; };	/* lcd_data1 */
	P8_43_pinmux { status = "disabled"; };	/* lcd_data2 */
	P8_44_pinmux { status = "disabled"; };	/* lcd_data3 */
	P8_41_pinmux { status = "disabled"; };	/* lcd_data4 */
	P8_42_pinmux { status = "disabled"; };	/* lcd_data5 */
	P8_39_pinmux { status = "disabled"; };	/* lcd_data6 */
	P8_40_pinmux { status = "disabled"; };	/* lcd_data7 */
	P8_37_pinmux { status = "disabled"; };	/* lcd_data8 */
	P8_38_pinmux { status = "disabled"; };	/* lcd_data9 */
	P8_36_pinmux { status = "disabled"; };	/* lcd_data10 */
	P8_34_pinmux { status = "disabled"; };	/* lcd_data11 */
	P8_35_pinmux { status = "disabled"; };	/* lcd_data12 */
	P8_33_pinmux { status = "disabled"; };	/* lcd_data13 */
	P8_31_pinmux { status = "disabled"; };	/* lcd_data14 */
	P8_32_pinmux { status = "disabled"; };	/* lcd_data15 */
	P8_27_pinmux { status = "disabled"; };	/* lcd_vsync */
	P8_29_pinmux { status = "disabled"; };	/* lcd_hsync */
	P8_28_pinmux { status = "disabled"; };	/* lcd_pclk */
	P8_30_pinmux { status = "disabled"; };	/* lcd_ac_bias_en */
};

&lcdc {
	status = "disabled";
};

I hope these can help you.

Hi @iysheng and thank you for the answer. I have some follow up questions:

  1. What Yocto version are you using and are you using meta-ti, or meta-yocto-bsp?
  2. How to you introduce this change exactly? I am not very fluent in yocto yet- did you need to edit an existing file in poky repo, or is this some kind of bbappend that is used in your custom layer (that is how I would intend to do it, to not edit anything in poky repo)?
  3. How do you make the bitbake compile this overlay and then uboot to load it?

I would appreciate your feedback!

Oh, I’m not use Yocto, I use debian img from the website. :sweat_smile:

  1. Why I modified file am335x-bbb-bone-buses.dtsi, because I looked the boot log and I found my bbb board just use am335x-boneblack-uboot-univ.dtb, then I checked the am335x-boneblack-uboot-univ.dts file and made some grep in kernel source code, I found the am335x-boneblack-uboot-univ.dts use hdmi pin configs in the header file am335x-bbb-bone-buses.dtsi.

  2. this modify based on overly is my first try to disable hdmi funcs, but failed . though I can disable lcd funcs. But I can’t use gpiolib in userspace to control these pins. So I disable these pins with hdmi pinmux config in dtb with method 1.Besides I disabled xxBB-HDMI-TDA998x-00A0.dtbo overlay to load.

1 Like

Thank you for the clarification.
For my purposes I need to create a custom image (with Yocto or Buildroot), so I can provide a since line creation of the image with the complete environment and programs. I am only in the beginning of that task. I keep failing of trying to find a working Yocto build config in which:

  1. I would be able to boot the image without issues,
  2. Load a custom device tree overlay at boot time (disabling some pins and re-configuring the others).

By using meta-ti I can load device tree overlay, but booting fails. Without it booting is ok, but loading the device tree overlay does not work…

At the same time I cannot modify any poky repo sources, as I am trying to implement all of the changes without forking this repo, but using it as a git submodule instead.

I’m not familiar with yocto now, :joy: I’m so sorry.

The problem is probably that I am not familiar enough with it too :stuck_out_tongue: