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 <felix-coreboot@felixheld.de>
Change-Id: I0b6a50bd914fdbb7a78885efb6c610715e2d26c1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62053
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Aamir Bohra <aamirbohra@gmail.com>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held
2022-02-16 16:15:46 +01:00
parent 79313528cd
commit 727a224aed

View File

@@ -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)