diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2016-06-06 17:13:42 -0700 |
---|---|---|
committer | Duncan Laurie <dlaurie@chromium.org> | 2016-06-09 17:07:26 +0200 |
commit | 7f3156dad67ad35f02afedd85cdf4a19e3c0875e (patch) | |
tree | 4584c4d6f24327279abf6de0864e0daffdf3fe48 /src/soc/intel/skylake/gpio.c | |
parent | 205ed2d2b58f9b93c7c665002aef0c775e64cf63 (diff) |
skylake: gpio: Add support for setting 1.8V tolerant
Add the voltage tolerance GPIO attribute for configuring I2C/I2S buses
that are at 1.8V. This is currently done by passing in a value to FSP
but it is needed earlier than FSP if the I2C bus is used in verstage.
This does not remove the need for the FSP input parameter, that is
still required so FSP doesn't disable what has been set in coreboot.
The mainboards that are affected are updated in this commit.
This was tested by exercising I2C transactions to the 1.8V codec while
in verstage on the google/chell mainboard.
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Change-Id: I93d22c2e3bc0617c87f03c37a8746e22a112cc9c
Reviewed-on: https://review.coreboot.org/15103
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/intel/skylake/gpio.c')
-rw-r--r-- | src/soc/intel/skylake/gpio.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/soc/intel/skylake/gpio.c b/src/soc/intel/skylake/gpio.c index a7d88326d1..78495c6467 100644 --- a/src/soc/intel/skylake/gpio.c +++ b/src/soc/intel/skylake/gpio.c @@ -305,9 +305,8 @@ static void gpio_configure_pad(const struct pad_config *cfg) { uint32_t *dw_regs; uint32_t reg; - uint32_t termination; uint32_t dw0; - const uint32_t termination_mask = PAD_TERM_MASK << PAD_TERM_SHIFT; + uint32_t mask; dw_regs = gpio_dw_regs(cfg->pad); @@ -318,10 +317,16 @@ static void gpio_configure_pad(const struct pad_config *cfg) write32(&dw_regs[0], dw0); reg = read32(&dw_regs[1]); - reg &= ~termination_mask; - termination = cfg->attrs; - termination &= termination_mask; - reg |= termination; + + /* Apply termination field */ + mask = PAD_TERM_MASK << PAD_TERM_SHIFT; + reg &= ~mask; + reg |= cfg->attrs & mask; + + /* Apply voltage tolerance field */ + mask = PAD_TOL_MASK << PAD_TOL_SHIFT; + reg &= ~mask; + reg |= cfg->attrs & mask; write32(&dw_regs[1], reg); gpio_handle_pad_mode(cfg); @@ -329,7 +334,7 @@ static void gpio_configure_pad(const struct pad_config *cfg) if ((dw0 & PAD_FIELD(GPIROUTSMI, MASK)) == PAD_FIELD(GPIROUTSMI, YES)) gpi_enable_smi(cfg->pad); - if(gpio_debug) + if (gpio_debug) printk(BIOS_DEBUG, "Write Pad: Base(%p) - conf0 = %x conf1= %x pad # = %d\n", &dw_regs[0], dw0, reg, cfg->pad); |