summaryrefslogtreecommitdiff
path: root/src/mainboard/google/guybrush/variants
diff options
context:
space:
mode:
authorGrzegorz Bernacki <bernacki@google.com>2023-05-29 11:53:38 +0000
committerMartin L Roth <gaumless@gmail.com>2023-07-14 15:13:33 +0000
commita0bd3e9a972908c428677b2c1541d16ddf9e77a0 (patch)
tree107327f049fc4c59150c041a4ae21cb959d2730b /src/mainboard/google/guybrush/variants
parent64335176d1445e89a9662a32222116ab19923daa (diff)
mb/google: AMD: move tpm_tis to AMD common code
It moves cr50_plat_irq_status() to common code and adds Kconfig option to specify GPIO used for interrupt. BUG=b:277787305 TEST=Build all affected platform and confirm using right GPIO number. Tested on Skyrim. Change-Id: I775c4e24cffee99b6ac3e05b58a75425029a86c8 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/75621 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'src/mainboard/google/guybrush/variants')
-rw-r--r--src/mainboard/google/guybrush/variants/baseboard/Makefile.inc3
-rw-r--r--src/mainboard/google/guybrush/variants/baseboard/tpm_tis.c16
-rw-r--r--src/mainboard/google/guybrush/variants/nipperkin/Makefile.inc4
-rw-r--r--src/mainboard/google/guybrush/variants/nipperkin/tpm_tis.c13
4 files changed, 17 insertions, 19 deletions
diff --git a/src/mainboard/google/guybrush/variants/baseboard/Makefile.inc b/src/mainboard/google/guybrush/variants/baseboard/Makefile.inc
index d8fce0a6eb..cfd3faa6a6 100644
--- a/src/mainboard/google/guybrush/variants/baseboard/Makefile.inc
+++ b/src/mainboard/google/guybrush/variants/baseboard/Makefile.inc
@@ -2,14 +2,11 @@ bootblock-y += gpio.c
bootblock-y += helpers.c
romstage-y += helpers.c
-romstage-y += tpm_tis.c
romstage-y += gpio.c
ramstage-y += gpio.c
ramstage-y += helpers.c
-ramstage-y += tpm_tis.c
verstage-y += gpio.c
-verstage-y += tpm_tis.c
smm-y += gpio.c
diff --git a/src/mainboard/google/guybrush/variants/baseboard/tpm_tis.c b/src/mainboard/google/guybrush/variants/baseboard/tpm_tis.c
deleted file mode 100644
index bc4091527f..0000000000
--- a/src/mainboard/google/guybrush/variants/baseboard/tpm_tis.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-
-#include <boardid.h>
-#include <drivers/tpm/cr50.h>
-#include <gpio.h>
-
-int cr50_plat_irq_status(void)
-{
- gpio_t irq_gpio = GPIO_85;
- uint32_t board_ver = board_id();
-
- if (CONFIG(BOARD_GOOGLE_GUYBRUSH) || (CONFIG(BOARD_GOOGLE_NIPPERKIN) && board_ver == 1))
- irq_gpio = GPIO_3;
-
- return gpio_interrupt_status(irq_gpio);
-}
diff --git a/src/mainboard/google/guybrush/variants/nipperkin/Makefile.inc b/src/mainboard/google/guybrush/variants/nipperkin/Makefile.inc
index d7ec6dd5a2..14ecf5ecbb 100644
--- a/src/mainboard/google/guybrush/variants/nipperkin/Makefile.inc
+++ b/src/mainboard/google/guybrush/variants/nipperkin/Makefile.inc
@@ -5,6 +5,10 @@ romstage-y += gpio.c
ramstage-y += gpio.c
verstage-y += gpio.c
+romstage-y += tpm_tis.c
+ramstage-y += tpm_tis.c
+verstage-y += tpm_tis.c
+
bootblock-y += variant.c
romstage-y += variant.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/guybrush/variants/nipperkin/tpm_tis.c b/src/mainboard/google/guybrush/variants/nipperkin/tpm_tis.c
new file mode 100644
index 0000000000..010499f087
--- /dev/null
+++ b/src/mainboard/google/guybrush/variants/nipperkin/tpm_tis.c
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <boardid.h>
+#include <gpio.h>
+#include <drivers/tpm/cr50.h>
+
+gpio_t cr50_override_gpio(gpio_t irq)
+{
+ if (board_id() == 1)
+ return GPIO_3;
+ else
+ return irq;
+}