xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [ARM:PATCH v1 1/1] Add Odroid-XU (Exynos5410) support
@ 2014-07-24 22:47 Suriyan Ramasami
  2014-07-25  8:18 ` Ian Campbell
  2014-07-25 12:19 ` Julien Grall
  0 siblings, 2 replies; 23+ messages in thread
From: Suriyan Ramasami @ 2014-07-24 22:47 UTC (permalink / raw)
  To: xen-devel
  Cc: keir, ian.campbell, tim, julien.grall, ian.jackson, jbeulich,
	suriyan.r

   XEN/ARM: Add Odroid-XU support

   The Odroid-XU from hardkernel is an Exynos5410 based board.
   This patch adds support for the above said board.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
---
 xen/arch/arm/platforms/exynos5.c        | 52 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/platforms/exynos5.h |  7 +++++
 2 files changed, 59 insertions(+)

diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index 65e584f..a210404 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -26,6 +26,7 @@
 #include <asm/platforms/exynos5.h>
 #include <asm/platform.h>
 #include <asm/io.h>
+#include <asm/delay.h>
 
 static int exynos5_init_time(void)
 {
@@ -85,6 +86,46 @@ static int __init exynos5_smp_init(void)
     return 0;
 }
 
+static int __init exynos5410_smp_init(void)
+{
+    void __iomem *sysram;
+    void __iomem *power;
+    char *c;
+    int i;
+
+    /* Power the secondary cores. */
+    for (i = 1; i < EXYNOS5410_NUM_CPUS; i++) {
+       power = ioremap_nocache(EXYNOS5410_POWER_CPU_BASE +
+                               i * EXYNOS5410_POWER_CPU_OFFSET, PAGE_SIZE);
+       c = (char *) power;
+       dprintk(XENLOG_INFO, "Power: %x status: %x\n", c[0], c[4]);
+       c[0] = EXYNOS5410_POWER_ENABLE;
+       dprintk(XENLOG_INFO, "Waiting for power status to change to %d\n",
+               EXYNOS5410_POWER_ENABLE);
+       while (c[4] != EXYNOS5410_POWER_ENABLE) {
+           udelay(1);
+       }
+       dprintk(XENLOG_INFO, "Power status changed to %d!\n",
+               EXYNOS5410_POWER_ENABLE);
+       iounmap(power);
+
+       sysram = ioremap_nocache(EXYNOS5410_PA_SYSRAM, PAGE_SIZE);
+       if ( !sysram )
+       {
+           dprintk(XENLOG_ERR, "Unable to map exynos5 MMIO\n");
+           return -EFAULT;
+       }
+
+       printk("Set SYSRAM to %"PRIpaddr" (%p)\n",
+              __pa(init_secondary), init_secondary);
+       writel(__pa(init_secondary), sysram);
+
+       iounmap(sysram);
+
+    }
+    return 0;
+}
+
 static void exynos5_reset(void)
 {
     void __iomem *pmu;
@@ -105,6 +146,7 @@ static void exynos5_reset(void)
 static const char * const exynos5_dt_compat[] __initconst =
 {
     "samsung,exynos5250",
+    "samsung,exynos5410",
     NULL
 };
 
@@ -128,6 +170,16 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
     .blacklist_dev = exynos5_blacklist_dev,
 PLATFORM_END
 
+PLATFORM_START(exynos5410, "SAMSUNG EXYNOS5410")
+    .compatible = exynos5_dt_compat,
+    .init_time = exynos5_init_time,
+    .specific_mapping = exynos5_specific_mapping,
+    .smp_init = exynos5410_smp_init,
+    .cpu_up = cpu_up_send_sgi,
+    .reset = exynos5_reset,
+    .blacklist_dev = exynos5_blacklist_dev,
+PLATFORM_END
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/asm-arm/platforms/exynos5.h b/xen/include/asm-arm/platforms/exynos5.h
index ea941e7..8bc4884 100644
--- a/xen/include/asm-arm/platforms/exynos5.h
+++ b/xen/include/asm-arm/platforms/exynos5.h
@@ -14,6 +14,13 @@
 
 #define S5P_PA_SYSRAM   0x02020000
 
+/* Exynos5410 specific */
+#define EXYNOS5410_PA_SYSRAM        0x0207301c
+#define EXYNOS5410_NUM_CPUS         0x04
+#define EXYNOS5410_POWER_CPU_BASE   (0x10040000 + 0x2000)
+#define EXYNOS5410_POWER_CPU_OFFSET (0x80)
+#define EXYNOS5410_POWER_ENABLE     (0x03)
+
 #endif /* __ASM_ARM_PLATFORMS_EXYNOS5_H */
 /*
  * Local variables:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-08-12 19:05 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 22:47 [ARM:PATCH v1 1/1] Add Odroid-XU (Exynos5410) support Suriyan Ramasami
2014-07-25  8:18 ` Ian Campbell
2014-07-25 12:19 ` Julien Grall
2014-07-25 12:39   ` Ian Campbell
2014-07-25 17:45     ` Suriyan Ramasami
2014-07-25 20:05       ` Ian Campbell
2014-07-26  0:06         ` Suriyan Ramasami
2014-07-26  7:26         ` Suriyan Ramasami
2014-07-26 11:28           ` Julien Grall
2014-07-26 16:02             ` Suriyan Ramasami
2014-07-26 17:58               ` Julien Grall
2014-07-26 20:26                 ` Suriyan Ramasami
2014-07-26 21:24                   ` Julien Grall
2014-07-26 21:26                     ` Julien Grall
2014-07-27 18:12                       ` Suriyan Ramasami
2014-07-28 12:53                         ` Julien Grall
2014-07-28 18:06                           ` Suriyan Ramasami
2014-07-28 20:19                             ` Suriyan Ramasami
2014-07-28 22:25                               ` Suriyan Ramasami
2014-07-29  7:30                                 ` Ian Campbell
2014-07-29 15:49                                   ` Suriyan Ramasami
2014-07-29 17:36                                     ` Ian Campbell
2014-08-12 19:05                                       ` Suriyan Ramasami

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).