I've managed to create a dtbo for pwm that doesn't make the system barf at 
me. It shows up properly when I cat slots and I can see the pin assignments 
in pins. I'm not really understanding what the file does and what I can 
find for documentation on writing dts files never seems to resemble any of 
the overlays on the bone.

The first one I wrote I basically hacked up another file that enabled a 
single pwm ( ehrpwm2A) so I tried to make it work for ehrpwm0A and 
ehrpwm0B. I ended up with this

/dts-v1/;
/plugin/;

/{
    compatible = "ti,beaglebone", "ti,beaglebone-black", 
"ti,beaglebone-green";
    part-number = "PDM-PWM0";
    version = "00A0";
    
    exclusive-use =
        /* PINS */
        "P9.29",
        "P9.31",
        /* devices */
        "ehrpwm0A",
        "ehrpwm0B";

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl_spec: Panel_Pins {
                pinctrl-single,pins = <
                    0x190 0x03 /* P9_29 MODE3 ehrpwm0A PWM */
                    0x194 0x03 /* P9_31 MODE3 ehrpwm0B 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 = <&epwmss0>;
        __overlay__ {
            status = "okay";    
        };
    };

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

};


Like I said, it seems to load OK and /sys/class/pwm shows pwmchip0 but I 
don't have anything to actually test the PWM with at the moment. Does this 
look correct?

The exclusive_use part is pretty obvious.

I'm wondering if the names defined by lines like "pinctrl_spec: Panel_Pins" 
are pre-defined secret codes required to make things work or if they're 
just arbitrary labels assigned by the person creating the file?

In fragment one there's "test_helper: helper" which looks like an arbitrary 
label - but is it?

I would think that in "target = <whatever>" the "whatever" has to be the 
proper name/device/whatever it is (like tscadc for analog inputs).



Then one other thing. I copied this file, renamed it PDM-PWM1-00A0.dts, 
changed the partno, defined pins, etc to be ehrpwm1


/dts-v1/;
/plugin/;

/{
    compatible = "ti,beaglebone", "ti,beaglebone-black", 
"ti,beaglebone-green";
    part-number = "PDM-PWM1";
    version = "00A0";
    
    exclusive-use =
        /* PINS */
        "P8.36",
        "P8.34",
        /* devices */
        "ehrpwm1A",
        "ehrpwm1B";

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl_spec: Panel_Pins {
                pinctrl-single,pins = <
                    0x0C8 0x02 /* P8_36 MODE3 ehrpwm1A PWM */
                    0x0CC 0x02 /* P9_34 MODE3 ehrpwm1B 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";
        };
    };

};

and it seems to behave, I get pwmchip2 in /sys/class/pwm and it shows up in 
slots but in pins only the first file's pins are shown as assigned.

I don't know if the name Panel_Pins can't be the same in the two files or 
if maybe fragment 1's "pinctrl-0" needs to have a different number or 
what...

Any enlightenment and guidance would be massivly appreciated.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to