Feature #319

denverton_ns: Add ASL to support Linux pinctrl driver (GPIO controller)

Added by King Sumo about 2 months ago.

Status:NewStart date:09/02/2021
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

ASL code to support the Linux pinctrl driver is missing for denverton_ns platform, the below patch adds the very basic functionality in order to Linux driver find the GPIO controller via INTC3000 APCI id:
https://review.coreboot.org/c/coreboot/+/56975

soc/intel/denverton_ns: Add GPIO controller ASL

Add support for the pinctrl denverton Linux driver which provides an interface
that allows configuring of Intel Denverton SoC pins and using them as GPIOs.

Test using the sysfs interface:
- Load the pinctrl-denverton module, sysfs interface available in the
/sys/kernel/debug/pinctrl/INTC3000:00 folder.
- Export the GPIO (here we are using GPIO_10):
~> cd /sys/kernel/debug/pinctrl/INTC3000:00/
~> grep GPIO_10 pinconf-pins
pin 139 (GPIO_10): input bias disabled
~> cat gpio-ranges
GPIO ranges handled:
0: INTC3000:00 GPIOS [358 - 511] PINS [0 - 153]
~> echo $((358+139)) > /sys/class/gpio/export
- Above GPIO's are starting at 358 with GPIO_10 at 139 offset, the sysfs folder
for controlling the pin will be /sys/class/gpio/gpio497 (358+139).
- Input mode:
~> cd /sys/class/gpio/gpio497
~> echo in > direction
~> cat value
0
~> cat value
1
- Output mode:
~> cd /sys/class/gpio/gpio497
~> echo out > direction
~> echo 1 > value
~> echo 0 > value

Also available in: Atom PDF