Page MenuHomeFreeBSD

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

Authored by thj on Nov 14 2017, 2:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 12:07 AM
Unknown Object (File)
Fri, Apr 19, 1:27 PM
Unknown Object (File)
Fri, Apr 19, 1:27 PM
Unknown Object (File)
Fri, Apr 19, 1:27 PM
Unknown Object (File)
Fri, Apr 19, 1:26 PM
Unknown Object (File)
Fri, Apr 19, 1:26 PM
Unknown Object (File)
Thu, Apr 18, 1:16 PM
Unknown Object (File)
Wed, Apr 17, 3:16 AM

Details

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
Tests Skipped

Event Timeline

thj created this object with visibility "thj (Tom Jones)".
thj changed the visibility from "thj (Tom Jones)" 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 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.

thj marked 4 inline comments as done.Nov 17 2017, 6:49 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
thj marked an inline comment as done.Nov 17 2017, 8:12 PM

Code part looks good to me

This revision is now accepted and ready to land.Dec 5 2017, 12:30 AM
This revision was automatically updated to reflect the committed changes.