mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-10-19 20:44:35 +00:00
7ac99be6e2
Add a driver which sets up the pin configuration on x86 devices with an ICH6 (or later) Platform Controller Hub. The driver is not in the pinctrl uclass due to some oddities of the way x86 devices work: - The GPIO controller is not present in I/O space until it is set up - This is done by writing a register in the PCH - The PCH has a driver which itself uses PCI, another driver - The pinctrl uclass requires that a pinctrl device be available before any other device can be probed It would be possible to work around the limitations by: - Hard-coding the GPIO address rather than reading it from the PCH - Using special x86 PCI access to set the GPIO address in the PCH However it is not clear that this is better, since the pin configuration driver does not actually provide normal pin configuration services - it simply sets up all the pins statically when probed. While this remains the case, it seems better to use a syscon uclass instead. This can be probed whenever it is needed, without any limitations. Also add an 'invert' property to support inverting the input. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
32 lines
1.3 KiB
Text
32 lines
1.3 KiB
Text
Intel x86 PINCTRL/GPIO controller
|
|
|
|
Pin-muxing on x86 can be described with a node for the PINCTRL master
|
|
node and a set of child nodes for each pin on the SoC.
|
|
|
|
The PINCTRL master node requires the following properties:
|
|
- compatible : "intel,x86-pinctrl"
|
|
|
|
Pin nodes must be children of the pinctrl master node and can
|
|
contain the following properties:
|
|
- pad-offset - (required) offset in the IOBASE for the pin to configured.
|
|
- gpio-offset - (required) offset in the GPIOBASE for the pin to configured and
|
|
also the bit shift in this register.
|
|
- mode-gpio - (optional) standalone property to force the pin into GPIO mode.
|
|
- mode-func - (optional) function number to assign to the pin. if 'mode-gpio'
|
|
is set, this property will be ignored.
|
|
in case of 'mode-gpio' property set:
|
|
- output-value - (optional) this set the default output value of the GPIO.
|
|
- direction - (optional) this set the direction of the gpio.
|
|
- pull-str - (optional) this set the pull strength of the pin.
|
|
- pull-assign - (optional) this set the pull assignement (up/down) of the pin.
|
|
- invert - (optional) this input pin is inverted
|
|
|
|
Example:
|
|
|
|
pin_usb_host_en0@0 {
|
|
gpio-offset = <0x80 8>;
|
|
pad-offset = <0x260>;
|
|
mode-gpio;
|
|
output-value = <1>;
|
|
direction = <PIN_OUTPUT>;
|
|
};
|