summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/gpio/gpio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 1bc34e7fc3..a833aaebb9 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -520,13 +520,14 @@ int gpio_lock_pads(const struct gpio_lock_config *pad_list, const size_t count)
__func__, pad);
continue;
}
+ /* PADCFGLOCK and PADCFGLOCKTX registers for each community are contiguous */
offset += gpio_group_index_scaled(comm, rel_pad, 2 * sizeof(uint32_t));
data = gpio_bitmask_within_group(comm, rel_pad);
msg.pid = comm->port;
msg.offset = offset;
- if (action & GPIO_LOCK_CONFIG) {
+ if ((action & GPIO_LOCK_CONFIG) == GPIO_LOCK_CONFIG) {
if (CONFIG(DEBUG_GPIO))
printk(BIOS_INFO, "%s: Locking pad %d configuration\n",
__func__, pad);
@@ -537,11 +538,11 @@ int gpio_lock_pads(const struct gpio_lock_config *pad_list, const size_t count)
}
}
- if (action & GPIO_LOCK_TX) {
+ if ((action & GPIO_LOCK_TX) == GPIO_LOCK_TX) {
if (CONFIG(DEBUG_GPIO))
printk(BIOS_INFO, "%s: Locking pad %d TX state\n",
__func__, pad);
- msg.offset += 4;
+ msg.offset += sizeof(uint32_t);
status = pcr_execute_sideband_msg(&msg, &data, &response);
if ((err = sideband_msg_err(status, response)) != 0) {
err_response = err;