From 0e4f83e7b0c6719872b2eef41a0da7b7e8dceab3 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sat, 22 Jul 2017 12:16:11 +0200 Subject: sb/intel/common/gpio: Only set one bit at time Make sure to set only one bit instead of arbitrary bits set in argument. Change-Id: I39426193d15d8581f79bc2a45c0edb53b19a2cd3 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/20707 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/southbridge/intel/common/gpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/southbridge/intel/common/gpio.c b/src/southbridge/intel/common/gpio.c index d861383ddd..caf24f44c8 100644 --- a/src/southbridge/intel/common/gpio.c +++ b/src/southbridge/intel/common/gpio.c @@ -142,7 +142,8 @@ void set_gpio(int gpio_num, int value) config = inl(gpio_base + gpio_reg_offsets[index]); config &= ~(1 << bit); - config |= value << bit; + if (value != 0) + config |= (1 << bit); outl(config, gpio_base + gpio_reg_offsets[index]); } -- cgit v1.2.3