From patchwork Mon Apr 6 08:54:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 46780 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E65E214B1 for ; Mon, 6 Apr 2015 08:56:51 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf4230894lbb.0 for ; Mon, 06 Apr 2015 01:56:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:content-type:content-transfer-encoding :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=Am2TrDbDz/JsfxDsZTWZreFjXOgdbI7aCXy7NVyQJTs=; b=a4KjW+0YUH8m3wSmj85VWQGPCCBHZ7i/wh9g8Aq97gFuZCf+1lpkxQf25Kw/MEEap2 8jHJTljs2ji779iD7k/t2tEQ34Bfc+nTesaIOeyrXC6uhmfWssFTEI88Hh46c9OPidri hJiipKy2TQOKdK1cT71yoAA1qQTHrezdRLfe7uJP2THXN0DzM0whZx7YNAXgc3cdJ024 /7PDtsjgfXtkTiZoYgH1esbxRIyTlQyhcecCVAknfkEHYpRgbjQ6LNEKdJ8J3t/wGBWZ khm6i5u3l8eiRcJPoQwcmZmbiJhqfg+j+xRCxN7yRkkC99JvTeuAKTGZ42GxzGoEgeF7 Cvjw== X-Gm-Message-State: ALoCoQkL3T+cRwuWSGxNSWUMAtnKw5K8QYy90UOXqFC9FmcKyYW7TejiVjbjTUlaqvDjFNfSWYhb X-Received: by 10.180.23.40 with SMTP id j8mr3043619wif.2.1428310610290; Mon, 06 Apr 2015 01:56:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.66 with SMTP id i2ls131783lah.19.gmail; Mon, 06 Apr 2015 01:56:50 -0700 (PDT) X-Received: by 10.152.179.68 with SMTP id de4mr12838310lac.65.1428310610130; Mon, 06 Apr 2015 01:56:50 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id px1si3038014lac.125.2015.04.06.01.56.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 01:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by laat2 with SMTP id t2so8811535laa.1 for ; Mon, 06 Apr 2015 01:56:50 -0700 (PDT) X-Received: by 10.112.125.167 with SMTP id mr7mr12795929lbb.106.1428310609910; Mon, 06 Apr 2015 01:56:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp3231310lbq; Mon, 6 Apr 2015 01:56:49 -0700 (PDT) X-Received: by 10.140.128.73 with SMTP id 70mr16430996qha.75.1428310608522; Mon, 06 Apr 2015 01:56:48 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w69si3593960qge.14.2015.04.06.01.56.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 Apr 2015 01:56:48 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yf2ns-00022n-8S; Mon, 06 Apr 2015 08:54:44 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yf2nq-00022g-V7 for xen-devel@lists.xen.org; Mon, 06 Apr 2015 08:54:43 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id ED/C0-03711-1D942255; Mon, 06 Apr 2015 08:54:41 +0000 X-Env-Sender: pranavkumar@linaro.org X-Msg-Ref: server-8.tower-31.messagelabs.com!1428310479!14008512!1 X-Originating-IP: [209.85.220.53] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19399 invoked from network); 6 Apr 2015 08:54:41 -0000 Received: from mail-pa0-f53.google.com (HELO mail-pa0-f53.google.com) (209.85.220.53) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 6 Apr 2015 08:54:41 -0000 Received: by pacyx8 with SMTP id yx8so38215393pac.1 for ; Mon, 06 Apr 2015 01:54:39 -0700 (PDT) X-Received: by 10.67.16.110 with SMTP id fv14mr25609186pad.39.1428310479288; Mon, 06 Apr 2015 01:54:39 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id wt1sm3838549pbc.76.2015.04.06.01.54.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Apr 2015 01:54:38 -0700 (PDT) From: Pranavkumar Sawargaonkar To: xen-devel@lists.xen.org Date: Mon, 6 Apr 2015 14:24:01 +0530 Message-Id: <1428310441-5412-1-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 Cc: patches@apm.com, stefano.stabellini@citrix.com, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Xen-devel] [PATCH] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: In old X-Gene Storm firmware and DT, secure mode addresses have been mentioned in GICv2 node. In this case maintenance interrupt is used instead of EOI HW method. This patch checks the GIC Distributor Base Address to enable EOI quirk for old firmware. Ref: http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html Signed-off-by: Pranavkumar Sawargaonkar Tested-by: Christoffer Dall --- xen/arch/arm/platforms/xgene-storm.c | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c index eee650e..dd7cbfc 100644 --- a/xen/arch/arm/platforms/xgene-storm.c +++ b/xen/arch/arm/platforms/xgene-storm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -35,9 +36,41 @@ static u64 reset_addr, reset_size; static u32 reset_mask; static bool reset_vals_valid = false; +#define XGENE_SEC_GICV2_DIST_ADDR 0x78010000 +static u32 quirk_guest_pirq_need_eoi; + +static void xgene_check_pirq_eoi(void) +{ + struct dt_device_node *node; + int res; + paddr_t dbase; + + dt_for_each_device_node( dt_host, node ) + { + if ( !dt_get_property(node, "interrupt-controller", NULL) ) + continue; + + res = dt_device_get_address(node, 0, &dbase, NULL); + if ( !dbase ) + panic("%s: Cannot find a valid address for the " + "distributor", __func__); + + /* + * In old X-Gene Storm firmware and DT, secure mode addresses have + * been mentioned in GICv2 node. We have to use maintenance interrupt + * instead of EOI HW in this case. We check the GIC Distributor Base + * Address to maintain compatibility with older firmware. + */ + if (dbase == XGENE_SEC_GICV2_DIST_ADDR) + quirk_guest_pirq_need_eoi = PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI; + else + quirk_guest_pirq_need_eoi = 0; + } +} + static uint32_t xgene_storm_quirks(void) { - return PLATFORM_QUIRK_GIC_64K_STRIDE|PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI; + return PLATFORM_QUIRK_GIC_64K_STRIDE| quirk_guest_pirq_need_eoi; } static int map_one_mmio(struct domain *d, const char *what, @@ -216,6 +249,8 @@ static int xgene_storm_init(void) reset_mask = XGENE_RESET_MASK; reset_vals_valid = true; + xgene_check_pirq_eoi(); + return 0; }