Bug 224512 - new device ID for nctgpio.c (APU3)
Summary: new device ID for nctgpio.c (APU3)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-STABLE
Hardware: amd64 Any
: --- Affects Many People
Assignee: Oleksandr Tymoshenko
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-12-21 21:53 UTC by mike
Modified: 2018-02-19 19:56 UTC (History)
2 users (show)

See Also:


Attachments
patch against driver source (304 bytes, text/plain)
2017-12-21 21:53 UTC, mike
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mike 2017-12-21 21:53:41 UTC
Created attachment 189024 [details]
patch against driver source

The PCEngines APU3 has a new gpio chip that is not recognized by the existing driver due to a new ID.  The attached simple diff provides GPIO functionality to the APU3 and FreeBSD.
kldload /tmp/nctgpio.ko

gpio0: <Nuvoton NCT5104D (PC-Engines APU3)> at port 0x2e-0x2f on isa0
gpiobus0: <GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0

# gpioctl -l
pin 00: 1       GPIO00<IN,OD>
pin 01: 1       GPIO01<IN,OD>
pin 02: 1       GPIO02<IN,OD>
pin 03: 1       GPIO03<IN,OD>
pin 04: 1       GPIO04<IN,OD>
pin 05: 1       GPIO05<IN,OD>
pin 06: 1       GPIO06<IN,OD>
pin 07: 1       GPIO07<IN,OD>
pin 08: 1       GPIO08<IN,OD>
pin 09: 1       GPIO09<IN,OD>
pin 10: 1       GPIO10<IN,OD>
pin 11: 1       GPIO11<IN,OD>
pin 12: 1       GPIO12<IN,OD>
pin 13: 1       GPIO13<IN,OD>
pin 14: 1       GPIO14<IN,OD>
pin 15: 1       GPIO15<IN,OD>
# sysctl -a | grep gpio
dev.gpioc.0.%parent: gpio0
dev.gpioc.0.%pnpinfo: 
dev.gpioc.0.%location: 
dev.gpioc.0.%driver: gpioc
dev.gpioc.0.%desc: GPIO controller
dev.gpioc.%parent: 
dev.gpiobus.0.%parent: gpio0
dev.gpiobus.0.%pnpinfo: 
dev.gpiobus.0.%location: 
dev.gpiobus.0.%driver: gpiobus
dev.gpiobus.0.%desc: GPIO bus
dev.gpiobus.%parent: 
dev.gpio.0.%parent: isa0
dev.gpio.0.%pnpinfo: 
dev.gpio.0.%location: 
dev.gpio.0.%driver: gpio
dev.gpio.0.%desc: Nuvoton NCT5104D (PC-Engines APU3)
dev.gpio.%parent: 
#
Comment 1 Frank Harv 2017-12-31 11:13:35 UTC
This patch is needed for the APU3 and GPIO.
I hand patched the source code myself earlier with the same results.
Here is a forum thread with some background.
https://forums.freebsd.org/threads/62825/
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-01-02 20:58:11 UTC
A commit references this bug:

Author: gonzo
Date: Tue Jan  2 20:58:05 UTC 2018
New revision: 327502
URL: https://svnweb.freebsd.org/changeset/base/327502

Log:
  nctgpio: add new device id for the GPIO chip in PCEngines APU3

  PR:		224512
  Submitted by:	mike@sentex.net
  MFC after:	2 weeks

Changes:
  head/sys/dev/nctgpio/nctgpio.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-02-19 19:56:08 UTC
A commit references this bug:

Author: gonzo
Date: Mon Feb 19 19:55:30 UTC 2018
New revision: 329603
URL: https://svnweb.freebsd.org/changeset/base/329603

Log:
  MFC r327502:

  nctgpio: add new device id for the GPIO chip in PCEngines APU3

  PR:		224512
  Submitted by:	mike@sentex.net

Changes:
_U  stable/11/
  stable/11/sys/dev/nctgpio/nctgpio.c