aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hasemeyer <markhas@google.com>2022-11-18 20:25:44 -0700
committerKarthik Ramasubramanian <kramasub@google.com>2022-11-22 17:57:14 +0000
commit7d8f7fb85f3e847fcd5a69afa8cb06a4e185824b (patch)
tree0fa73f1bb09cf024702c7a058dd1c542db0a3d09
parent010ef428b44c245e01742070258983171999fc9e (diff)
mb/google/skyrim: Pass Ti50 IRQ to PSP
It shouldn't be assumed that all variants of skyrim will use the same gpio for TPM interrupts. Use the PSP's new mailbox command to tell it what gpio the tpm interrupt comes in on. BUG=b:248193764 TEST=tast run <ip> hwsec.TPMContest Verify log entry:[DEBUG] PSP: Setting TPM GPIO to 18...OK Use incorrect GPIO in mailbox cmd and verify TPMContest test failed. Signed-off-by: Mark Hasemeyer <markhas@google.com> Change-Id: I9f4005e10987caf9f32e5ac99ff5f2b9467e586c Reviewed-on: https://review.coreboot.org/c/coreboot/+/69874 Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/google/skyrim/mainboard.c11
-rw-r--r--src/mainboard/google/skyrim/variants/baseboard/devicetree.cb2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/mainboard/google/skyrim/mainboard.c b/src/mainboard/google/skyrim/mainboard.c
index 7708488554..d36dfafbfd 100644
--- a/src/mainboard/google/skyrim/mainboard.c
+++ b/src/mainboard/google/skyrim/mainboard.c
@@ -2,9 +2,11 @@
#include <amdblocks/acpimmio.h>
#include <amdblocks/amd_pci_util.h>
+#include <amdblocks/psp.h>
#include <baseboard/variants.h>
#include <console/console.h>
#include <device/device.h>
+#include <drivers/i2c/tpm/chip.h>
#include <soc/acpi.h>
#include <variant/ec.h>
@@ -69,10 +71,19 @@ static void mainboard_configure_gpios(void)
override_gpios, override_num_gpios);
}
+static void configure_psp_tpm_gpio(void)
+{
+ const struct device *ti50_dev = DEV_PTR(ti50);
+ struct drivers_i2c_tpm_config *cfg = config_of(ti50_dev);
+
+ psp_set_tpm_irq_gpio(cfg->irq_gpio.pins[0]);
+}
+
static void mainboard_init(void *chip_info)
{
mainboard_configure_gpios();
mainboard_ec_init();
+ configure_psp_tpm_gpio();
}
static void mainboard_enable(struct device *dev)
diff --git a/src/mainboard/google/skyrim/variants/baseboard/devicetree.cb b/src/mainboard/google/skyrim/variants/baseboard/devicetree.cb
index 81c76b7e0c..8502c36d36 100644
--- a/src/mainboard/google/skyrim/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/skyrim/variants/baseboard/devicetree.cb
@@ -182,7 +182,7 @@ chip soc/amd/mendocino
register "hid" = ""GOOG0005""
register "desc" = ""Ti50 TPM""
register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_LOW(GPIO_18)"
- device i2c 50 on end
+ device i2c 50 alias ti50 on end
end
end