From 3ef23c9a881fee5a6a639eabfb85d98b4d7776d5 Mon Sep 17 00:00:00 2001 From: Cliff Huang Date: Thu, 13 Feb 2025 22:58:54 -0800 Subject: [PATCH] soc/intel/common/gpio: Add macro for interrupt GPI with driver mode Adds PAD_CFG_GPI_APIC_DRIVER macros to configure interrupt pad with driver mode. This is needed when a PAD is configured as an interrupt such that the corresponding GPI_IS status bit can be updated by the host controller hardware. BUG=none TEST=Check a GPIO pad that is used as interrupt via GpioInt in the ACPI device _CRS method and check the interrupt has been assigned in /proc/interrupts. Signed-off-by: Cliff Huang Change-Id: Ibc1ed3089c24302bc7eb02318714b8ec464fad01 Reviewed-on: https://review.coreboot.org/c/coreboot/+/86414 Reviewed-by: Wonkyu Kim Reviewed-by: Kyoung Il Kim Reviewed-by: Bora Guvendik Tested-by: build bot (Jenkins) --- .../intel/common/block/include/intelblocks/gpio_defs.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h index f0ff08c492..bcf8e73f7e 100644 --- a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h +++ b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h @@ -436,6 +436,14 @@ PAD_IRQ_CFG(IOAPIC, trig, inv), PAD_PULL(pull) | \ PAD_IOSSTATE(TxDRxE)) +/* General purpose input, routed to APIC, HostOwn */ +#define PAD_CFG_GPI_APIC_DRIVER(pad, pull, rst, trig, inv) \ + _PAD_CFG_STRUCT(pad, \ + PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_BUF(TX_DISABLE) | \ + PAD_IRQ_CFG(IOAPIC, trig, inv), PAD_PULL(pull) | \ + PAD_IOSSTATE(TxDRxE) | \ + PAD_CFG_OWN_GPIO(DRIVER)) + /* General purpose input with lock, routed to APIC */ #define PAD_CFG_GPI_APIC_LOCK(pad, pull, trig, inv, lock_action) \ _PAD_CFG_STRUCT_LOCK(pad, \