Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2019 16:06:39 -0600
From:      Sergey Manucharian <sm@ara-ler.com>
To:        Nicola Mingotti <nmingotti@gmail.com>
Cc:        freebsd-arm@freebsd.org, nmingott@gmail.com
Subject:   Re: How to set PWM tunable name to ehrpwm.1 ?
Message-ID:  <20190606220639.GE13546@eldorado>
In-Reply-To: <68790975-a5a5-2138-ca89-117878d6cf2d@gmail.com>
References:  <68790975-a5a5-2138-ca89-117878d6cf2d@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Excerpts from Nicola Mingotti's message from Thu 06-Jun-19 12:33:
> 
> In my BeagleBone Black, FreeBSD-12 RELEASE, i created two overlays, 
> pwm.dtso and pwm1.dtso. They enable the PWM pins p9.21, p9.22 and 
> respectively p9.14, p9.16. DTSO files are below.
> 
> If I load both the DTBO at boot I see correctly|ehrpwm.0|and|ehrpwm.1|, 
> associated to the correct pins. But, if i remove the 
> overlay|pwm.dtbo|then i seen only|ehrpwm.0|in|sysctl -a|, which is not 
> what i want, i would like to see the name|ehrpwm.1|.
> 
> This is important because i must be 100% sure a certain pin corresponds 
> the a certain tunable.This must be true even if i remove non relevant 
> overlays in the future. I guess there must be some parameter in the DTSO 
> which i don't know, i hope you can give me some directions about that.

It is not related to your DTBO's. That's how everything works (at least
by default). You will see the same naming issue with serial ports, for
example. And not just in BBB. 

E.g. when I have enabled uart0 and uart2 they are named ttyu0 and ttyu1,
if I have only uart2, it becomes ttyu0.

It's easier if there is a device node in /dev, so you can create a symlink 
with a fixed name (I have a script called by devd for my multiple serial 
ports). However, that's not the case with PWM...

Maybe there is an option to use persistent names for devices that somebody
can point to.

S.

> /dts-v1/;
> /plugin/;
>
> / {
>     compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
>     exclusive-use =
>     "P9.21","P9.22","ehrpwm0_AB";
> };
>
> &am33xx_pinmux {
> ehrpwm0_AB_pins: pinmux_ehrpwm0_AB_pins {
>     pinctrl-single,pins = <
>         0x154 0x03 /* P9.21 */
>         0x150 0x03 /* P9.22 */ 
>         >;
>     };
> };
>
> &ehrpwm0 {
>     status = "okay";
>     pinctrl-names = "default";
>     pinctrl-0 = <&ehrpwm0_AB_pins>; };
> &epwmss0 {
>     status = "okay";
> };
> &ecap0 {
>     status = "okay";
> };
>
> /dts-v1/;
> /plugin/;
> / {
>     compatible = "ti,am335x-bone-black","ti,am335x-bone", "ti,am33xx";
>     exclusive-use =
>     "P9.14","P9.16","ehrpwm1_AB";
> };
>
> &am33xx_pinmux {
> ehrpwm1_AB_pins: pinmux_ehrpwm1_AB_pins {
>     pinctrl-single,pins = < 
>         0x048 0x06 /* P9.14 */
>         0x04C 0x06 /* P9.16 */ 
>         >;
>     };
> };
>
> &ehrpwm1 {
>     status = "okay";
>     pinctrl-names = "default";
>     pinctrl-0 = <&ehrpwm1_AB_pins>;
> };
>
> &epwmss1 {
>     status = "okay";
> };
>
> &ecap1 {
>     status = "okay";
> };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190606220639.GE13546>