From: Vijaya Kumar K <vijaya.ku...@caviumnetworks.com>

Add GSER region to thunderx platfrom specific mappings.
This region is not mentioned in DT. This is required by
PCI driver to detect and configure pci devices attached.

In future we can remove this mapping, if pci driver
in Dom does not require this.

Signed-off-by: Vijaya Kumar K <vijaya.ku...@caviumnetworks.com>
---
 xen/arch/arm/platforms/thunderx.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/xen/arch/arm/platforms/thunderx.c 
b/xen/arch/arm/platforms/thunderx.c
index be6f24f..563d01b 100644
--- a/xen/arch/arm/platforms/thunderx.c
+++ b/xen/arch/arm/platforms/thunderx.c
@@ -19,6 +19,31 @@
 
 #include <asm/platform.h>
 
+static int thunderx_specific_mapping(struct domain *d)
+{
+    paddr_t addr;
+    u64 size;
+    int res;
+
+    /* Mapping GSER region required for Dom0 */
+    addr = 0x87e090000000;
+    size = 0xd000000;
+
+    res = map_mmio_regions(d,
+                           paddr_to_pfn(addr & PAGE_MASK),
+                           DIV_ROUND_UP(size, PAGE_SIZE),
+                           paddr_to_pfn(addr & PAGE_MASK));
+    if ( res )
+    {
+         printk(XENLOG_ERR "Unable to map GSER region to dom%d"
+                " 0x%"PRIpaddr" - 0x%"PRIpaddr"\n",
+                d->domain_id,
+                addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+    }
+
+    return 0;
+}
+
 static const char * const thunderx_dt_compat[] __initconst =
 {
     "cavium,thunder-88xx",
@@ -27,6 +52,7 @@ static const char * const thunderx_dt_compat[] __initconst =
 
 PLATFORM_START(thunderx, "THUNDERX")
     .compatible = thunderx_dt_compat,
+    .specific_mapping = thunderx_specific_mapping,
     .dom0_gnttab_start = 0x40000000000,
     .dom0_gnttab_size = 0x20000,
 PLATFORM_END
-- 
1.7.9.5


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

Reply via email to