xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chen Baozi <baozich@gmail.com>
To: Xen Developer List <xen-devel@lists.xen.org>
Cc: Chen Baozi <baozich@gmail.com>
Subject: [PATCH 2/3] xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE
Date: Tue, 15 Oct 2013 16:45:30 +0800	[thread overview]
Message-ID: <1381826731-7044-3-git-send-email-baozich@gmail.com> (raw)
In-Reply-To: <1381826731-7044-1-git-send-email-baozich@gmail.com>

Add a new quirk to map all disabled device in dom0, for omap5 kernel would
try to access the modules that are listed in DT and then do a soft-reset to
get those modules to a known state.

Signed-off-by: Chen Baozi <baozich@gmail.com>
---
 xen/arch/arm/domain_build.c    | 3 ++-
 xen/arch/arm/platforms/omap5.c | 3 ++-
 xen/include/asm-arm/platform.h | 6 ++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4f91327..b6f5b72 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -714,7 +714,8 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
      *  solution can be use later for pass through.
      */
     if ( !dt_device_type_is_equal(np, "memory") &&
-         dt_device_is_available(np) )
+         (dt_device_is_available(np) ||
+          platform_has_quirk(PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE)))
     {
         res = map_device(d, np);
 
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index a40d016..a583e2b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -123,7 +123,8 @@ static int omap5_specific_mapping(struct domain *d)
 
 static uint32_t omap5_quirks(void)
 {
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+    return PLATFORM_QUIRK_DOM0_MAPPING_11 |
+           PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE;
 }
 
 static const char const *omap5_dt_compat[] __initdata =
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 43afebb..09360a4 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -44,6 +44,12 @@ struct platform_desc {
  * Useful on platform where System MMU is not yet implemented
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
+/*
+ * Quirk to map disabled device
+ * Useful on platform where dom0 kernel would access device addresses
+ * whether it is disabled or not.
+ */
+#define PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE (1 << 1)
 
 int __init platform_init(void);
 int __init platform_init_time(void);
-- 
1.8.1.4

  parent reply	other threads:[~2013-10-15  8:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15  8:45 [PATCH 0/3] A new PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE quirk and smp initialization callbacks for omap5 Chen Baozi
2013-10-15  8:45 ` [PATCH 1/3] xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11 Chen Baozi
2013-10-21 16:42   ` Julien Grall
2013-10-22  1:06     ` Chen Baozi
2013-10-24 14:03     ` Ian Campbell
2013-10-15  8:45 ` Chen Baozi [this message]
2013-10-24 14:04   ` [PATCH 2/3] xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE Ian Campbell
2013-11-05 17:19     ` Chen Baozi
2013-10-15  8:45 ` [PATCH 3/3] xen/arm: implement smp initialization callbacks for omap5 Chen Baozi
2013-10-23 13:59   ` Julien Grall
2013-10-24 14:03     ` Ian Campbell

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=1381826731-7044-3-git-send-email-baozich@gmail.com \
    --to=baozich@gmail.com \
    --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).