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

[Xen-devel] [PATCH] xen: arm: platforms: Adding reset support for xgene arm64 platform.



This patch adds a reset support for xgene arm64 platform.

Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@xxxxxxxxxx>
Signed-off-by: Anup Patel <anup.patel@xxxxxxxxxx>
---
 xen/arch/arm/platforms/xgene-storm.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/xen/arch/arm/platforms/xgene-storm.c 
b/xen/arch/arm/platforms/xgene-storm.c
index 5b0bd5f..bd6223d 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -19,7 +19,9 @@
  */
 
 #include <xen/config.h>
+#include <xen/delay.h>
 #include <asm/platform.h>
+#include <asm/io.h>
 #include <asm/gic.h>
 
 static uint32_t xgene_storm_quirks(void)
@@ -107,6 +109,25 @@ err:
     return ret;
 }
 
+/*
+ * TODO: Get base address and mask from the device tree
+ */
+static void xgene_storm_reset(void)
+{
+    void __iomem *addr;
+
+    addr = ioremap_nocache(0x17000014UL, 0x100);
+
+    if ( !addr )
+    {
+        dprintk(XENLOG_ERR, "Unable to map xgene reset address\n");
+        return;
+    }
+
+    /* Write mask 0x1 to base address */
+    writel(0x1, addr);
+    mdelay(1000);
+}
 
 static const char * const xgene_storm_dt_compat[] __initconst =
 {
@@ -116,6 +137,7 @@ static const char * const xgene_storm_dt_compat[] 
__initconst =
 
 PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
+    .reset = xgene_storm_reset,
     .quirks = xgene_storm_quirks,
     .specific_mapping = xgene_storm_specific_mapping,
 
-- 
1.7.9.5


_______________________________________________
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®.