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>
This commit is contained in:
Lijian Zhao 2017-05-04 13:18:02 -07:00 committed by Aaron Durbin
parent 48dbc663d7
commit 4becfcdafc
2 changed files with 10 additions and 3 deletions

View File

@ -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) \

View File

@ -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))