Grzegorz Bernacki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75621?usp=email )
Change subject: mainboard/google: move tpm_tis to AMD common code ......................................................................
mainboard/google: move tpm_tis to AMD common code
It moves tis_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 --- M src/mainboard/google/guybrush/Kconfig M src/mainboard/google/guybrush/variants/baseboard/Makefile.inc D src/mainboard/google/guybrush/variants/baseboard/tpm_tis.c M src/mainboard/google/kahlee/Kconfig M src/mainboard/google/kahlee/variants/baseboard/Makefile.inc D src/mainboard/google/kahlee/variants/baseboard/tpm_tis.c M src/mainboard/google/myst/Kconfig M src/mainboard/google/myst/variants/baseboard/Makefile.inc D src/mainboard/google/myst/variants/baseboard/tpm_tis.c M src/mainboard/google/skyrim/Kconfig M src/mainboard/google/skyrim/variants/baseboard/Makefile.inc D src/mainboard/google/skyrim/variants/baseboard/tpm_tis.c M src/mainboard/google/zork/Kconfig M src/mainboard/google/zork/variants/baseboard/Makefile.inc D src/mainboard/google/zork/variants/baseboard/tpm_tis.c M src/soc/amd/common/block/gpio/Kconfig M src/soc/amd/common/block/gpio/Makefile.inc A src/soc/amd/common/block/gpio/tpm_tis.c 18 files changed, 46 insertions(+), 71 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/75621/1
diff --git a/src/mainboard/google/guybrush/Kconfig b/src/mainboard/google/guybrush/Kconfig index 50bcfa9..f49b042 100644 --- a/src/mainboard/google/guybrush/Kconfig +++ b/src/mainboard/google/guybrush/Kconfig @@ -95,6 +95,11 @@ hex default 0x50
+config TPM_TIS_INTERRUPT + int + default 3 if BOARD_GOOGLE_GUYBRUSH + default 85 + config AMDFW_CONFIG_FILE string default "src/mainboard/google/guybrush/variants/baseboard/amdfw.cfg" diff --git a/src/mainboard/google/guybrush/variants/baseboard/Makefile.inc b/src/mainboard/google/guybrush/variants/baseboard/Makefile.inc index d8fce0a..cfd3faa 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 += 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 2f3e426..0000000 --- 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 <gpio.h> -#include <security/tpm/tis.h> - -int tis_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/kahlee/Kconfig b/src/mainboard/google/kahlee/Kconfig index 8c8486e..f4e869b 100644 --- a/src/mainboard/google/kahlee/Kconfig +++ b/src/mainboard/google/kahlee/Kconfig @@ -116,6 +116,10 @@ hex default 0x50
+config TPM_TIS_INTERRUPT + int + default 9 + config USE_OEM_BIN bool "Add an oem.bin file" help diff --git a/src/mainboard/google/kahlee/variants/baseboard/Makefile.inc b/src/mainboard/google/kahlee/variants/baseboard/Makefile.inc index a41ba22..be4074d 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/Makefile.inc +++ b/src/mainboard/google/kahlee/variants/baseboard/Makefile.inc @@ -3,16 +3,12 @@ bootblock-y += gpio.c bootblock-y += OemCustomize.c
-verstage-y += tpm_tis.c - romstage-y += OemCustomize.c romstage-y += gpio.c romstage-y += memory.c -romstage-y += tpm_tis.c
ramstage-y += gpio.c ramstage-y += mainboard.c -ramstage-y += tpm_tis.c
# Add OEM ID table ifeq ($(CONFIG_USE_OEM_BIN),y) diff --git a/src/mainboard/google/kahlee/variants/baseboard/tpm_tis.c b/src/mainboard/google/kahlee/variants/baseboard/tpm_tis.c deleted file mode 100644 index 2e3cfb8d..0000000 --- a/src/mainboard/google/kahlee/variants/baseboard/tpm_tis.c +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include <gpio.h> -#include <security/tpm/tis.h> -#include <variant/gpio.h> - -int tis_plat_irq_status(void) -{ - return gpio_interrupt_status(GPIO_9); -} diff --git a/src/mainboard/google/myst/Kconfig b/src/mainboard/google/myst/Kconfig index dbce4d8..90c2372 100644 --- a/src/mainboard/google/myst/Kconfig +++ b/src/mainboard/google/myst/Kconfig @@ -42,6 +42,10 @@ hex default 0x50
+config TPM_TIS_INTERRUPT + int + default 84 + config FMDFILE default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/chromeos.fmd"
diff --git a/src/mainboard/google/myst/variants/baseboard/Makefile.inc b/src/mainboard/google/myst/variants/baseboard/Makefile.inc index 3ef89ca..513e05f 100644 --- a/src/mainboard/google/myst/variants/baseboard/Makefile.inc +++ b/src/mainboard/google/myst/variants/baseboard/Makefile.inc @@ -2,11 +2,7 @@
ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += gpio.c -ramstage-y += tpm_tis.c
romstage-y += gpio.c -romstage-y += tpm_tis.c - -verstage-y += tpm_tis.c
smm-y += smihandler.c diff --git a/src/mainboard/google/myst/variants/baseboard/tpm_tis.c b/src/mainboard/google/myst/variants/baseboard/tpm_tis.c deleted file mode 100644 index d03158d..0000000 --- a/src/mainboard/google/myst/variants/baseboard/tpm_tis.c +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include <security/tpm/tis.h> -#include <gpio.h> - -int tis_plat_irq_status(void) -{ - return gpio_interrupt_status(GPIO_84); -} diff --git a/src/mainboard/google/skyrim/Kconfig b/src/mainboard/google/skyrim/Kconfig index 14ef71b..bd3e0dd 100644 --- a/src/mainboard/google/skyrim/Kconfig +++ b/src/mainboard/google/skyrim/Kconfig @@ -60,6 +60,10 @@ hex default 0x50
+config TPM_TIS_INTERRUPT + int + default 18 + config AMDFW_CONFIG_FILE string default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/amdfw.cfg" diff --git a/src/mainboard/google/skyrim/variants/baseboard/Makefile.inc b/src/mainboard/google/skyrim/variants/baseboard/Makefile.inc index bd27f68..7828cf1 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/Makefile.inc +++ b/src/mainboard/google/skyrim/variants/baseboard/Makefile.inc @@ -1,12 +1,9 @@ bootblock-y += gpio.c
romstage-y += gpio.c -romstage-y += tpm_tis.c
ramstage-y += gpio.c -ramstage-y += tpm_tis.c
-verstage-y += tpm_tis.c verstage-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += gpio.c
smm-y += gpio.c diff --git a/src/mainboard/google/skyrim/variants/baseboard/tpm_tis.c b/src/mainboard/google/skyrim/variants/baseboard/tpm_tis.c deleted file mode 100644 index 7e513ef..0000000 --- a/src/mainboard/google/skyrim/variants/baseboard/tpm_tis.c +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include <security/tpm/tis.h> -#include <gpio.h> - -int tis_plat_irq_status(void) -{ - return gpio_interrupt_status(GPIO_18); -} diff --git a/src/mainboard/google/zork/Kconfig b/src/mainboard/google/zork/Kconfig index 68c5ba1..c1a9327 100644 --- a/src/mainboard/google/zork/Kconfig +++ b/src/mainboard/google/zork/Kconfig @@ -134,6 +134,10 @@ hex default 0x50
+config TPM_TIS_INTERRUPT + int + default 3 + config VARIANT_SUPPORTS_PRE_V3_SCHEMATICS bool default y if BOARD_GOOGLE_TREMBYLE diff --git a/src/mainboard/google/zork/variants/baseboard/Makefile.inc b/src/mainboard/google/zork/variants/baseboard/Makefile.inc index 437ba0b..33c708d 100644 --- a/src/mainboard/google/zork/variants/baseboard/Makefile.inc +++ b/src/mainboard/google/zork/variants/baseboard/Makefile.inc @@ -7,19 +7,16 @@ verstage-y += helpers.c verstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_TREMBYLE) += gpio_baseboard_trembyle.c verstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_DALBOZ) += gpio_baseboard_dalboz.c -verstage-y += tpm_tis.c
romstage-y += helpers.c romstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_TREMBYLE) += gpio_baseboard_trembyle.c romstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_DALBOZ) += gpio_baseboard_dalboz.c -romstage-y += tpm_tis.c
ramstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_TREMBYLE) += gpio_baseboard_trembyle.c ramstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_TREMBYLE) += fsps_baseboard_trembyle.c ramstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_DALBOZ) += gpio_baseboard_dalboz.c ramstage-$(CONFIG_BOARD_GOOGLE_BASEBOARD_DALBOZ) += fsps_baseboard_dalboz.c ramstage-y += helpers.c -ramstage-y += tpm_tis.c ramstage-y += ramstage_common.c
smm-$(CONFIG_BOARD_GOOGLE_BASEBOARD_TREMBYLE) += gpio_baseboard_trembyle.c diff --git a/src/mainboard/google/zork/variants/baseboard/tpm_tis.c b/src/mainboard/google/zork/variants/baseboard/tpm_tis.c deleted file mode 100644 index 97eac5d..0000000 --- a/src/mainboard/google/zork/variants/baseboard/tpm_tis.c +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include <gpio.h> -#include <security/tpm/tis.h> -#include <variant/gpio.h> - -int tis_plat_irq_status(void) -{ - return gpio_interrupt_status(GPIO_3); -} diff --git a/src/soc/amd/common/block/gpio/Kconfig b/src/soc/amd/common/block/gpio/Kconfig index 0a1bffe..3ee0d27 100644 --- a/src/soc/amd/common/block/gpio/Kconfig +++ b/src/soc/amd/common/block/gpio/Kconfig @@ -18,3 +18,9 @@ code.
endif # SOC_AMD_COMMON_BLOCK_BANKED_GPIOS + +config TPM_TIS_INTERRUPT + int + help + gpio_interrupt_status() is used to provide interrupt status to TPM layer. + This option specifies the GPIO number. diff --git a/src/soc/amd/common/block/gpio/Makefile.inc b/src/soc/amd/common/block/gpio/Makefile.inc index 64fbe27..3de522e 100644 --- a/src/soc/amd/common/block/gpio/Makefile.inc +++ b/src/soc/amd/common/block/gpio/Makefile.inc @@ -4,4 +4,8 @@ all-y += gpio.c smm-y += gpio.c
+romstage-$(CONFIG_TPM_GOOGLE) += tpm_tis.c +ramstage-$(CONFIG_TPM_GOOGLE) += tpm_tis.c +verstage-$(CONFIG_TPM_GOOGLE) += tpm_tis.c + endif # CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS diff --git a/src/soc/amd/common/block/gpio/tpm_tis.c b/src/soc/amd/common/block/gpio/tpm_tis.c new file mode 100644 index 0000000..9c4384c --- /dev/null +++ b/src/soc/amd/common/block/gpio/tpm_tis.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <boardid.h> +#include <gpio.h> +#include <security/tpm/tis.h> + +int tis_plat_irq_status(void) +{ + gpio_t irq_gpio = CONFIG_TPM_TIS_INTERRUPT; + + if (CONFIG(BOARD_GOOGLE_NIPPERKIN) && board_id() == 1) + irq_gpio = GPIO_3; + + return gpio_interrupt_status(irq_gpio); +}