Page MenuHomeFreeBSD

ftgpio: Add support for Fintek F81865 Super I/O's GPIO
ClosedPublic

Authored by stephane.rochoy_stormshield.eu on Dec 28 2022, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 1:27 AM
Unknown Object (File)
Feb 16 2024, 5:59 PM
Unknown Object (File)
Jan 8 2024, 12:05 PM
Unknown Object (File)
Jan 8 2024, 12:04 PM
Unknown Object (File)
Dec 23 2023, 1:15 AM
Unknown Object (File)
Dec 10 2023, 2:06 PM
Unknown Object (File)
Nov 10 2023, 8:35 PM
Unknown Object (File)
Nov 6 2023, 10:17 PM
Subscribers
Restricted Owners Package

Details

Summary

Add support for Fintek F81865 Super I/O's GPIO via a new ftgpio driver.

Device is properly probed and attached (dmesg | grep -e superio -e gpio while bootverbose):

pcib0: allocated type 4 (0x2e-0x2f) for rid 0 of superio0
pcib0: allocated type 4 (0x4e-0x4f) for rid 0 of superio1
pcib0: allocated type 4 (0x2e-0x2f) for rid 0 of superio0
superio0: <Fintek F81865> at port 0x2e-0x2f on isa0
gpio0: <GPIO Controller on Fintek Super I/O> at GPIO ldn 0x06 on superio0
gpio0: group GPIO0 io is 0x0 (ioreg=0xf0)
gpio0: pin 0<GPIO00> io is input
gpio0: group GPIO0 drive is 0x0 (ioreg=0xf3)
gpio0: pin 0<GPIO00> drive is opendrain
…
gpio0: group GPIO5 io is 0xc0 (ioreg=0xa0)
gpio0: pin 47<GPIO57> io is output
gpio0: group GPIO5 drive is 0x0 (ioreg=0xa3)
gpio0: pin 47<GPIO57> drive is opendrain
…
gpio0: group GPIO6 io is 0x0 (ioreg=0x90)
gpio0: pin 52<GPIO64> io is input
gpio0: group GPIO6 drive is 0x0 (ioreg=0x93)
gpio0: pin 52<GPIO64> drive is opendrain
gpio0: groups GPIO1..GPIO6 enabled
gpiobus0: <GPIO bus> on gpio0
gpioled0: empty pin mask
gpioled1: empty pin mask
gpioc0: <GPIO controller> on gpio0

And gpioctl let me set and clear a pin controling a LED successfully:

# gpioctl -l
pin 00:	1	GPIO00<IN,OD>
…
pin 47:	0	GPIO57<OUT,OD>
…
pin 52:	1	GPIO64<IN,OD>
# gpioctl 47 1
# gpioctl 47 0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 48902
Build 45791: arc lint + arc unit

Event Timeline

sys/dev/superio/superio.c
441

BTW, I wonder if it wouldn't be more consistent with the mask to set .devid to 0x1200. Or, maybe, just remove the mask as this entry seems to be only about one specific device.

Commented on the pull request. I'm inclined to commit this, but would prefer a manual. This review seems to have one, but I didn't see one in the pull request. Maybe it's a separate commit that didn't transfer?

sys/dev/superio/superio.c
441

Mask here makes little sense, I think. The whole point of the mask is to make it easier to support a range of parts since superio parts tended to have a crazy number of variations on a theme, all with different IDs

This revision was not accepted when it landed; it landed in state Needs Review.Feb 28 2023, 6:07 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Feb 28 2023, 6:07 PM