From patchwork Thu Feb 5 10:28:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44421 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AAF722152B for ; Thu, 5 Feb 2015 10:29:27 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf4696807wev.0 for ; Thu, 05 Feb 2015 02:29:26 -0800 (PST) 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:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=318xVGk18e140a7z9nr2NFc2kiaChWMVkNf1CuQmn7M=; b=gflNYPjvjUWT6rLjsKp9xphE1jEbzoRwAZDO7gUmeGH+LXW0KLmsYR8fv+lIL1Ywgw YJVRXEzzTLcPtBJbeO6LG922zEf4xMZ4/RjfFlyh2xYUiagf9PPAXR42N7RNJum7HSB8 wgop7wWcyKrArR/Xo3dCHIYCdtLJMWVL3xdRXCMo5zOGo4xGxhFKNeEeGagr0nQc2OA4 rM4Afyc89ghA+ma85rUMYfkIAKLmv9/WqeMYAnLZOrXnVQwu3Vt8/pvQI0fm26yniQ+w n7O8oqRK+5yjAqpfS3remWSUj+Q3z/DycO6rz5AUBifAOY6No37mudlK8PwakbgTX8NQ FLxQ== X-Gm-Message-State: ALoCoQnHjMaakt3WBp73dTnVv8/KZLuOTAuIzifoyavuJ1f3waRC1WEXhdBi7xKdhgVeBTsZ9KYx X-Received: by 10.112.175.10 with SMTP id bw10mr374956lbc.7.1423132166715; Thu, 05 Feb 2015 02:29:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.42 with SMTP id n10ls132787laj.95.gmail; Thu, 05 Feb 2015 02:29:26 -0800 (PST) X-Received: by 10.152.207.11 with SMTP id ls11mr2526924lac.83.1423132166568; Thu, 05 Feb 2015 02:29:26 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id u3si3560242laj.100.2015.02.05.02.29.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 02:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id p9so6198677lbv.8 for ; Thu, 05 Feb 2015 02:29:26 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr2591476lbb.32.1423132166487; Thu, 05 Feb 2015 02:29:26 -0800 (PST) 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.35.133 with SMTP id h5csp1049453lbj; Thu, 5 Feb 2015 02:29:25 -0800 (PST) X-Received: by 10.42.130.198 with SMTP id w6mr6255931ics.97.1423132164295; Thu, 05 Feb 2015 02:29:24 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id k20si3247038ioi.104.2015.02.05.02.29.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 05 Feb 2015 02:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YJJgR-00012E-KW; Thu, 05 Feb 2015 10:29:15 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YJJgQ-000129-HD for edk2-devel@lists.sourceforge.net; Thu, 05 Feb 2015 10:29:14 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.177 as permitted sender) client-ip=74.125.82.177; envelope-from=ard.biesheuvel@linaro.org; helo=mail-we0-f177.google.com; Received: from mail-we0-f177.google.com ([74.125.82.177]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YJJgO-0002ll-KT for edk2-devel@lists.sourceforge.net; Thu, 05 Feb 2015 10:29:14 +0000 Received: by mail-we0-f177.google.com with SMTP id l61so6788832wev.8 for ; Thu, 05 Feb 2015 02:29:06 -0800 (PST) X-Received: by 10.194.223.5 with SMTP id qq5mr6130584wjc.152.1423132146661; Thu, 05 Feb 2015 02:29:06 -0800 (PST) Received: from ards-macbook-pro.local (205.28.43.5.rev.vodafone.pt. [5.43.28.205]) by mx.google.com with ESMTPSA id x6sm6706609wjf.24.2015.02.05.02.29.04 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Feb 2015 02:29:05 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, lersek@redhat.com, olivier.martin@arm.com, roy.franz@linaro.org, leif.lindholm@linaro.org Date: Thu, 5 Feb 2015 10:28:53 +0000 Message-Id: <1423132136-19349-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1423132136-19349-1-git-send-email-ard.biesheuvel@linaro.org> References: <1423132136-19349-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YJJgO-0002ll-KT Subject: [edk2] [PATCH 1/4] ArmPkg: enable ARE bit before driving GICv3 in native mode X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@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.217.177 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 The GICv3 driver must use native mode to drive a GICv3 due to the fact that v2 compatibility is optional in the v3 spec. However, if v2 compatibility is implemented, it is the default and needs to be disabled first by setting the Affinity Routing Enable (ARE) bit. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 6 ++++++ ArmPkg/Include/Library/ArmGicLib.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c index 571d5054f8c2..245d97425eeb 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c @@ -249,6 +249,12 @@ GicV3DxeInitialize ( mGicRedistributorBase = PcdGet32 (PcdGicRedistributorBase); mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase); + // + // We will be driving this GIC in native v3 mode, i.e., with Affinity + // Routing enabled. So ensure that the ARE bit is set. + // + MmioOr32 (mGicDistributorBase + ARM_GIC_ICDDCR, ARM_GIC_ICDDCR_ARE); + for (Index = 0; Index < mGicNumInterrupts; Index++) { GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index); diff --git a/ArmPkg/Include/Library/ArmGicLib.h b/ArmPkg/Include/Library/ArmGicLib.h index 2ab99772d1e1..e2a4818c4c0c 100644 --- a/ArmPkg/Include/Library/ArmGicLib.h +++ b/ArmPkg/Include/Library/ArmGicLib.h @@ -53,6 +53,9 @@ typedef enum { // GICv3 specific registers #define ARM_GICD_IROUTER 0x6100 // Interrupt Routing Registers +// the Affinity Routing Enable (ARE) bit in GICD_CTLR +#define ARM_GIC_ICDDCR_ARE (1 << 4) + // // GIC Redistributor //