mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-12 12:30:08 +00:00
board_inspector/acpiparser: enable parsing RTCT v2
This patch adds support to parse RTCT v2 using the refined board XML schema. The major changes include: - Add the RTCT v2 parser in the acpiparser module. The version of an RTCT is detected automatically to choose the right parser. - Extract software SRAM capabilities of caches into the board XML. - Move the logic that determines the software SRAM base address for the pre-launched VM to the static allocator of GPAs. - Generate software SRAM related macros into misc_cfg.h when necessary. Tracked-On: #6020 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -14,7 +14,6 @@ import acpi
|
||||
import clos
|
||||
import misc
|
||||
import parser_lib
|
||||
import rtct
|
||||
|
||||
OUTPUT = "./out/"
|
||||
PY_CACHE = "__pycache__"
|
||||
@@ -135,9 +134,6 @@ if __name__ == '__main__':
|
||||
# Generate misc info
|
||||
misc.generate_info(BOARD_INFO)
|
||||
|
||||
# Generate pseudo RAM info
|
||||
rtct.generate_info(BOARD_INFO)
|
||||
|
||||
with open(BOARD_INFO, 'a+') as f:
|
||||
print("</acrn-config>", file=f)
|
||||
|
||||
|
@@ -1,43 +0,0 @@
|
||||
# Copyright (C) 2021 Intel Corporation. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import os
|
||||
from acpiparser import parse_rtct
|
||||
import acpiparser.rtct
|
||||
import parser_lib
|
||||
|
||||
def dump_ssram(config):
|
||||
print("\t<RTCT>", file=config)
|
||||
|
||||
rtct = None
|
||||
if os.path.exists("/sys/firmware/acpi/tables/PTCT"):
|
||||
rtct = parse_rtct(path="/sys/firmware/acpi/tables/PTCT")
|
||||
elif os.path.exists("/sys/firmware/acpi/tables/RTCT"):
|
||||
rtct = parse_rtct(path="/sys/firmware/acpi/tables/RTCT")
|
||||
|
||||
if rtct:
|
||||
for entry in rtct.entries:
|
||||
if entry.type == acpiparser.rtct.ACPI_RTCT_TYPE_SoftwareSRAM:
|
||||
print("\t\t<SoftwareSRAM>", file=config)
|
||||
print("\t\t\t<cache_level>{}</cache_level>".format(entry.cache_level), file=config)
|
||||
print("\t\t\t<base>{}</base>".format(hex(entry.base)), file=config)
|
||||
print("\t\t\t<ways>{}</ways>".format(hex(entry.ways)), file=config)
|
||||
print("\t\t\t<size>{}</size>".format(hex(entry.size)), file=config)
|
||||
for apic_id in entry.apic_id_tbl:
|
||||
print("\t\t\t<apic_id>{}</apic_id>".format(hex(apic_id)), file=config)
|
||||
print("\t\t</SoftwareSRAM>", file=config)
|
||||
else:
|
||||
parser_lib.print_yel("No PTCT or RTCT found. The platform may not support pseudo RAM.")
|
||||
|
||||
print("\t</RTCT>", file=config)
|
||||
print("", file=config)
|
||||
|
||||
|
||||
def generate_info(board_info):
|
||||
"""Get system pseudo RAM information
|
||||
:param board_info: this is the file which stores the hardware board information
|
||||
"""
|
||||
with open(board_info, 'a+') as config:
|
||||
dump_ssram(config)
|
Reference in New Issue
Block a user