Note the structure here form this modified file( Modified from Charles S’ Universal IO overlay ‘univ-all’ ) This is for a single pin instead of all pins.https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/univ-all-00A0.dts
IN short here is what is required:
- /dts-v1/;
- /plugin/;
- / {
- compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;
- part-number = “univ-P8_07”;
- version = “00A0”;
Passed that exclusive-use = “P8.7”; ive seen in each overlay for pins each uses. BUt if you examine this file closely it should become apparent what is required to make a like overlay function. This specific file is mean to offer the ability to change pin mux dynamically as the system is running. So there are 5 possibilities from this file, but initially the pin is configured as input.
I will tell you what helps me a good bit while editing device tree files. You need a good editor that will allow you to arbitrarily set syntax highlighting. Then, I personally set syntax highlighting to “C”.
/dts-v1/;
/plugin/;
/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;
/* identification */
part-number = “univ-P8_07”;
version = “00A0”;
/* state the resources this cape uses */
exclusive-use = “P8.7”;
/* P8_07 (ZCZ ball R7 ) /
P8_07_default_pin: pinmux_P8_07_default_pin {
pinctrl-single,pins = <0x090 0x37>; }; / Mode 7, Pull-Up, RxActive /
P8_07_gpio_pin: pinmux_P8_07_gpio_pin {
pinctrl-single,pins = <0x090 0x2F>; }; / Mode 7, RxActive /
P8_07_gpio_pu_pin: pinmux_P8_07_gpio_pu_pin {
pinctrl-single,pins = <0x090 0x37>; }; / Mode 7, Pull-Up, RxActive /
P8_07_gpio_pd_pin: pinmux_P8_07_gpio_pd_pin {
pinctrl-single,pins = <0x090 0x27>; }; / Mode 7, Pull-Down, RxActive /
P8_07_timer_pin: pinmux_P8_07_timer_pin {
pinctrl-single,pins = <0x090 0x32>; }; / Mode 2, Pull-Up, RxActive */
fragment@1 {
target = <&ocp>;
overlay {
P8_07_pinmux {
compatible = “bone-pinmux-helper”;
status = “okay”;
pinctrl-names = “default”, “gpio”, “gpio_pu”, “gpio_pd”, “timer”;
pinctrl-0 = <&P8_07_default_pin>;
pinctrl-1 = <&P8_07_gpio_pin>;
pinctrl-2 = <&P8_07_gpio_pu_pin>;
pinctrl-3 = <&P8_07_gpio_pd_pin>;
pinctrl-4 = <&P8_07_timer_pin>;
};
};
};
fragment@2 {
target = <&ocp>;
overlay {
cape-universal {
compatible = “gpio-of-helper”;
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <>;
P8_07 {
gpio-name = “P8_07”;
gpio = <&gpio2 2 0>;
input;
dir-changeable;
};
};
};
};
};