[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC for-4.8 v2 6/7] xen/device-tree: Add an mmio-sram bus



From: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxxx>

Add an mmio-sram bus that prevents sram sub areas from
being re-mapped. These sub-areas describe allocations and
not mappings.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx>
---
 xen/common/device_tree.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index fbee354..698d4da 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -616,10 +616,47 @@ static int dt_bus_pci_translate(__be32 *addr, u64 offset, 
int na)
 }
 
 /*
+ * MMIO-SRAM bus specific translator
+ */
+
+static bool_t dt_bus_mmio_sram_match(const struct dt_device_node *np)
+{
+    static const struct dt_device_match match[] __initconst =
+    {
+        DT_MATCH_COMPATIBLE("mmio-sram"),
+        { /* sentinel */ },
+    };
+
+    return dt_match_node(match, np) != NULL;
+}
+
+static void dt_bus_mmio_sram_count_cells(const struct dt_device_node *np,
+                                        int *addrc, int *sizec)
+{
+    /*
+     * Child areas describe allocations, not mappings. Don't map anything.
+     */
+    if (addrc)
+        *addrc = 0;
+    if (sizec)
+        *sizec = 0;
+}
+
+/*
  * Array of bus specific translators
  */
 static const struct dt_bus dt_busses[] =
 {
+    /* MMIO-SRAM */
+    {
+        .name = "mmio-sram",
+        .addresses = "reg",
+        .match = dt_bus_mmio_sram_match,
+        .count_cells = dt_bus_mmio_sram_count_cells,
+        .map = dt_bus_default_map,
+        .translate = dt_bus_default_translate,
+        .get_flags = dt_bus_default_get_flags,
+    },
     /* PCI */
     {
         .name = "pci",
-- 
2.5.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.