config-tools: remove acrn:is-tpm-passthrough-board

Simplify the statement by TPM2 enablement detection and present TPM2 device.
Remove the function and move the statement to misc_cfg.h.xsl

Tracked-On: #6562
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
Yang,Yu-chu 2021-09-13 15:55:00 -07:00 committed by wenlingz
parent bd28e548d0
commit 3cf525725c
2 changed files with 9 additions and 34 deletions

View File

@ -481,29 +481,6 @@
</xsl:choose>
</func:function>
<func:function name="acrn:is-tpm-passthrough-board">
<xsl:choose>
<xsl:when test="//@board = 'whl-ipc-i5'">
<func:result select="true()" />
</xsl:when>
<xsl:when test="//@board = 'whl-ipc-i7'">
<func:result select="true()" />
</xsl:when>
<xsl:when test="//@board = 'tgl-rvp'">
<func:result select="true()" />
</xsl:when>
<xsl:when test="//@board = 'ehl-crb-b'">
<func:result select="true()" />
</xsl:when>
<xsl:when test="//@board = 'cfl-k700-i7'">
<func:result select="true()" />
</xsl:when>
<xsl:otherwise>
<func:result select="false()" />
</xsl:otherwise>
</xsl:choose>
</func:function>
<!-- acrn:is-vmsix-supported-device checks the given params are matched with any of the listed devices -->
<!-- The listed devices are known that can have a virtual vmsix -->
<!-- Each pair of vendor and identifier represents a device which can have a vmsix (virtual msix) -->

View File

@ -202,17 +202,15 @@
<xsl:template name="vm0_passthrough_tpm">
<xsl:if test="acrn:is-pre-launched-vm(vm[@id = 0]/vm_type)">
<xsl:if test="acrn:is-tpm-passthrough-board()">
<xsl:if test="vm[@id = 0]/mmio_resources/TPM2 = 'y'">
<xsl:value-of select="acrn:define('VM0_PASSTHROUGH_TPM', '', '')" />
<xsl:value-of select="acrn:define('VM0_TPM_BUFFER_BASE_ADDR', '0xFED40000', 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_BUFFER_BASE_ADDR_GPA', '0xFED40000', 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_BUFFER_SIZE', '0x5000', 'UL')" />
<xsl:if test="//capability[@id='log_area']">
<xsl:value-of select="acrn:define('VM0_TPM_EVENTLOG_BASE_ADDR', //allocation-data/acrn-config/vm[@id = '0']/log_area_start_address, 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_EVENTLOG_BASE_ADDR_HPA', //capability[@id='log_area']/log_area_start_address, 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_EVENTLOG_SIZE', //allocation-data/acrn-config/vm[@id = '0']/log_area_minimum_length, 'UL')" />
</xsl:if>
<xsl:if test="//vm/mmio_resources/TPM2/text() = 'y' and //device[@id = 'MSFT0101' or compatible_id = 'MSFT0101']">
<xsl:value-of select="acrn:define('VM0_PASSTHROUGH_TPM', '', '')" />
<xsl:value-of select="acrn:define('VM0_TPM_BUFFER_BASE_ADDR', '0xFED40000', 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_BUFFER_BASE_ADDR_GPA', '0xFED40000', 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_BUFFER_SIZE', '0x5000', 'UL')" />
<xsl:if test="//capability[@id='log_area']">
<xsl:value-of select="acrn:define('VM0_TPM_EVENTLOG_BASE_ADDR', //allocation-data/acrn-config/vm[@id = '0']/log_area_start_address, 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_EVENTLOG_BASE_ADDR_HPA', //capability[@id='log_area']/log_area_start_address, 'UL')" />
<xsl:value-of select="acrn:define('VM0_TPM_EVENTLOG_SIZE', //allocation-data/acrn-config/vm[@id = '0']/log_area_minimum_length, 'UL')" />
</xsl:if>
</xsl:if>
</xsl:if>