summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorJan Dabros <jsd@semihalf.com>2022-02-04 10:40:37 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-02-17 23:14:02 +0000
commit282d715133ace7cf6bbf16e1ecb918c339340223 (patch)
tree13064f37b1c694d172bc83e9b95847d48c5f9c45 /src/soc/amd
parentc17330c1dddbf8deb512d8d1eb13264b2936b77c (diff)
soc/amd/common/block/i2c: Add support for shared TPM_I2C controller
There are platforms equipped with AMD SoC where I2C3 controller connected to TPM device is shared between X86 and PSP. In order to handle this, PSP acts as an I2C-arbitrator, where x86 (kernel) sends acquire and release requests to be accepted by PSP. An example of implementation within Linux kernel is available [1]. There is a need to introduce new ACPI_ID ("AMDI0019") so that dedicated driver on OS side can bind to it and handle this special setup. Since PSP takes care of I2C controller power management, we need to remove PowerResource object from DSDT. BUG=b:204508404 BRANCH=guybrush [1]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=78d5e9e299e31bc2deaaa94a45bf8ea024f27e8c Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Iccfc09d8c580d7ab2acb69d26b9c293cf625fb34 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61863 Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/cezanne/acpi/mmio.asl7
-rw-r--r--src/soc/amd/common/block/i2c/Kconfig10
2 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/amd/cezanne/acpi/mmio.asl b/src/soc/amd/cezanne/acpi/mmio.asl
index 9e587b75f1..fa43db00b7 100644
--- a/src/soc/amd/cezanne/acpi/mmio.asl
+++ b/src/soc/amd/cezanne/acpi/mmio.asl
@@ -232,7 +232,11 @@ Device (I2C2) {
Device (I2C3)
{
+#if CONFIG(SOC_AMD_COMMON_BLOCK_I2C3_TPM_SHARED_WITH_PSP)
+ Name (_HID, "AMDI0019")
+#else
Name (_HID, "AMDI0010")
+#endif
Name (_UID, 0x3)
Method (_CRS, 0) {
Local0 = ResourceTemplate() {
@@ -263,7 +267,10 @@ Device (I2C3)
Return (0x0F)
}
+/* If this device is shared with PSP, then PSP takes care of power management */
+#if !CONFIG(SOC_AMD_COMMON_BLOCK_I2C3_TPM_SHARED_WITH_PSP)
AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0)
+#endif
}
Device (MISC)
diff --git a/src/soc/amd/common/block/i2c/Kconfig b/src/soc/amd/common/block/i2c/Kconfig
index f10c14ab1f..8e8ff9b148 100644
--- a/src/soc/amd/common/block/i2c/Kconfig
+++ b/src/soc/amd/common/block/i2c/Kconfig
@@ -14,3 +14,13 @@ config SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
help
Select this option to add FCH I2C/I3C pad configuration functions to
the build.
+
+config SOC_AMD_COMMON_BLOCK_I2C3_TPM_SHARED_WITH_PSP
+ bool
+ depends on !SOC_AMD_PICASSO && !SOC_AMD_STONEYRIDGE
+ default n
+ help
+ Enable PSP I2C arbitration if there is I2C3 controller with TPM device
+ connected, which is shared between x86 and PSP. This is necessary to
+ ensure proper communication with I2C peripherals connected to such
+ bus.