From patchwork Fri Apr 24 10:46:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 47555 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 463C42121F for ; Fri, 24 Apr 2015 10:47:16 +0000 (UTC) Received: by lamp14 with SMTP id p14sf11094100lam.3 for ; Fri, 24 Apr 2015 03:47:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=SgwtsRNN4TPRSOOh22u+tH12049CyQ0zNGg07RwBX3E=; b=CbrsL+Um+JY78S59PafrKV7wid++L43eAj1o6UrJM7djAZN4n0luB+jC8ab/TVmk46 3ZtuDh3weaJb6GRaZfXy0FG9XJOZetXrEX/p2irYaiEqRARGOb7ES6HA3YWuvw3cKjQE XWr1XCfTZDfK4EcxKFCLgOW2u3gYf1QfErOVbT7qBsEQAo8Zj4iK7eg+Mn1MiU7hsDwH gdlI9ww6UXwVaQTqlMyKf23c8KRekZqPA9rumrbVzsE698lh/+za/ugA4pm8TnVtKGnd U38IsJ3s3vgeX6n/nLutbbbgc9WN8Wbsh8u2GblSRpLDgwlUwA0vNioPyBcqycQ1uBWN JQcQ== X-Gm-Message-State: ALoCoQn4kQvxa+9fzlbcDC8UFqCKypal2zNtYbTTu95M1gadv15widVn/jxeMY2AwrFrlIVKMoiw X-Received: by 10.180.96.6 with SMTP id do6mr810201wib.4.1429872435147; Fri, 24 Apr 2015 03:47:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.133 with SMTP id kq5ls446438lac.102.gmail; Fri, 24 Apr 2015 03:47:15 -0700 (PDT) X-Received: by 10.112.181.68 with SMTP id du4mr6205031lbc.11.1429872434960; Fri, 24 Apr 2015 03:47:14 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id i6si7956796laa.144.2015.04.24.03.47.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2015 03:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laat2 with SMTP id t2so32250410laa.1 for ; Fri, 24 Apr 2015 03:47:14 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr4629264lbc.19.1429872434515; Fri, 24 Apr 2015 03:47:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1106546lbt; Fri, 24 Apr 2015 03:47:13 -0700 (PDT) X-Received: by 10.70.35.171 with SMTP id i11mr5038273pdj.103.1429872432499; Fri, 24 Apr 2015 03:47:12 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com. [209.85.192.181]) by mx.google.com with ESMTPS id pr9si16894865pbc.12.2015.04.24.03.47.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2015 03:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of pranavkumar@linaro.org designates 209.85.192.181 as permitted sender) client-ip=209.85.192.181; Received: by pdbqd1 with SMTP id qd1so45673918pdb.2 for ; Fri, 24 Apr 2015 03:47:11 -0700 (PDT) X-Received: by 10.66.224.109 with SMTP id rb13mr13406600pac.133.1429872431414; Fri, 24 Apr 2015 03:47:11 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id pa1sm10758809pdb.73.2015.04.24.03.47.07 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Apr 2015 03:47:10 -0700 (PDT) From: Pranavkumar Sawargaonkar To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, stefano.stabellini@citrix.com, julien.grall@citrix.com, christoffer.dall@linaro.org, patches@apm.com, patches@linaro.org, Pranavkumar Sawargaonkar Subject: [PATCH V2] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk Date: Fri, 24 Apr 2015 16:16:56 +0530 Message-Id: <1429872417-20506-1-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 ChangeLog: V2: - Fine tune interrupt controller node search as per comments on V1 patch - Incorporating other misc comments on V1. V1: - Initial patch. Tested-by: Christoffer Dall Signed-off-by: Pranavkumar Sawargaonkar --- xen/arch/arm/platforms/xgene-storm.c | 42 +++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c index 1812e5b..c9a6dfc 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,46 @@ 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 __read_mostly xgene_quirks = PLATFORM_QUIRK_GIC_64K_STRIDE; + +static void __init xgene_check_pirq_eoi(void) +{ + struct dt_device_node *node; + int res; + paddr_t dbase; + static const struct dt_device_match xgene_dt_int_ctrl_match[] = + { + DT_MATCH_COMPATIBLE("arm,cortex-a15-gic"), + { /*sentinel*/ }, + }; + + node = dt_find_interrupt_controller(xgene_dt_int_ctrl_match); + if ( !node ) + panic("%s: Can not find interrupt controller node\n", __func__); + + 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 ) + { + xgene_quirks |= PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI; + printk("Xen: warning: Using OLD X-Gene Firmware," + "disabling PIRQ EOI mode ...\n"); + } +} + static uint32_t xgene_storm_quirks(void) { - return PLATFORM_QUIRK_GIC_64K_STRIDE|PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI; + return xgene_quirks; } static int map_one_mmio(struct domain *d, const char *what, @@ -216,6 +254,8 @@ static int xgene_storm_init(void) reset_mask = XGENE_RESET_MASK; reset_vals_valid = true; + xgene_check_pirq_eoi(); + return 0; }