All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH v2] xen/arm: Switch OMAP5 secondary cores into hyp mode
@ 2019-06-28 19:42 Denis Obrezkov
  2019-07-07 18:03 ` Julien Grall
  0 siblings, 1 reply; 7+ messages in thread
From: Denis Obrezkov @ 2019-06-28 19:42 UTC (permalink / raw)
  To: xen-devel
  Cc: hy-gsoc, sstabellini, andre.przywara, tim, Denis Obrezkov,
	drhunter95, julien.grall

This function allows xen to bring secondary CPU cores into non-secure
HYP mode. This is done by using a Secure Monitor call.

Signed-off-by: Denis Obrezkov <denisobrezkov@gmail.com>
---
Changes in v2:
- move code to platform specific file
---
 xen/arch/arm/platforms/omap5.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index aee24e4d28..79764a6cd6 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -23,6 +23,17 @@
 #include <xen/vmap.h>
 #include <asm/io.h>
 
+void omap5_init_secondary(void);
+asm (
+        ".text                              \n\t"
+        "omap5_init_secondary:              \n\t"
+        "        ldr   r12, =0x102          \n\t" /* API_HYP_ENTRY */
+        "        adr   r0, omap5_hyp        \n\t"
+        "        smc   #0                   \n\t"
+        "omap5_hyp:                         \n\t"
+        "        b     init_secondary       \n\t"
+        );
+
 static uint16_t num_den[8][2] = {
     {         0,          0 },  /* not used */
     {  26 *  64,  26 *  125 },  /* 12.0 Mhz */
@@ -128,8 +139,9 @@ static int __init omap5_smp_init(void)
     }
 
     printk("Set AuxCoreBoot1 to %"PRIpaddr" (%p)\n",
-           __pa(init_secondary), init_secondary);
-    writel(__pa(init_secondary), wugen_base + OMAP_AUX_CORE_BOOT_1_OFFSET);
+           __pa(omap5_init_secondary), omap5_init_secondary);
+    writel(__pa(omap5_init_secondary),
+           wugen_base + OMAP_AUX_CORE_BOOT_1_OFFSET);
 
     printk("Set AuxCoreBoot0 to 0x20\n");
     writel(0x20, wugen_base + OMAP_AUX_CORE_BOOT_0_OFFSET);
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-07-22 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 19:42 [Xen-devel] [PATCH v2] xen/arm: Switch OMAP5 secondary cores into hyp mode Denis Obrezkov
2019-07-07 18:03 ` Julien Grall
2019-07-17 16:32   ` Denis Obrezkov
2019-07-17 16:52     ` Julien Grall
2019-07-17 21:55       ` Denis Obrezkov
2019-07-18 10:09         ` Julien Grall
2019-07-22 10:51           ` Andrii Anisov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.