hv: remove the hardcoding of Software SRAM GPA base

Currently, we hardcode the GPA base of Software SRAM
 to an address that is derived from TGL platform,
 as this GPA is identical with HPA for Pre-launch VM,
 This hardcoded address may not work on other platforms
 if the HPA bases of Software SRAM are different.

 Now, Offline tool configures above GPA based on the
 detection of Software SRAM on specific platform.

 This patch removes the hardcoding GPA of Software SRAM,
 and also renames MACRO 'SOFTWARE_SRAM_BASE_GPA' to
 'PRE_RTVM_SW_SRAM_BASE_GPA' to avoid confusing, as it
 is for Prelaunch VM only.

Tracked-On: #5649
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yonghua Huang
2021-01-28 17:57:00 +08:00
committed by wenlingz
parent f7772a98ee
commit 8bec63a6ea
3 changed files with 29 additions and 18 deletions

View File

@@ -9,6 +9,7 @@
#include <acpi.h>
#include "misc_cfg.h"
#define RTCT_ENTRY_TYPE_RTCD_LIMIT 1U
#define RTCT_ENTRY_TYPE_RTCM_BINARY 2U
@@ -20,8 +21,19 @@
#define RTCT_ENTRY_TYPE_RT_IOMMU 8U
#define RTCT_ENTRY_TYPE_MEM_HIERARCHY_LATENCY 9U
#define SOFTWARE_SRAM_BASE_GPA 0x40080000U
#define SOFTWARE_SRAM_MAX_SIZE 0x00800000U
#if !defined(PRE_RTVM_SW_SRAM_BASE_GPA)
/*
* PRE_RTVM_SW_SRAM_BASE_GPA is for Prelaunch VM only and
* is configured by config tool on platform that Software SRAM is detected.
*
* For cases that Software SRAM is not detected, we still hardcode a dummy
* placeholder entry in vE820 table of Prelaunch VM to unify the logic
* to initialize the vE820.
*/
#define PRE_RTVM_SW_SRAM_BASE_GPA 0x40080000U
#endif
#define PRE_RTVM_SW_SRAM_MAX_SIZE 0x00800000U
struct rtct_entry {
uint16_t size;