Lijian Zhao has uploaded a new change for review. ( https://review.coreboot.org/19576 )
Change subject: soc/intel/apollolake: Add marco to define IOSTERM for GPIO config ......................................................................
soc/intel/apollolake: Add marco to define IOSTERM for GPIO config
Add marco to config GPIO IOSTERM bits.
TEST=None
Change-Id: I178f6d3055d4620cb3c895245c40f324383873ad Signed-off-by: Lijian Zhao lijian.zhao@intel.com --- M src/soc/intel/apollolake/include/soc/gpio.h M src/soc/intel/apollolake/include/soc/gpio_defs.h 2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/19576/1
diff --git a/src/soc/intel/apollolake/include/soc/gpio.h b/src/soc/intel/apollolake/include/soc/gpio.h index f1020f6..84ff528 100644 --- a/src/soc/intel/apollolake/include/soc/gpio.h +++ b/src/soc/intel/apollolake/include/soc/gpio.h @@ -48,6 +48,7 @@ #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 | \ @@ -70,6 +71,10 @@ _PAD_CFG_STRUCT(pad, PAD_RESET(rst) | PAD_FUNC(func), PAD_PULL(pull) | \ PAD_IOSSTATE(iosstate))
+#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_IOSTERM(iosterm) + /* General purpose output, no pullup/down. */ #define PAD_CFG_GPO(pad, val, rst) \ _PAD_CFG_STRUCT(pad, \ diff --git a/src/soc/intel/apollolake/include/soc/gpio_defs.h b/src/soc/intel/apollolake/include/soc/gpio_defs.h index 1694d10..938d414 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))