From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Baozi Subject: [PATCH 2/3] xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE Date: Tue, 15 Oct 2013 16:45:30 +0800 Message-ID: <1381826731-7044-3-git-send-email-baozich@gmail.com> References: <1381826731-7044-1-git-send-email-baozich@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1381826731-7044-1-git-send-email-baozich@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen Developer List Cc: Chen Baozi List-Id: xen-devel@lists.xenproject.org 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 --- 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