Attention is currently required from: Maxim Polyakov. Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47595
to look at the new patch set (#5).
Change subject: ec/kontron/kempld: Add minimal GPIO driver ......................................................................
ec/kontron/kempld: Add minimal GPIO driver
This patch adds an interface for configuring GPIOs inside the Kontron CPLD/EC. There are several ways to do this: you can enable <ec/kontron/ kempel/kempeld.h> in the source codes with board initialization and configure/manage each pad using the API or statically define the GPIO configuration in devicetree.cb. For example:
chip ec/kontron/kempld device gpio 0 on register "gpio_pad[0]" = "KEMPLD_PAD_GPIO_CFG_IN" register "gpio_pad[4]" = "KEMPLD_PAD_GPIO_CFG_OUT(1)" register "gpio_pad[5]" = "KEMPLD_PAD_GPIO_CFG_OUT(0)" end end
KEMPLD_PAD_GPIO_CFG_IN - configure the pad as an input; KEMPLD_PAD_GPIO_CFG_OUT(1) - configure the pad as an output, set to 1; KEMPLD_PAD_GPIO_CFG_OUT(0) - configure the pad as an output, set to 0.
The pad configuration is set using the options gpio_pad[], however, if this option is not set, the corresponding pad will be configured as an input. In this case, <device gpio 0>, like all other devices, is not a real device inside the EC. These definitions are used to understand the EC resources and systematize configuration options, but if mark this as <off>, the initialization step will be skipped in the driver code.
This work is based on code from the drivers/gpio/gpio-kempld.c linux driver. Tested on Kontron mAL-10 COMe module CB:54380 .
Change-Id: Id767aa451fbf2ca1c0dccfc9aa2c024c6f37c1bb Signed-off-by: Maxim Polyakov max.senia.poliak@gmail.com --- M src/ec/kontron/kempld/Makefile.inc M src/ec/kontron/kempld/chip.h M src/ec/kontron/kempld/kempld.c M src/ec/kontron/kempld/kempld.h A src/ec/kontron/kempld/kempld_gpio.c M src/ec/kontron/kempld/kempld_internal.h 6 files changed, 133 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/47595/5