Add chvgpio driver for gpio present of Intel z8000 series (Cherry View) SOC
AcceptedPublic

Authored by jones_sdf.org on Nov 14 2017, 2:53 PM.

Details

Reviewers
gonzo
gavin
Group Reviewers
manpages
Summary

Add chvgpio that supports the gpio driver found on Intel z8000 series system on chips.
This driver is based on the chvgpio driver from OpenBSD heavily refactored to match
FreeBSD gpio subsystem.

This revision does not support the interupt mechanisms on the gpio controller. The
hardware I have requires other devices drivers before I will be able to test these.

There is a test program here:
https://github.com/adventureloop/gpdpocket/blob/master/gpdfand.sh

that controls the gpio connect fan in my Cherryview laptop (GPD Pocket)

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
jones_sdf.org created this revision.Nov 14 2017, 2:53 PM
jones_sdf.org created this object with visibility "jones_sdf.org (jones@sdf.org)".
jones_sdf.org changed the visibility from "jones_sdf.org (jones@sdf.org)" to "Public (No Login Required)".

Is the name correct?

https://ark.intel.com/search?q=Cherry+View -- nothing found.
https://ark.intel.com/search?q=Atom+Z8 -- finds several "Processor X Series" chips; click one, and it lists the codename as "Cherry Trail".

Is the name correct?

https://ark.intel.com/search?q=Cherry+View -- nothing found.
https://ark.intel.com/search?q=Atom+Z8 -- finds several "Processor X Series" chips; click one, and it lists the codename as "Cherry Trail".

I think this is particularly confusing. My understanding is that Intel changed the platform code name from Cherry Trail to 'Products formerly Cherry Trail' as seen here:
https://ark.intel.com/products/codename/46629/Cherry-Trail

The other implementations of this gpio controller refer to the codename as CherryView (sans space) as can be seen here:
https://github.com/torvalds/linux/blob/master/drivers/pinctrl/intel/pinctrl-cherryview.c
https://github.com/openbsd/src/blob/master/sys/dev/acpi/chvgpio.c

With OpenBSD using CherryView in the man page for the device:
https://man.openbsd.org/chvgpio.4

I don't really know which is the correct name to use with these devices, but I would favour consistency across platforms.
I would like to keep the driver name inline with OpenBSD so that the same devices attach on the same hardware.

wblock added a subscriber: wblock.Nov 17 2017, 4:26 PM
wblock added inline comments.
share/man/man4/chvgpio.4
39

This will read a little weird: "The chvgpio is a driver..."

I suggest removing "The".

40
is a driver for the GPIO controller in Intel's Cherry View System on Chip
43
The Cherry View...
45

Needs markup on the device name, possibly .Pa:

All but VIRTUAL are exposed to userland as
.Pa /dev/gpiocN ,
where N is 0-3.

Remove #if 0'd code.

Update chvgpio.4 based on comments.

jones_sdf.org marked 4 inline comments as done.Nov 17 2017, 6:49 PM
wblock added inline comments.Nov 17 2017, 7:50 PM
share/man/man4/chvgpio.4
42

This still needs a "The" at the beginning of the sentence.

The Cherry View SoC has 5 banks of GPIO pins, NORTH, EAST, SOUTHEAST, SOUTHWEST and

Add leading 'The'

jones_sdf.org marked an inline comment as done.Nov 17 2017, 8:12 PM
gonzo accepted this revision.Dec 5 2017, 12:30 AM

Code part looks good to me

This revision is now accepted and ready to land.Dec 5 2017, 12:30 AM