Page MenuHomeFreeBSD

Implement pinctl functionality for Raspberr Pi platform
ClosedPublic

Authored by gonzo on Jan 29 2018, 2:59 AM.

Details

Summary

On Raspberry Pi platform GPIO controller also responsible for pins
multiplexing. Pi code predates proper FDT support in FreeBSD so a
lot of pinmux info is hardcoded. This patch:

  • Implements pinctl methods in bcm2835_gpio
  • Converts all devices with ad-hoc pinmux info to proper pin control mechanisms and adds pinmux info in FreeBSD's custom dts files.
  • Add fdt_pinctl option to RPI2 kernel

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

At first glance this looks ok, I'll review more and test on different RPI tonight.
Thank you for working on this.

Do not include GPL bindings header

Just this comment but otherwise it looks good.
Thanks for working on this

Tested-On: RPI-B
Tested-On: RPI-0 v1.2

sys/arm/broadcom/bcm2835/bcm2835_gpio.c
1234 ↗(On Diff #38645)

It misses an OF_prop_free(pins) here

sys/arm/broadcom/bcm2835/std.rpi
4 ↗(On Diff #38645)

This should be in the relevant kernel config files

  • Fix memory leak
  • Move fdt_pinctrl to relevant config files
This revision is now accepted and ready to land.Feb 1 2018, 11:17 AM
imp added inline comments.
sys/arm/conf/RPI-B
93 ↗(On Diff #38750)

So this isn't in GENERIC? Why not?

sys/arm/conf/RPI-B
93 ↗(On Diff #38750)

It's already in GENERIC on armv7 and arm64

I see no further issues

sys/arm/conf/RPI-B
93 ↗(On Diff #38750)

That's what I get for grepping for fdt_pinmux :)

This revision was automatically updated to reflect the committed changes.