diff options
author | Lijian Zhao <lijian.zhao@intel.com> | 2017-05-04 13:18:02 -0700 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-05-12 20:17:34 +0200 |
commit | 4becfcdafc2a9c6220140c3c603f8efdac1cbdd7 (patch) | |
tree | 3cf7648e658228d6a1773b7302845f251cb803fb /src | |
parent | 48dbc663d75e6b7e45e50cd099acb88b35e65a0a (diff) |
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 <lijian.zhao@intel.com>
Reviewed-on: https://review.coreboot.org/19576
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/apollolake/include/soc/gpio.h | 9 | ||||
-rw-r--r-- | src/soc/intel/apollolake/include/soc/gpio_defs.h | 4 |
2 files changed, 10 insertions, 3 deletions
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)) |