aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-11-23 10:19:28 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-11-25 11:08:12 +0000
commita7190ef2ec2081a5415d3078360a04f013face9f (patch)
tree9b96fcd04f6bb2a25ff90093ebe90bee3f2f8115
parentbaa72db1b259f28b815662eba94c1ea601d0b718 (diff)
soc/amd/common/block/include/gpio_defs: de-duplicate pin status bit defs
De-duplicate the definitions for the pin status bit and use this new definition in both the C and the ACPI code. TEST=Timeless build results in identical image for amd/mandolin. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I8b0fe7dbec5dac176cdfa9690862433f202fb552 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59595 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
-rw-r--r--src/soc/amd/common/acpi/gpio_bank_lib.asl2
-rw-r--r--src/soc/amd/common/block/include/amdblocks/gpio_defs.h6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/soc/amd/common/acpi/gpio_bank_lib.asl b/src/soc/amd/common/acpi/gpio_bank_lib.asl
index 5a13d8da44..579ff6888a 100644
--- a/src/soc/amd/common/acpi/gpio_bank_lib.asl
+++ b/src/soc/amd/common/acpi/gpio_bank_lib.asl
@@ -159,7 +159,7 @@ Method (GRXS, 1, Serialized)
{
VAL0, 32
}
- Local0 = (GPIO_INPUT_VALUE & VAL0) >> GPIO_INPUT_SHIFT
+ Local0 = (GPIO_PIN_STS & VAL0) >> GPIO_PIN_STS_SHIFT
Return (Local0)
}
diff --git a/src/soc/amd/common/block/include/amdblocks/gpio_defs.h b/src/soc/amd/common/block/include/amdblocks/gpio_defs.h
index ffc90edd50..7345dd1526 100644
--- a/src/soc/amd/common/block/include/amdblocks/gpio_defs.h
+++ b/src/soc/amd/common/block/include/amdblocks/gpio_defs.h
@@ -54,15 +54,13 @@
#define GPIO_WAKE_S3_S4_S5 (GPIO_WAKE_S3 | GPIO_WAKE_S4_S5)
#define GPIO_WAKE_MASK (GPIO_WAKE_S0i3 | GPIO_WAKE_S3 | GPIO_WAKE_S4_S5)
-#define GPIO_PIN_STS (1 << 16)
+#define GPIO_PIN_STS_SHIFT 16
+#define GPIO_PIN_STS (1 << GPIO_PIN_STS_SHIFT)
#define GPIO_PULLUP_ENABLE (1 << 20)
#define GPIO_PULLDOWN_ENABLE (1 << 21)
#define GPIO_PULL_MASK (GPIO_PULLUP_ENABLE | GPIO_PULLDOWN_ENABLE)
-#define GPIO_INPUT_SHIFT 16
-#define GPIO_INPUT_VALUE (1 << GPIO_INPUT_SHIFT)
-
#define GPIO_OUTPUT_SHIFT 22
#define GPIO_OUTPUT_VALUE (1 << GPIO_OUTPUT_SHIFT)
#define GPIO_OUTPUT_ENABLE (1 << 23)