]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen/arm: Add versatile express platform
authorJulien Grall <julien.grall@linaro.org>
Sun, 28 Apr 2013 18:48:29 +0000 (19:48 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 13 May 2013 11:00:00 +0000 (12:00 +0100)
This platform contains nearly nothing specific except the reset function.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/platforms/vexpress.c
xen/arch/arm/shutdown.c
xen/include/asm-arm/config.h
xen/include/asm-arm/platforms/vexpress.h

index fd4ce740dabcfdc62df4c1e12c639d18349d07f8..8fc30c4d48166a84fcc2899e523f398c49c9030d 100644 (file)
@@ -18,7 +18,9 @@
  */
 
 #include <asm/platforms/vexpress.h>
+#include <asm/platform.h>
 #include <xen/mm.h>
+#include <xen/vmap.h>
 
 #define DCC_SHIFT      26
 #define FUNCTION_SHIFT 20
@@ -90,6 +92,44 @@ out:
     return ret;
 }
 
+/*
+ * TODO: Get base address from the device tree
+ * See arm,vexpress-reset node
+ */
+static void vexpress_reset(void)
+{
+    void __iomem *sp810;
+
+    /* Use the SP810 system controller to force a reset */
+    sp810 = ioremap_nocache(SP810_ADDRESS, PAGE_SIZE);
+
+    if ( !sp810 )
+    {
+        dprintk(XENLOG_ERR, "Unable to map SP810\n");
+        return;
+    }
+
+    /* switch to slow mode */
+    iowritel(sp810, 0x3);
+    dsb(); isb();
+    /* writing any value to SCSYSSTAT reg will reset the system */
+    iowritel(sp810 + 4, 0x1);
+    dsb(); isb();
+
+    iounmap(sp810);
+}
+
+static const char const *vexpress_dt_compat[] __initdata =
+{
+    "arm,vexpress",
+    NULL
+};
+
+PLATFORM_START(vexpress, "VERSATILE EXPRESS")
+    .compatible = vexpress_dt_compat,
+    .reset = vexpress_reset,
+PLATFORM_END
+
 /*
  * Local variables:
  * mode: C
index 0903842f77df40906e7320582b74a32b16a30b95..767cc12ad40ac4ff832f361732d13b4c22a2051a 100644 (file)
@@ -3,25 +3,11 @@
 #include <xen/cpu.h>
 #include <xen/delay.h>
 #include <xen/lib.h>
-#include <xen/mm.h>
 #include <xen/smp.h>
 #include <asm/platform.h>
 
 static void raw_machine_reset(void)
 {
-    /* XXX get this from device tree */
-#ifdef SP810_ADDRESS
-    /* Use the SP810 system controller to force a reset */
-    volatile uint32_t *sp810;
-    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
-    sp810 = ((uint32_t *)
-             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
-    sp810[0] = 0x3; /* switch to slow mode */
-    dsb(); isb();
-    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
-    dsb(); isb();
-    clear_fixmap(FIXMAP_MISC);
-#endif
     platform_reset();
 }
 
index 8ed72f5188d7a769a5600021ab88d4d9f3835b4d..75992027ff00dd27aea8659224cea84c79c74b6b 100644 (file)
@@ -149,9 +149,6 @@ extern unsigned long frametable_virt_end;
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
-/* Board-specific: base address of system controller */
-#define SP810_ADDRESS 0x1C020000
-
 
 #endif /* __ARM_CONFIG_H__ */
 /*
index 67f8fef8db4d87778cd2db31dd700b508f289578..5cf3aba6f2089df9a9562d9d01e2cefa33243607 100644 (file)
@@ -23,6 +23,9 @@
 #define V2M_SYS_CFG_OSC4      4
 #define V2M_SYS_CFG_OSC5      5
 
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 #ifndef __ASSEMBLY__
 #include <xen/inttypes.h>