From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH v2 04/15] xen: arm: add a quirk to handle platforms with unusual GIC layout Date: Fri, 22 Nov 2013 16:24:23 +0000 Message-ID: <1385137474-31245-4-git-send-email-ian.campbell@citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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-devel@lists.xen.org Cc: Ian Campbell , Anup Patel , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, pranavkumar@linaro.org List-Id: xen-devel@lists.xenproject.org Use this quirk on the xgene platform. This should ideally be fixed by an extension to the device tree bindings as described in http://www.spinics.net/lists/devicetree/msg10473.html especially http://www.spinics.net/lists/devicetree/msg10478.html. However for the time being a platform specific quirk will do. Signed-off-by: Ian Campbell --- v2: This replaces "xen: arm: GICC_DIR register at offset 0x10000 instead of 0x1000" --- xen/arch/arm/gic.c | 6 +++++- xen/arch/arm/platforms/xgene-storm.c | 2 +- xen/include/asm-arm/platform.h | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index ab49106..9711f5d 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -444,7 +445,10 @@ void __init gic_init(void) BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) != FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE); set_fixmap(FIXMAP_GICC1, gic.cbase >> PAGE_SHIFT, DEV_SHARED); - set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 1, DEV_SHARED); + if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) ) + set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x10, DEV_SHARED); + else + set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x1, DEV_SHARED); set_fixmap(FIXMAP_GICH, gic.hbase >> PAGE_SHIFT, DEV_SHARED); /* Global settings: interrupt distributor */ diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c index 727ac2b..d185a4a 100644 --- a/xen/arch/arm/platforms/xgene-storm.c +++ b/xen/arch/arm/platforms/xgene-storm.c @@ -27,7 +27,7 @@ static uint32_t xgene_storm_quirks(void) { - return PLATFORM_QUIRK_DOM0_MAPPING_11; + return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE; } diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h index c282b30..c9314e5 100644 --- a/xen/include/asm-arm/platform.h +++ b/xen/include/asm-arm/platform.h @@ -44,6 +44,11 @@ struct platform_desc { * Useful on platform where System MMU is not yet implemented */ #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0) +/* + * Quirk for platforms where the 4K GIC register ranges are placed at + * 64K stride. + */ +#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 1) void __init platform_init(void); int __init platform_init_time(void); -- 1.7.10.4