drivers/intel/ptt: Use the correct detection method
On some platforms the HFSTS4 bit 19 does not indicate active PTT. Instead of ME HFSTS4, use TXT FTIF register to check active TPM for the current boot. Discrete TPM shall be deactivated when PTT is enabled so this always should return true value of PTT state. Leave the old method for backwards compatibility if TXT FTIF would not be applicable for older microarchitectures. Based on DOC #560297. TEST=Check if PTT is detected as active on MSI PRO Z690-A DDR4 WIFI Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: I3a55c9f38f5bb94fb1186592446a28e675c1207c Reviewed-on: https://review.coreboot.org/c/coreboot/+/63956 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
This commit is contained in:
committed by
Felix Held
parent
042ba16ef8
commit
ff7725e742
@@ -1,8 +1,11 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <arch/mmio.h>
|
||||
#include <soc/pci_devs.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include <console/console.h>
|
||||
#include <security/intel/txt/txt_register.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ptt.h"
|
||||
|
||||
@@ -27,6 +30,7 @@ static uint32_t read_register(int reg_addr)
|
||||
*/
|
||||
bool ptt_active(void)
|
||||
{
|
||||
uint32_t sts_ftif;
|
||||
uint32_t fwsts4 = read_register(PCI_ME_HFSTS4);
|
||||
|
||||
if (fwsts4 == 0xFFFFFFFF)
|
||||
@@ -34,6 +38,14 @@ bool ptt_active(void)
|
||||
|
||||
if ((fwsts4 & PTT_ENABLE) == 0) {
|
||||
printk(BIOS_DEBUG, "Intel ME Establishment bit not valid.\n");
|
||||
sts_ftif = read32p(TXT_STS_FTIF);
|
||||
|
||||
if (sts_ftif != 0 && sts_ftif != UINT32_MAX) {
|
||||
if ((sts_ftif & TXT_PTT_PRESENT) == TXT_PTT_PRESENT) {
|
||||
printk(BIOS_DEBUG, "TXT_STS_FTIF: PTT present and active\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user