diff --git a/misc/acrn-config/config_app/templates/scenario.html b/misc/acrn-config/config_app/templates/scenario.html index 1164dcc5a..1dc0af764 100644 --- a/misc/acrn-config/config_app/templates/scenario.html +++ b/misc/acrn-config/config_app/templates/scenario.html @@ -213,7 +213,7 @@ the source files will be generated into default path and overwirte the previous {% for sub_elem in elem.getchildren() %} {% set sub_elem_text = sub_elem.text if sub_elem.text != None else '' %} - {% if sub_elem.tag in ['RDT', 'IVSHMEM'] %} + {% if sub_elem.tag in ['RDT', 'IVSHMEM', 'PSRAM'] %} {% for sub_elem_2 in sub_elem.getchildren() %} {% set sub_elem_2_text = sub_elem_2.text if sub_elem_2.text != None else '' %} {% if ','.join([vm.tag, elem.tag, sub_elem.tag, sub_elem_2.tag]) in scenario_item_values %} diff --git a/misc/acrn-config/hv_config/board_defconfig.py b/misc/acrn-config/hv_config/board_defconfig.py index e23ec1de2..6c628c88b 100644 --- a/misc/acrn-config/hv_config/board_defconfig.py +++ b/misc/acrn-config/hv_config/board_defconfig.py @@ -177,6 +177,10 @@ def get_features(hv_info, config): print("CONFIG_ACPI_PARSE_ENABLED={}".format(hv_info.features.acpi_parse_enabled), file=config) print("CONFIG_L1D_FLUSH_VMENTRY_ENABLED={}".format(hv_info.features.l1d_flush_vmentry_enabled), file=config) print("CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED={}".format(hv_info.features.mce_on_psc_workaround_disabled), file=config) + if hv_info.features.psram_enabled in ['y', 'n']: + print("CONFIG_PSRAM_ENABLED={}".format(hv_info.features.psram_enabled), file=config) + if hv_info.features.psram_enabled in ['y', 'n']: + print("CONFIG_PSRAM_PRE_RTVM_ENABLED={}".format(hv_info.features.psram_passthrough_pre_rtvm), file=config) def get_capacities(hv_info, config): diff --git a/misc/acrn-config/hv_config/hv_item.py b/misc/acrn-config/hv_config/hv_item.py index bb8bc43b3..d9452f81d 100644 --- a/misc/acrn-config/hv_config/hv_item.py +++ b/misc/acrn-config/hv_config/hv_item.py @@ -109,6 +109,8 @@ class Features: self.acpi_parse_enabled = '' self.l1d_flush_vmentry_enabled = '' self.mce_on_psc_workaround_disabled = '' + self.psram_enabled = '' + self.psram_passthrough_pre_rtvm = '' def get_info(self): self.multiboot2 = common.get_hv_item_tag(self.hv_file, "FEATURES", "MULTIBOOT2") @@ -123,6 +125,8 @@ class Features: self.l1d_flush_vmentry_enabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "L1D_VMENTRY_ENABLED") self.mce_on_psc_workaround_disabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "MCE_ON_PSC_DISABLED") self.iommu_enforce_snp = common.get_hv_item_tag(self.hv_file, "FEATURES", "IOMMU_ENFORCE_SNP") + self.psram_enabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "PSRAM", "PSRAM_ENABLED") + self.psram_passthrough_pre_rtvm = common.get_hv_item_tag(self.hv_file, "FEATURES", "PSRAM", "PSRAM_PASSTHROUGH_PRE_RTVM") def check_item(self): hv_cfg_lib.ny_support_check(self.multiboot2, "FEATURES", "MULTIBOOT2") @@ -137,6 +141,12 @@ class Features: hv_cfg_lib.ny_support_check(self.l1d_flush_vmentry_enabled, "FEATURES", "L1D_VMENTRY_ENABLED") hv_cfg_lib.ny_support_check(self.mce_on_psc_workaround_disabled, "FEATURES", "MCE_ON_PSC_DISABLED") hv_cfg_lib.ny_support_check(self.iommu_enforce_snp, "FEATURES", "IOMMU_ENFORCE_SNP") + # hv_cfg_lib.ny_support_check(self.psram_enabled, "FEATURES", "PSRAM", "PSRAM_ENABLED") + # hv_cfg_lib.ny_support_check(self.psram_passthrough_pre_rtvm, + # "FEATURES", "PSRAM", "PSRAM_PASSTHROUGH_PRE_RTVM") + hv_cfg_lib.hv_psram_check(self.psram_enabled, self.cdp_enabled, "FEATURES", "PSRAM", "PSRAM_ENABLED") + hv_cfg_lib.hv_psram_passthrough_pre_rtvm_check(self.psram_passthrough_pre_rtvm, self.psram_enabled, + "FEATURES", "PSRAM", "PSRAM_PASSTHROUGH_PRE_RTVM") class Memory: diff --git a/misc/acrn-config/library/hv_cfg_lib.py b/misc/acrn-config/library/hv_cfg_lib.py index 1b20c9fb4..0c031c710 100644 --- a/misc/acrn-config/library/hv_cfg_lib.py +++ b/misc/acrn-config/library/hv_cfg_lib.py @@ -231,3 +231,17 @@ def max_msix_table_num_check(max_msix_table_num, cap_str, max_msi_num_str): if native_max_msix_line: native_max_msix_num = native_max_msix_line[0].strip() range_check(native_max_msix_num, "In board xml", max_msi_num_str, RANGE_DB['MSIX_TABLE_NUM']) + + +def hv_psram_check(psram_enabled, cpd_enabled, feature, tag, leaf): + key = 'hv,{},{},{}'.format(feature, tag, leaf) + if psram_enabled == 'y' and cpd_enabled == 'y': + ERR_LIST[key] = "PSRAM_ENABLED should not be y when CDP_ENABLED is y." + return + + +def hv_psram_passthrough_pre_rtvm_check(psram_passthrough_pre_rtvm, psram_enabled, feature, tag, leaf): + key = 'hv,{},{},{}'.format(feature, tag, leaf) + if psram_enabled == 'n' and psram_passthrough_pre_rtvm == 'y': + ERR_LIST[key] = "{} should not be y when {} is n.".format(leaf, tag) + return diff --git a/misc/acrn-config/scenario_config/scenario_cfg_gen.py b/misc/acrn-config/scenario_config/scenario_cfg_gen.py index 7b416916e..955e7fd0f 100755 --- a/misc/acrn-config/scenario_config/scenario_cfg_gen.py +++ b/misc/acrn-config/scenario_config/scenario_cfg_gen.py @@ -84,6 +84,8 @@ def get_scenario_item_values(board_info, scenario_info): scenario_item_values["hv,FEATURES,MCE_ON_PSC_DISABLED"] = hv_cfg_lib.N_Y scenario_item_values["hv,FEATURES,IOMMU_ENFORCE_SNP"] = hv_cfg_lib.N_Y scenario_item_values["hv,FEATURES,IVSHMEM,IVSHMEM_ENABLED"] = hv_cfg_lib.N_Y + scenario_item_values["hv,FEATURES,PSRAM,PSRAM_ENABLED"] = hv_cfg_lib.N_Y + scenario_item_values["hv,FEATURES,PSRAM,PSRAM_PASSTHROUGH_PRE_RTVM"] = hv_cfg_lib.N_Y scenario_cfg_lib.ERR_LIST.update(hv_cfg_lib.ERR_LIST) return scenario_item_values