Page MenuHomeFreeBSD

Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.
ClosedPublic

Authored by ian on Dec 6 2019, 9:42 PM.

Details

Summary

It used to be required that a device be a child of gpiobus(4) to manipulate gpio pins. That requirement didn't work well for FDT-based systems with many cross-hierarchy users of gpio, so a more modern framework was created that removed the old hierarchy requirement.

These changes adapt the owc_gpiobus driver to use the newer gpio_pin_* functions to acquire, release, and manipulate gpio pins. This allows a single driver to work for both hinted-attachment and fdt-based systems, and removes the requirement that any one-wire fdt nodes must appear at the root of the devicetree.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 28068

Event Timeline

I'll take a look at this and make sure my setup still work w/minimum of hassle.

In D22710#496964, @imp wrote:

I'll take a look at this and make sure my setup still work w/minimum of hassle.

It should work with absolutely no changes at all to fdt data. If you have to change anything, let me know.

Works fine for me on Raspberry Pi 2 running patched 13.0-CURRENT. Patch was applied on r355585

Update to incorporate change just committed to head that defers attachment of the ow bus until after interrupts are working.

This patch allows to seamlessly get ow_tem(4) working over 1-wire bus on boards, where building custom overlay is more problematic like for Pine64-LTS.
For this board only adding a few lines to /boot/loader.conf is required:

hint.owc.0.at=gpiobus0
hint.owc.0.pin_list=18
ow_load="YES"
owc_load="YES"
ow_temp_load="YES"

Thank you for such a nice Christmas gift Ian !

This revision is now accepted and ready to land.Dec 11 2019, 3:37 PM

This looks good me, but time has gotten away from me to set it up.