hv: update RTCT ACPI table detecting

Signature of RTCT ACPI table maybe "PTCT"(v1) or "RTCT"(v2).
 and the MAGIC number in CRL header is also changed from "PTCM"
 to "RTCM".

 This patch refine the code to detect RTCT table for both
 v1 and v2.

Tracked-On: #6020
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang 2021-05-27 13:36:26 +08:00 committed by wenlingz
parent c1100a63d5
commit 1ba5b64b07
4 changed files with 8 additions and 1 deletions

View File

@ -170,6 +170,10 @@ int32_t acpi_fixup(void)
}
rtct_tbl_addr = (uint8_t *)get_acpi_tbl(ACPI_SIG_RTCT);
if (rtct_tbl_addr == NULL) {
rtct_tbl_addr = (uint8_t *)get_acpi_tbl(ACPI_SIG_RTCT_V2);
}
if (rtct_tbl_addr != NULL) {
set_rtct_tbl((void *)rtct_tbl_addr);
}

View File

@ -149,7 +149,8 @@ bool init_software_sram(bool is_bsp)
header = hpa2hva(rtcm_binary->address);
pr_info("rtcm_bin_address:%llx, rtcm magic:%x, rtcm version:%x",
rtcm_binary->address, header->magic, header->version);
ASSERT(header->magic == RTCM_MAGIC, "Incorrect RTCM magic!");
ASSERT(((header->magic == RTCM_MAGIC) || (header->magic == RTCM_MAGIC_V2)),
"Wrong RTCM magic!");
/* Flush the TLB, so that BSP/AP can execute the RTCM ABI */
flush_tlb_range((uint64_t)hpa2hva(rtcm_binary->address), rtcm_binary->size);

View File

@ -58,6 +58,7 @@
#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module hardware interface table */
#define ACPI_SIG_RTCT "PTCT" /* Platform Tuning Configuration Table (Real-Time Configuration Table) */
#define ACPI_SIG_RTCT_V2 "RTCT" /* Platform Tuning Configuration Table (Real-Time Configuration Table) V2 */
struct packed_gas {
uint8_t space_id;

View File

@ -19,6 +19,7 @@ typedef int32_t MSABI(*rtcm_abi_func)(uint32_t command, void *command_struct);
#define RTCM_CMD_WRMSR (int32_t)4U
#define RTCM_MAGIC 0x5054434dU
#define RTCM_MAGIC_V2 0x5254434dU
struct rtcm_header {
uint32_t magic;