summaryrefslogtreecommitdiffstats
path: root/xml
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-08 02:15:51 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-08 02:15:51 +0100
commiteec7e74d2eccf811f0d25bb40fa514dc47655d67 (patch)
tree1b2c199cb356da7fd299d5b53a632cf9a535ca3e /xml
parent92b9df25f5bbb2f70ee2626907e410affc02bdeb (diff)
downloadpcitool-eec7e74d2eccf811f0d25bb40fa514dc47655d67.tar.gz
pcitool-eec7e74d2eccf811f0d25bb40fa514dc47655d67.tar.bz2
pcitool-eec7e74d2eccf811f0d25bb40fa514dc47655d67.tar.xz
pcitool-eec7e74d2eccf811f0d25bb40fa514dc47655d67.zip
Support XML configuration of device models
Diffstat (limited to 'xml')
-rw-r--r--xml/CMakeLists.txt5
-rw-r--r--xml/devices.xsd24
-rw-r--r--xml/devices/testdevice.xml4
-rw-r--r--xml/test/camera.xml2
-rw-r--r--xml/test/dma.xml2
5 files changed, 35 insertions, 2 deletions
diff --git a/xml/CMakeLists.txt b/xml/CMakeLists.txt
index a7ac800..8848c79 100644
--- a/xml/CMakeLists.txt
+++ b/xml/CMakeLists.txt
@@ -1,3 +1,8 @@
+
+install(FILES devices.xsd
+ DESTINATION ${PCILIB_DATA_DIR}
+)
+
install(FILES model.xsd references.xsd types.xsd
DESTINATION ${PCILIB_MODEL_DIR}
)
diff --git a/xml/devices.xsd b/xml/devices.xsd
new file mode 100644
index 0000000..27e9b39
--- /dev/null
+++ b/xml/devices.xsd
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:include schemaLocation="types.xsd"/>
+
+ <xsd:simpleType name="hex16_t">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="([a-fA-F0-9]){1,4}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="device_t">
+ <xsd:attribute name="vendor" type="hex16_t" />
+ <xsd:attribute name="device" type="hex16_t" />
+ <xsd:attribute name="model" type="xsd:string" />
+ </xsd:complexType>
+
+ <xsd:element name="devices">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="device" type="device_t" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+</xsd:schema>
diff --git a/xml/devices/testdevice.xml b/xml/devices/testdevice.xml
new file mode 100644
index 0000000..d7f7d11
--- /dev/null
+++ b/xml/devices/testdevice.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<devices xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <device vendor="0000" device="0" model="test"/>
+</devices>
diff --git a/xml/test/camera.xml b/xml/test/camera.xml
index 6568f17..882963c 100644
--- a/xml/test/camera.xml
+++ b/xml/test/camera.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <bank bar="0" size="0x0200" protocol="software_registers" read_address="0x9000" write_address="0x9000" word_size="32" endianess="little" format="0x%lx" name="fpga" description="IPECamera Registers">
+ <bank size="0x0200" protocol="software_registers" read_address="0x9000" write_address="0x9000" word_size="32" endianess="little" format="0x%lx" name="fpga" description="IPECamera Registers">
<register address="0x00" offset="0" size="32" default="0" rwmask="0" mode="RW" name="spi_conf_input"/>
<register address="0x10" offset="0" size="32" default="0" rwmask="0" mode="R" name="spi_conf_output"/>
<register address="0x20" offset="0" size="32" default="0" rwmask="0" mode="RW" name="spi_clk_speed"/>
diff --git a/xml/test/dma.xml b/xml/test/dma.xml
index 1d20725..582a7a3 100644
--- a/xml/test/dma.xml
+++ b/xml/test/dma.xml
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <bank bar="0" size="0x0200" protocol="software_registers" read_address="0x0" write_address="0x0" word_size="32" endianess="little" format="0x%lx" name="dma" description="DMA Registers"/>
+ <bank size="0x0200" protocol="software_registers" read_address="0x0" write_address="0x0" word_size="32" endianess="little" format="0x%lx" name="dma" description="DMA Registers"/>
</model>