config-tools: add board_info.h.xsl

Add an xslt file "board_info.h.xsl". This file is used to
generate board_info.h which is used by hypervisor.

Tracked-On: #6024
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Yang,Yu-chu 2021-05-11 16:03:32 -07:00 committed by Xie, Nanlin
parent a1a399c360
commit 1b7a2c98f5
1 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 Intel Corporation. -->
<!-- SPDX-License-Identifier: BSD-3-Clause -->
<xsl:stylesheet
version="1.0"
xmlns:xi="http://www.w3.org/2003/XInclude"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:math="http://exslt.org/math"
xmlns:acrn="http://projectacrn.org">
<xsl:include href="lib.xsl" />
<xsl:output method="text" />
<xsl:template match="/acrn-offline-data">
<!-- Declaration of license -->
<xsl:value-of select="$license" />
<!-- Header include guard -->
<xsl:value-of select="acrn:include-guard('BOARD_INFO_H')" />
<xsl:apply-templates select="config-data/acrn-config" />
<xsl:apply-templates select="board-data/acrn-config" />
<xsl:apply-templates select="allocation-data/acrn-config" />
<xsl:value-of select="acrn:include-guard-end('BOARD_INFO_H')" />
</xsl:template>
<xsl:template match="config-data/acrn-config">
<xsl:if test="count(//p2sb[text() = 'y'])">
<xsl:call-template name="p2sb" />
</xsl:if>
<xsl:call-template name="MAX_HIDDEN_PDEVS_NUM" />
</xsl:template>
<xsl:template match="board-data/acrn-config">
<xsl:call-template name="MAX_PCPU_NUM" />
<xsl:call-template name="MAX_VMSIX_ON_MSI_PDEVS_NUM" />
</xsl:template>
<xsl:template match="allocation-data/acrn-config">
<xsl:apply-templates select="hv/MMIO" />
</xsl:template>
<xsl:template name="p2sb">
<xsl:value-of select="acrn:define('P2SB_VGPIO_DM_ENABLED', '', '')" />
<xsl:value-of select="acrn:define('P2SB_BAR_ADDR', '0xFD000000', 'UL')" />
<xsl:value-of select="acrn:define('P2SB_BAR_ADDR_GPA', '0xFD000000', 'UL')" />
<xsl:value-of select="acrn:define('P2SB_BAR_SIZE', '0x1000000', 'UL')" />
<xsl:value-of select="acrn:define('P2SB_BASE_GPIO_PORT_ID', '0x69', 'U')" />
<xsl:value-of select="acrn:define('P2SB_MAX_GPIO_COMMUNITIES', '0x6', 'U')" />
</xsl:template>
<xsl:template name="MAX_HIDDEN_PDEVS_NUM">
<xsl:value-of select="acrn:define('MAX_HIDDEN_PDEVS_NUM', acrn:get-hidden-device-num(), 'U')" />
</xsl:template>
<xsl:template name="MAX_PCPU_NUM">
<xsl:value-of select="acrn:define('MAX_PCPU_NUM', count(//processors/die/core/thread), 'U')" />
</xsl:template>
<xsl:template name="MAX_VMSIX_ON_MSI_PDEVS_NUM">
<xsl:value-of select="acrn:define('MAX_VMSIX_ON_MSI_PDEVS_NUM', sum(dyn:map(//device, 'acrn:is-vmsix-supported-device(./vendor, ./identifier)')), 'U')" />
</xsl:template>
<xsl:template match="MMIO">
<xsl:value-of select="acrn:define('MMIO32_START', //MMIO32_START, 'UL')" />
<xsl:value-of select="acrn:define('MMIO32_END', //MMIO32_END, 'UL')" />
<xsl:value-of select="acrn:define('MMIO64_START', //MMIO64_START, 'UL')" />
<xsl:value-of select="acrn:define('MMIO64_END', //MMIO64_END, 'UL')" />
<xsl:value-of select="acrn:define('HI_MMIO_START', //HI_MMIO_START, 'UL')" />
<xsl:value-of select="acrn:define('HI_MMIO_END', //HI_MMIO_END, 'UL')" />
</xsl:template>
</xsl:stylesheet>