intel/common/block/gpio: only reset configured SMI instead of all

Currently, when a SMI GPIO gets configured, the whole status register is
get written back and thus, all SMIs get reset.

Do it right and reset only the correspondig status bit of the GPIO to be
configured.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Change-Id: Iecf789d3009011381835959cb1c166f703f1c0cc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48089
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Michael Niewöhner 2020-11-23 15:42:49 +01:00
parent 6a62cc85e6
commit c3ab442cc1
1 changed files with 7 additions and 7 deletions

View File

@ -154,9 +154,9 @@ static void gpio_configure_owner(const struct pad_config *cfg,
static void gpi_enable_smi(const struct pad_config *cfg, static void gpi_enable_smi(const struct pad_config *cfg,
const struct pad_community *comm) const struct pad_community *comm)
{ {
uint32_t value;
uint16_t sts_reg; uint16_t sts_reg;
uint16_t en_reg; uint16_t en_reg;
uint32_t en_value;
int group; int group;
int pin; int pin;
@ -165,15 +165,15 @@ static void gpi_enable_smi(const struct pad_config *cfg,
pin = relative_pad_in_comm(comm, cfg->pad); pin = relative_pad_in_comm(comm, cfg->pad);
group = gpio_group_index(comm, pin); group = gpio_group_index(comm, pin);
sts_reg = GPI_SMI_STS_OFFSET(comm, group); sts_reg = GPI_SMI_STS_OFFSET(comm, group);
value = pcr_read32(comm->port, sts_reg); en_reg = GPI_SMI_EN_OFFSET(comm, group);
/* Write back 1 to reset the sts bits */ en_value = gpio_bitmask_within_group(comm, pin);
pcr_write32(comm->port, sts_reg, value);
/* Write back 1 to reset the sts bit */
pcr_rmw32(comm->port, sts_reg, en_value, 0);
/* Set enable bits */ /* Set enable bits */
en_reg = GPI_SMI_EN_OFFSET(comm, group); pcr_or32(comm->port, en_reg, en_value);
pcr_or32(comm->port, en_reg, gpio_bitmask_within_group(comm, pin));
} }
static void gpio_configure_itss(const struct pad_config *cfg, uint16_t port, static void gpio_configure_itss(const struct pad_config *cfg, uint16_t port,