Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Support for PWM on RPI3 GPIO




> On Apr 3, 2018, at 8:06 PM, Michael van Elst <mlelstv%serpens.de@localhost> wrote:
> 
> thorpej%me.com@localhost (Jason Thorpe) writes:
> 
>> I see there’s a “bcmpwm” driver, but I’m not sure it’s what I want… Nothing appears to actually use it, as far as I can tell, and there doesn’t seem to be any API *to* use it, nor any obvious documentation on its function.
> 
> Since FDT'ization, the driver isn't usuable and you would need the
> clock driver too that got junked. Both abstract only a little bit
> from the hardware, you want to read BCM2835-ARM-Peripherals.pdf for
> the hardware details.

Ok, I read that document and I think I have my head wrapped around how it works, at least for the basic “PWM algorithm” mode.  It seems like maybe the best way to use them is with sysctls on the Broadcom gpio driver (to set the PWM parameters for that pin and enable it)

> The driver also wasn't exposed to userland and can conflict with
> the vcaudio driver.

Can you explain how it can conflict with vcaudio?  It’s not obvious to me at first glance.  Alas, I do also want to use audio in my application (but I don’t need video at all — console is going to be on the serial port and brought out the back of the enclosure most likely with an Adafruit FTDI Friend).

>> Anybody have some advice for me?
> 
> The GPIO pin (18 left, 19 right) must be set to alternate
> function 5 to route the PWM engine to the GPIO pin. Unfortunately
> the GPIO driver works only from userland and doesn't configure
> alternate functions. I had a patch somewhere….

Yah, like I said above, at least in the short term, perhaps the best way to make this work is to add sysctls in the Broadcom gpio driver that allow you to fiddle with these special GPIO pin functions (and when enabled, those pins would be blocked from access by the general GPIO framework).

Can you explain what needs to be done to freshen up the PWM driver for this new FDT universe?  (Sorry, I’ve been away from NetBSD for … um… ages, and a lot has changed, so I’ve gotta get my head wrapped back around all this stuff…)

— thorpej




Home | Main Index | Thread Index | Old Index