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

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2019-06-06 at 16:06 -0600, Sergey Manucharian wrote:
> 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.
> 

Nope, there's no magic thing you're missing that fixes this.  Devices
get named-and-numbered based on the order of instantiation.

Since what really matters here is the sysctl names, we could change the
driver to install the sysctl nodes using the fdt device node names
instead of the freebsd newbus device names.  Hmm, actually, since
people may be relying on the current names, I guess what we'd have to
do is install another set of sysctl names based on fdt name (basically
a set of alias names).

-- Ian




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