From 4becfcdafc2a9c6220140c3c603f8efdac1cbdd7 Mon Sep 17 00:00:00 2001 From: Lijian Zhao Date: Thu, 4 May 2017 13:18:02 -0700 Subject: soc/intel/apollolake: Add macro to define IOSTERM for GPIO config Add macro to config GPIO IOSTERM bits. BUG=b:37998248 Change-Id: I178f6d3055d4620cb3c895245c40f324383873ad Signed-off-by: Lijian Zhao Reviewed-on: https://review.coreboot.org/19576 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/soc/intel/apollolake/include/soc/gpio.h | 9 ++++++--- src/soc/intel/apollolake/include/soc/gpio_defs.h | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/soc/intel/apollolake') diff --git a/src/soc/intel/apollolake/include/soc/gpio.h b/src/soc/intel/apollolake/include/soc/gpio.h index f1020f630a..85fc759bcd 100644 --- a/src/soc/intel/apollolake/include/soc/gpio.h +++ b/src/soc/intel/apollolake/include/soc/gpio.h @@ -48,6 +48,7 @@ int gpi_status_get(const struct gpi_status *sts, gpio_t gpi); #define PAD_RESET(value) PAD_CFG0_RESET_##value #define PAD_PULL(value) PAD_CFG1_PULL_##value #define PAD_IOSSTATE(value) PAD_CFG1_IOSSTATE_##value +#define PAD_IOSTERM(value) PAD_CFG1_IOSTERM_##value #define PAD_IRQ_CFG(route, trig, inv) \ (PAD_CFG0_ROUTE_##route | \ PAD_CFG0_TRIG_##trig | \ @@ -62,13 +63,15 @@ int gpi_status_get(const struct gpi_status *sts, gpio_t gpi); /* Native function configuration */ #define PAD_CFG_NF(pad, pull, rst, func) \ - _PAD_CFG_STRUCT(pad, PAD_RESET(rst) | PAD_FUNC(func), PAD_PULL(pull) | \ - PAD_IOSSTATE(TxLASTRxE)) + PAD_CFG_NF_IOSSTATE(pad, pull, rst, func, TxLASTRxE) /* Native function configuration for standby state */ #define PAD_CFG_NF_IOSSTATE(pad, pull, rst, func, iosstate) \ + PAD_CFG_NF_IOSSTATE_IOSTERM(pad,pull, rst, func, iosstate, SAME) + +#define PAD_CFG_NF_IOSSTATE_IOSTERM(pad, pull, rst, func, iosstate, iosterm) \ _PAD_CFG_STRUCT(pad, PAD_RESET(rst) | PAD_FUNC(func), PAD_PULL(pull) | \ - PAD_IOSSTATE(iosstate)) + PAD_IOSSTATE(iosstate) | PAD_IOSTERM(iosterm)) /* General purpose output, no pullup/down. */ #define PAD_CFG_GPO(pad, val, rst) \ diff --git a/src/soc/intel/apollolake/include/soc/gpio_defs.h b/src/soc/intel/apollolake/include/soc/gpio_defs.h index 1694d10949..938d4148f1 100644 --- a/src/soc/intel/apollolake/include/soc/gpio_defs.h +++ b/src/soc/intel/apollolake/include/soc/gpio_defs.h @@ -125,6 +125,10 @@ #define PAD_CFG1_IOSSTATE_IGNORE (0xf << 0) /* Ignore Iostandby */ #define PAD_CFG1_IOSSTATE_MASK 0xf /* mask to extract Iostandby bits */ #define PAD_CFG1_IOSSTATE_SHIFT 14 /* set Iostandby bits [17:14] */ +#define PAD_CFG1_IOSTERM_SAME (0x0 << 8) /* Same as functional mode */ +#define PAD_CFG1_IOSTERM_DISPUPD (0x1 << 8) /* Disable Pull-up/Pull-down */ +#define PAD_CFG1_IOSTERM_ENPD (0x2 << 8) /* Enable Pull-down */ +#define PAD_CFG1_IOSTERM_ENPU (0x3 << 8) /* Enable Pull-up */ #define PAD_CFG_BASE 0x500 #define PAD_CFG_OFFSET(pad) (PAD_CFG_BASE + ((pad) * 8)) -- cgit v1.2.3