From 3de39fa36fb90624deef854760e64567a9d42747 Mon Sep 17 00:00:00 2001 From: Jeff Li Date: Fri, 17 Dec 2021 17:19:07 +0800 Subject: [PATCH] soc/intel/common/block: add definition of GPIO configuration Add two macros: - PAD_CFG_NF_OWNERSHIP() - PAD_CFG_GPIO_OWNERSHIP() to support setting the Host Software Ownership (own) fields. Signed-off-by: lichenchen.carl Change-Id: Ia3f2ad8658b751156456b69366fa4b1badb8b595 Reviewed-on: https://review.coreboot.org/c/coreboot/+/70421 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Zhang --- .../common/block/include/intelblocks/gpio_defs.h | 12 ++++++++++++ 1 file changed, 12 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 3790ba41d8..654d6f2d98 100644 --- a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h +++ b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h @@ -524,4 +524,16 @@ #endif /* CONFIG_SOC_INTEL_COMMON_BLOCK_GPIO_DUAL_ROUTE_SUPPORT */ +/* Native function configuration */ +#define PAD_CFG_NF_OWNERSHIP(pad, pull, rst, func, own) \ + _PAD_CFG_STRUCT(pad, \ + PAD_RESET(rst) | PAD_FUNC(func) | PAD_TRIG(OFF), \ + PAD_PULL(pull) | PAD_IOSSTATE(TxLASTRxE) | \ + PAD_CFG_OWN_GPIO(own)) + +#define PAD_CFG_GPIO_OWNERSHIP(pad, pull, rst, own) \ + _PAD_CFG_STRUCT(pad, \ + PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_TRIG(OFF), \ + PAD_PULL(pull) | PAD_CFG_OWN_GPIO(own)) + #endif /* _SOC_BLOCK_GPIO_DEFS_H_ */