[BeagleBone Black] Disable HDMI to enable PWM or PRU pins

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

[BeagleBone Black] Disable HDMI to enable PWM or PRU pins

Postby conchyliferous » Sun Apr 23, 2017 7:17 am

Hi,

First of all, as others have reported, the Linux kernel 4.10.x does not work due to a bug, so here I use the slightly older version.

I'm confused about how to disable the HDMI for a modern (4.9.x) kernel. The information on this matter is very fragmented since things have changed between versions. In this post I will also try to collect much of the information I've seen in order to help the community. I do not fully understand everything here, so please correct me if I misunderstood something.

So, for example, I want to enable my following custom dtb (compiled into a dtbo with dtc and put in /lib/firmware):
$this->bbcode_second_pass_code('', '/dts-v1/;
/plugin/;

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

part-number = "BB-PWM";
version = "00A0";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
pinctrl_spec: ehrpwm_pins {
pinctrl-single,pins = <
0x0c8 0x02 /* P8_36 MODE2 ehrpwm1A PWM */
0x0cc 0x02 /* P8_34 MODE2 ehrpwm1B PWM */
0x020 0x04 /* P8_19 MODE4 ehrpwm2A PWM */
0x024 0x04 /* P8_13 MODE4 ehrpwm2B PWM */
>;
};
};
};

fragment@1 {
target = <&ocp>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spec>;
status = "okay";
};
};
};

fragment@2 {
target = <&epwmss1>;
__overlay__ {
status = "okay";
};
};

fragment@3 {
target = <&ehrpwm1>;
__overlay__ {
status = "okay";
};
};

fragment@4 {
target = <&epwmss2>;
__overlay__ {
status = "okay";
};
};

fragment@5 {
target = <&ehrpwm2>;
__overlay__ {
status = "okay";
};
};
};')

If commenting out the lines
$this->bbcode_second_pass_code('', ' 0x0c8 0x02 /* P8_36 MODE2 ehrpwm1A PWM */
0x0cc 0x02 /* P8_34 MODE2 ehrpwm1B PWM */')
everything works without any problems (since these pins are by default reserved by the HDMI), and I can control PWMs through the /sys/class/pwm/pwmchip2 structure.

My problem is that I fail to disable the HDMI in order to mux these pins into the PWM mode (mode 2 in this case). From what I have read I need to do this during boot via the /boot/uEnv.txt file. I have seen the page https://github.com/beagleboard/bb.org-overlays and have been led to believe that this is what is relevant for new kernels.

In old versions of Linux this was apparently done by adding capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN but this was done since the HDMI support was previously realized as a device tree overlay (via slots) rather than being part of the default tree.

But now, the default device tree needs to be changed, and that is apparently done by adding dtb=am335x-boneblack-emmc-overlay.dtb to the /boot/uEnv.txt file. It's not clear to me exactly how it should be added, I've tried the following:
$this->bbcode_second_pass_code('', 'optargs=coherent_pool=1M dtb=am335x-boneblack-emmc-overlay.dtb')
and
$this->bbcode_second_pass_code('', 'optargs=coherent_pool=1M
dtb=am335x-boneblack-emmc-overlay.dtb')

In both cases, when later doing a
$this->bbcode_second_pass_code('', 'echo BB-PWM > /sys/devices/platform/bone_capemgr/slots')
I get the error (in dmesg)
$this->bbcode_second_pass_code('', '[ 9.280194] pinctrl-single 44e10800.pinmux: pin 44e108c8.0 already requested by ocp:helper; cannot claim for 0-0070
[ 9.290779] pinctrl-single 44e10800.pinmux: pin-50 (0-0070) status -22
[ 9.297373] pinctrl-single 44e10800.pinmux: could not request pin 50 (44e108c8.0) from group nxp_hdmi_bonelt_pins on device pinctrl-single
[ 9.309963] tda998x 0-0070: Error applying setting, reverse things back
[ 9.626463] tda998x: probe of 0-0070 failed with error -22')
which basically tells us that the pin is already claimed (by HDMI).

What do I miss here?
conchyliferous
 
Posts: 10
Joined: Fri Jul 11, 2014 8:32 pm

Re: [BeagleBone Black] Disable HDMI to enable PWM or PRU pin

Postby Zeno » Wed May 03, 2017 5:10 pm

Hello,
try using this:
$this->bbcode_second_pass_code('', 'fdtfile=am335x-boneblack-emmc-overlay.dtb')
instead of dtb environment variable, this is working for me on 4.8 and 4.10 kernels. This was hidden somewhere in u-boot sources, I once dug trough and found that.
Zeno
Zeno
 
Posts: 14
Joined: Wed May 03, 2017 5:00 pm


Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 6 guests