[PATCH 2/3] misc: add element to config Timed GPIO


chenli.wei
 

From: Chenli Wei <chenli.wei@...>

We need passthrough Timed GPIO to post-launched VM, this patch add a
"tgpio_enable" element to enable Timed GPIO passthorugh.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@...>
---
misc/config_tools/schema/config.xsd | 5 +++++
misc/config_tools/xforms/vm_configurations.c.xsl | 13 +++++++++++++
2 files changed, 18 insertions(+)

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index 09c779899..1642b33b7 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -345,6 +345,11 @@ These settings can only be changed at build time.</xs:documentation>
<xs:documentation>Select the VM type. A Standard VM is for general-purpose applications, such as human-machine interface (HMI). A Real-time VM offers special features for time-sensitive applications.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="tgpio_enable" type="Boolean" default="n">
+ <xs:annotation acrn:title="Enable Timed GPIO" acrn:applicable-vms="post-launched" acrn:views="advanced">
+ <xs:documentation>Passthrough Timed GPIO.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="console_vuart" type="ConsoleVuartConfiguration" default="None">
<xs:annotation acrn:title="Console virtual UART type" acrn:views="basic">
<xs:documentation>Select the console virtual UART (vUART) type. Add the console settings to the kernel command line by typing them in the "Linux kernel command-line parameters" text box (for example, ``console=ttyS0`` for COM port 1).</xs:documentation>
diff --git a/misc/config_tools/xforms/vm_configurations.c.xsl b/misc/config_tools/xforms/vm_configurations.c.xsl
index bb2c3e29d..7335c150a 100644
--- a/misc/config_tools/xforms/vm_configurations.c.xsl
+++ b/misc/config_tools/xforms/vm_configurations.c.xsl
@@ -116,6 +116,7 @@
</xsl:if>
<xsl:apply-templates select="os_config" />
<xsl:call-template name="acpi_config" />
+ <xsl:apply-templates select="tgpio_enable" />
<xsl:apply-templates select="console_vuart" />
<xsl:call-template name="vuart_connection" />
<xsl:call-template name="pci_dev_num" />
@@ -288,6 +289,18 @@
<xsl:value-of select="$newline" />
</xsl:template>

+ <xsl:template match="tgpio_enable">
+ <xsl:choose>
+ <xsl:when test="./text() = 'y'">
+ <xsl:value-of select="acrn:initializer('pt_tgpio', 'true')" />
+ </xsl:when>
+ <xsl:when test="./text() = 'n'">
+ <xsl:value-of select="acrn:initializer('pt_tgpio', 'false')" />
+ </xsl:when>
+ </xsl:choose>
+ <xsl:value-of select="$newline" />
+ </xsl:template>
+
<xsl:template name="vuart_connection">
<xsl:variable name="vm_id" select="@id" />
<xsl:variable name="vmname" select="name/text()" />
--
2.25.1