From 727a224aedfb3d7d01aa5e165f6801b026e1fafa Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 16 Feb 2022 16:15:46 +0100 Subject: amd/common/block/gpio/gpio: don't use -1 as bitmask in gpio_or32 The and-mask passed to the gpio_update32 call needs all 32 bits to be set to ones. When building as 32 bit binary the -1UL will result in the needed bit mask, but for a 64 bit build the constant would have 64 bits set to ones which then gets truncated to 32 bits causing a compiler error. Use 0xffffffff as bit mask instead which behaves correctly in both cases and also clarifies what this is doing. TEST=Timeless build for Chausie results in identical image. Signed-off-by: Felix Held Change-Id: I0b6a50bd914fdbb7a78885efb6c610715e2d26c1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62053 Reviewed-by: Elyes Haouas Reviewed-by: Raul Rangel Reviewed-by: Aamir Bohra Reviewed-by: Fred Reitberger Reviewed-by: Jason Glenesk Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/gpio/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/soc/amd/common/block/gpio/gpio.c b/src/soc/amd/common/block/gpio/gpio.c index bc3bcab035..468d7aef70 100644 --- a/src/soc/amd/common/block/gpio/gpio.c +++ b/src/soc/amd/common/block/gpio/gpio.c @@ -148,7 +148,7 @@ static void gpio_and32(gpio_t gpio_num, uint32_t mask) static void gpio_or32(gpio_t gpio_num, uint32_t or) { - gpio_update32(gpio_num, -1UL, or); + gpio_update32(gpio_num, 0xffffffff, or); } static void master_switch_clr(uint32_t mask) -- cgit v1.2.3