hv: pSRAM: add PTCT parsing code

The added parse_ptct function will parse native ACPI PTCT table to
acquire information like pSRAM location/size/level and PTCM location,
and save them.

Tracked-On: #5330
Signed-off-by: Qian Wang <qian1.wang@intel.com>
This commit is contained in:
Li Fei1
2020-10-28 14:01:05 +08:00
committed by wenlingz
parent 80121b8347
commit 5fa816f921
5 changed files with 92 additions and 2 deletions

View File

@@ -28,4 +28,5 @@ struct ptcm_header {
extern volatile bool is_psram_initialized;
void init_psram(bool is_bsp);
void set_ptct_tbl(void *ptct_tbl_addr);
#endif /* PTCM_H */

View File

@@ -10,11 +10,44 @@
#include <acpi.h>
#define PTCT_ENTRY_TYPE_PTCD_LIMIT 1U
#define PTCT_ENTRY_TYPE_PTCM_BINARY 2U
#define PTCT_ENTRY_TYPE_WRC_L3_MASKS 3U
#define PTCT_ENTRY_TYPE_GT_L3_MASKS 4U
#define PTCT_ENTRY_TYPE_PSRAM 5U
#define PTCT_ENTRY_TYPE_STREAM_DATAPATH 6U
#define PTCT_ENTRY_TYPE_TIMEAWARE_SUBSYS 7U
#define PTCT_ENTRY_TYPE_RT_IOMMU 8U
#define PTCT_ENTRY_TYPE_MEM_HIERARCHY_LATENCY 9U
#define PSRAM_BASE_HPA 0x40080000U
#define PSRAM_BASE_GPA 0x40080000U
#define PSRAM_MAX_SIZE 0x00800000U
struct ptct_entry{
uint16_t size;
uint16_t format;
uint32_t type;
uint32_t data[64];
} __packed;
struct ptct_entry_data_ptcm_binary
{
uint64_t address;
uint32_t size;
} __packed;
struct ptct_entry_data_psram
{
uint32_t cache_level;
uint64_t base;
uint32_t ways;
uint32_t size;
uint32_t apic_id_0; /*only the first core is responsible for initialization of L3 mem region*/
} __packed;
extern uint64_t psram_area_bottom;
extern uint64_t psram_area_top;
#endif /* PTCT_H */