mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
acrn-config: always generate pt_tpm2 boilerplate code in vm_configurations.c
so that vm_configurations.h/vm_configurations.c are consistent for different boards The boilerplate code is protected by #ifdef VM0_PASSTHROUGH_TPM/#endif, so it will not hurt if we always produce related code. Define a new macro VM0_TPM_BUFFER_BASE_ADDR_GPA to define the allocated gpa for VM0_TPM_BUFFER_BASE_ADDR to make the code more flexible. Tracked-On: #5229 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
This commit is contained in:
parent
f438ab5a04
commit
14a3abcce0
@ -391,6 +391,8 @@ def generate_file(config):
|
||||
if vm0_pre_launch and board_cfg_lib.is_tpm_passthru():
|
||||
print("#define VM0_PASSTHROUGH_TPM", file=config)
|
||||
print("#define VM0_TPM_BUFFER_BASE_ADDR 0xFED40000UL", file=config)
|
||||
gpa = common.hpa2gpa(0, 0xFED40000, 0x5000)
|
||||
print("#define VM0_TPM_BUFFER_BASE_ADDR_GPA 0x{:X}UL".format(gpa), file=config)
|
||||
print("#define VM0_TPM_BUFFER_SIZE 0x5000UL", file=config)
|
||||
print("", file=config)
|
||||
|
||||
|
@ -327,11 +327,11 @@ def gen_pre_launch_vm(vm_type, vm_i, scenario_items, config):
|
||||
print("\t\t.pci_dev_num = VM{}_CONFIG_PCI_DEV_NUM,".format(vm_i), file=config)
|
||||
print("\t\t.pci_devs = vm{}_pci_devs,".format(vm_i), file=config)
|
||||
|
||||
if vm_i == 0 and board_cfg_lib.is_tpm_passthru():
|
||||
if vm_i == 0:
|
||||
print("#ifdef VM0_PASSTHROUGH_TPM", file=config)
|
||||
print("\t\t.pt_tpm2 = true,", file=config)
|
||||
print("\t\t.mmiodevs[0] = {", file=config)
|
||||
print("\t\t\t.base_gpa = 0xFED40000UL,", file=config)
|
||||
print("\t\t\t.base_gpa = VM0_TPM_BUFFER_BASE_ADDR_GPA,", file=config)
|
||||
print("\t\t\t.base_hpa = VM0_TPM_BUFFER_BASE_ADDR,", file=config)
|
||||
print("\t\t\t.size = VM0_TPM_BUFFER_SIZE,", file=config)
|
||||
print("\t\t},", file=config)
|
||||
|
Loading…
Reference in New Issue
Block a user