xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chen Baozi <baozich@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Julien Grall <julien.grall@linaro.org>, Tim Deegan <tim@xen.org>
Cc: Chen Baozi <baozich@gmail.com>,
	Xen Developer List <xen-devel@lists.xen.org>
Subject: [PATCH v2 3/3] xen/arm: Enable switch to hyp mode for OMAP5432
Date: Thu, 15 Aug 2013 21:19:50 +0800	[thread overview]
Message-ID: <1376572790-27724-4-git-send-email-baozich@gmail.com> (raw)
In-Reply-To: <1376572790-27724-1-git-send-email-baozich@gmail.com>


Signed-off-by: Chen Baozi <baozich@gmail.com>
---
 xen/arch/arm/arm32/mode_switch.S      | 14 +++++++++++---
 xen/include/asm-arm/platforms/omap5.h |  3 +++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm32/mode_switch.S b/xen/arch/arm/arm32/mode_switch.S
index ba2a462..52358b4 100644
--- a/xen/arch/arm/arm32/mode_switch.S
+++ b/xen/arch/arm/arm32/mode_switch.S
@@ -93,7 +93,7 @@ kick_cpus_sgi:
  * r5: Machine ID
  * r12: CPU number
  *
- * This code is specific to the VE model/Arndale, and not intended to be used
+ * This code is specific to the VE model/Arndale/OMAP5, and not intended to be used
  * on production systems.  As such it's a bit hackier than the main
  * boot code in head.S.  In future it will be replaced by better
  * integration with the bootloader/firmware so that Xen always starts
@@ -110,15 +110,23 @@ enter_hyp_mode:
         bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
         mcr   CP32(r0, SCR)
 
-        ldr   r2, =MACH_TYPE_SMDK5250   /* r4 := Arndale machine ID */
         /* By default load Arndale defaults values */
+        ldr   r2, =MACH_TYPE_SMDK5250       /* r2 := Arndale machine ID */
         ldr   r0, =EXYNOS5_TIMER_FREQUENCY  /* r0 := timer's frequency */
         ldr   r1, =EXYNOS5_GIC_BASE_ADDRESS /* r1 := GIC base address */
-        /* If it's not the Arndale machine ID, load VE values */
         teq   r5, r2
+        beq   1f
+        /* If it's not the Arndale machine ID, try OMAP5 uEVM */
+        ldr   r2, =MACH_TYPE_OMAP5_SEVM     /* r2 := OMAP5 uEVM machine ID */
+        ldr   r0, =OMAP5_TIMER_FREQUENCY    /* r0 := timer's frequency */
+        ldr   r1, =OMAP5_GIC_BASE_ADDRESS   /* r1 := GIC base address */
+        teq   r5, r2
+        beq   1f
+        /* If it's not the OMAP5432 machine ID, load VE values */
         ldrne r0, =V2M_TIMER_FREQUENCY
         ldrne r1, =V2M_GIC_BASE_ADDRESS
 
+1:
         /* Ugly: the system timer's frequency register is only
          * programmable in Secure state.  Since we don't know where its
          * memory-mapped control registers live, we can't find out the
diff --git a/xen/include/asm-arm/platforms/omap5.h b/xen/include/asm-arm/platforms/omap5.h
index 6657af6..a001c6a 100644
--- a/xen/include/asm-arm/platforms/omap5.h
+++ b/xen/include/asm-arm/platforms/omap5.h
@@ -26,6 +26,9 @@
 /* GIC Base Address */
 #define OMAP5_GIC_BASE_ADDRESS                  0x48210000
 
+/* Timer's frequency */
+#define OMAP5_TIMER_FREQUENCY                   6144000 /*  6.144 Mhz */
+
 /* OMAP5432 uEVM machine ID */
 #define MACH_TYPE_OMAP5_SEVM                    3777
 
-- 
1.8.1.4

  parent reply	other threads:[~2013-08-15 13:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 13:19 [PATCH v2 0/3] Specific mapping for dom0, smp kick cpus and hyp mode switch for OMAP5 Chen Baozi
2013-08-15 13:19 ` [PATCH v2 1/3] xen/arm: Specific mapping for dom0 on OMAP5 platform Chen Baozi
2013-08-22 10:21   ` Ian Campbell
2013-08-22 12:54     ` Ian Campbell
2013-08-23  0:04       ` Chen Baozi
2013-08-15 13:19 ` [PATCH v2 2/3] xen/arm: Support kick_cpus for OMAP5 Chen Baozi
2013-08-15 14:12   ` Andrii Anisov
2013-08-16  2:04     ` Chen Baozi
2013-08-15 13:19 ` Chen Baozi [this message]
2013-08-15 14:09   ` [PATCH v2 3/3] xen/arm: Enable switch to hyp mode for OMAP5432 Andrii Anisov
2013-08-15 14:25     ` Andrii Anisov
2013-08-15 14:27       ` Andrii Anisov
2013-08-15 14:51         ` Andrii Anisov
2013-08-15 14:37     ` Chen Baozi
2013-08-15 14:42       ` Andrii Anisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376572790-27724-4-git-send-email-baozich@gmail.com \
    --to=baozich@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).