Bug 282738

Summary: Add support for Nuvoton NCT6122D/NCT6126D.
Product: Base System Reporter: Matthew.Nygard.Dodd
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: avg
Priority: ---    
Version: 14.1-STABLE   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Patch implementing described changes.
none
Patch implementing described changes.
none
Patch implementing described changes. none

Description Matthew.Nygard.Dodd 2024-11-13 22:25:50 UTC
Created attachment 255149 [details]
Patch implementing described changes.

Add support for Nuvoton NCT6122D/NCT6126D - superio(9), nctgpio(9), ncthwm(9)
- GPIO for LDN 7 & 9.
- HWM for LDN 11
- Provide LDN based matching for GPIO devices.
- Provide gpio(9) hint flag (NCT_NO_ENABLE) for skipping GPIO enable, to avoid altering BIOS setting.
- Allocate GPIO ioports as shareable.
- Constrain mask based matching for existing NCT6112D/NCT6114D/NCT6116D.

Tested on Asus N97T-IM-A:

(dmesg output)
superio0: <Nuvoton NCT6122D/NCT6126D> at port 0x2e-0x2f on isa0
gpio0: <GPIO on Nuvoton NCT6122D/NCT6126D> at GPIO ldn 0x07 on superio0
gpio0: skipping enable.
gpiobus0: <GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0
gpio1: <GPIO on Nuvoton NCT6122D/NCT6126D> at GPIO ldn 0x09 on superio0
gpio1: skipping enable.
gpiobus1: <GPIO bus> on gpio1
gpioc1: <GPIO controller> on gpio1
ncthwm0: <HWM on Nuvoton NCT6122D/NCT6126D> at HWM ldn 0x0b on superio0

(sysctl)
dev.ncthwm.0.AUXFAN2: 0
dev.ncthwm.0.AUXFAN1: 0
dev.ncthwm.0.AUXFAN0: 0
dev.ncthwm.0.CPUFAN: 0
dev.ncthwm.0.SYSFAN: 796
Comment 1 Andriy Gapon freebsd_committer freebsd_triage 2024-11-14 07:58:29 UTC
(In reply to Matthew.Nygard.Dodd from comment #0)
Could you please open a phabricator review request, if not yet?
https://reviews.freebsd.org/
Comment 2 Matthew.Nygard.Dodd 2024-11-14 14:56:30 UTC
https://reviews.freebsd.org/D47571
Comment 3 Matthew.Nygard.Dodd 2024-11-25 23:06:56 UTC
Created attachment 255458 [details]
Patch implementing described changes.

Directly match ChipID.
Comment 4 Matthew.Nygard.Dodd 2024-11-27 18:48:04 UTC
Created attachment 255497 [details]
Patch implementing described changes.

Refine matching, per discussion.