summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-09-04 18:02:32 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-09-06 19:51:26 +0000
commitbfd85218a72ef057a7c150358a0f6983639f86dc (patch)
treef425632a83ae0aef0aae952b6930317809c7a302 /src/soc/amd/picasso
parentfeb683d1b9fbf33fc22c9263b4d7ad935f90aeaf (diff)
soc/amd: correctly report I2C controller state in ACPI
Instead of reporting all I2C controllers in the system as enabled in the corresponding ACPI device's _STA method, report the I2C devices that are disabled in the devicetree as disabled in the corresponding _STA method too. This is done by returning the contents of the STAT variable inside each device's scope in the DSDT that have a default value of 0 (device not present/disabled). For all enabled and hidden I2C devices i2c_acpi_fill_ssdt gets called which then writes 0xf (device enabled and visible) or 0xb (device enabled, but hidden) to the STAT name inside the same scope, but in the SSDT. This object in the SSDT will then override the default in the DSDT resulting in the _STA method returning the correct status of each device. The code was inspired by commit 7cf9c7451808 ("soc/amd/*: Fix UART ACPI device status"). TEST=On Mandolin all I2C controllers are disabled and with this patch none shows up in the Windows 10 device manager. When enabling an I2C controller in the devicetree for testing, it shows up again in the Windows device manager. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I4cd9f447ded3a7f0b092218410c89767ec517417 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77643 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'src/soc/amd/picasso')
-rw-r--r--src/soc/amd/picasso/acpi/mmio.asl13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/soc/amd/picasso/acpi/mmio.asl b/src/soc/amd/picasso/acpi/mmio.asl
index 86733c1a6f..f8f9d35489 100644
--- a/src/soc/amd/picasso/acpi/mmio.asl
+++ b/src/soc/amd/picasso/acpi/mmio.asl
@@ -279,9 +279,10 @@ Device (I2C0) {
}
}
+ Name (STAT, 0x0)
Method (_STA, 0x0, NotSerialized)
{
- Return (0x0F)
+ Return (STAT)
}
AOAC_DEVICE(5, 0)
@@ -315,9 +316,10 @@ Device (I2C1) {
}
}
+ Name (STAT, 0x0)
Method (_STA, 0x0, NotSerialized)
{
- Return (0x0F)
+ Return (STAT)
}
AOAC_DEVICE(6, 0)
@@ -352,9 +354,10 @@ Device (I2C2) {
}
}
+ Name (STAT, 0x0)
Method (_STA, 0x0, NotSerialized)
{
- Return (0x0F)
+ Return (STAT)
}
AOAC_DEVICE(FCH_AOAC_DEV_I2C2, 0)
@@ -388,9 +391,11 @@ Device (I2C3)
Return (Local0)
}
}
+
+ Name (STAT, 0x0)
Method (_STA, 0x0, NotSerialized)
{
- Return (0x0F)
+ Return (STAT)
}
AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0)