GPIO Device tree BeagleBone AI, 4.19 Kernel image

66 views
Skip to first unread message

Douglas Conover

unread,
Oct 14, 2020, 5:51:28 PM10/14/20
to BeagleBoard

Hi all,

In the last few days, I've been working on updating my device tree files to be compatible with the 4.19 kernel image:


I haven't been able to figure out how to properly set the default values (on or off) of my gpios on bootup. in bbai-bone-buses.dtsi, I found the group "leds" and thought I could configure these pins in a similar fashion to the older am5729-beagleboneai-roboticscape.dts. However, I've only been able to set the pins as gpios, and not choose whether they output on or off at boot. Here is my dts:

/dts-v1/;
/plugin/;

/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
    overlays {
        VENTION-GPIO = __TIMESTAMP__;
    };
    
};


&ocp {
       
    P8_11_pinmux { pinctrl-0 = <&P8_11_gpio_pin>; }; /*  */
    P8_13_pinmux { pinctrl-0 = <&P8_13_gpio_pin>; }; /*  */   
    P8_14_pinmux { pinctrl-0 = <&P8_14_gpio_pin>; }; /*  */
    P8_15_pinmux { pinctrl-0 = <&P8_15_gpio_pin>; }; /*  */
    P9_15_pinmux { pinctrl-0 = <&P9_15_gpio_pin>; }; /*  */
    P8_16_pinmux { pinctrl-0 = <&P8_16_gpio_pin>; }; /*  */
    P8_17_pinmux { pinctrl-0 = <&P8_17_gpio_pin>; }; /*  */
    P8_19_pinmux { pinctrl-0 = <&P8_19_gpio_pin>; }; /*  */
    P9_12_pinmux { pinctrl-0 = <&P9_12_gpio_pin>; }; /*  */
    P9_14_pinmux { pinctrl-0 = <&P9_14_gpio_pin>; }; /*  */

};

&leds{

    pinctrl-names = "default";
    compatible = "gpio-leds";
    
    led_P8_11{
        status="enabled" ;
        default-state="on";
    };
};


I would eventually like to configure the default state of all of these pins.This dts compiles, but will brick my device. Any ideas about how I can set the boot states with this framework?

Thanks,

Doug

Douglas Conover

unread,
Oct 16, 2020, 12:43:22 PM10/16/20
to BeagleBoard
Hi all,

After a lot of head-scratching, I figured out the proper syntax. The following dts will configure P8_19 as a LED pin with a default state of "on":

/dts-v1/;
/plugin/;

&{/chosen} {
    overlays {
        GPIO_CUSTOM = __TIMESTAMP__;
    };
};

&ocp {
    P8_19_pinmux { pinctrl-0 = <&P8_19_gpio_pin>; };
};

&{/} {
    leds {
        led_P8_19 {
            status = "okay";
            label = "MY_GPIO";
            default-state = "on";
        };
    };
};


Hopefully this will help out future head-scratchers!
Reply all
Reply to author
Forward
0 new messages