summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2022-02-16 16:15:46 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-02-17 15:44:42 +0000
commit727a224aedfb3d7d01aa5e165f6801b026e1fafa (patch)
treeaa898645dc3ab950ffd8028ee2eb02996146da30 /src/soc
parent79313528cdba81538901721707b3cfee6c3e5220 (diff)
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>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/common/block/gpio/gpio.c2
1 files changed, 1 insertions, 1 deletions
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)