Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6359928imu; Mon, 21 Jan 2019 07:35:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN5yYn96GOJP3QhwaTV0V50TjOsVS5ziLJZ3OVPWWfobhDy882CXMjM5Hm9dx3lMlhIxYiWh X-Received: by 2002:a63:f717:: with SMTP id x23mr28869064pgh.317.1548084949141; Mon, 21 Jan 2019 07:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548084949; cv=none; d=google.com; s=arc-20160816; b=q3J/2sVC3Wopd22yF08sBhTvlEUL3HN4GNus/IlJEzwC0fffJL8j4H+f00/PBuB7j1 +6lcHVucyjCGmOk0dDBIMLVg7uDf8WWCBqZP0LWXGrL0G6kLvTAxIgOXBJamFDQdEEUQ Nem1fUGbVRjX7N2wWssTKuuh9iwWid++acJykAKTd/mDMGtsPsunCubjemR6Sl/Kf+MK bTBenOg4QrpQPzfhTdzuSQVcbENEzFkB7vIQRFI6bcrUzN4rQoocrNk69AdDMwG4k8qm iPzwhYtIeXZ8i9FRXn4PdLG/uy1guIw9R+rIqgxXRfVddjfrNMwOQuhYAVgR0zZz6EJK oiZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=cEfBLXAJxnSPliy7i4lVEbQbhxX1CCrSM7DJdfpUR+w=; b=teYwDer/S1Bl7jk7zcSfqXIwWsh03na4HO7/QO0wA/143JTah7W2IH8zhs2MTzYCsQ ss0uYakielvGxUF2HtDO38i9fxTsxOCldDXutdT711mr9c3LEJ33cI3BzuCTf/ucssWd 9RyhtJYaE6lJgWrxDqecM5s0wDwAVrhBP8AvkCO2MugqjAz1frFC1vwI8KAGI0dkDTa1 fi0u9EGgTFH1ti2H3mI4CD3n2d85/Vmkxo7uXnmOn8YcmBkMBulAIhL3pk5fwEXiUe6e ukWckCC38nF1uytqInbTuLZ3cdh+5qwaylRRZ9TNCqR6xVt72tvUgBDnsqn5boLT0kWv AXwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 39si3897138plc.153.2019.01.21.07.35.33; Mon, 21 Jan 2019 07:35:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729984AbfAUPeP (ORCPT + 99 others); Mon, 21 Jan 2019 10:34:15 -0500 Received: from foss.arm.com ([217.140.101.70]:36416 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729773AbfAUPeM (ORCPT ); Mon, 21 Jan 2019 10:34:12 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 840A1165C; Mon, 21 Jan 2019 07:34:12 -0800 (PST) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 939523F5C1; Mon, 21 Jan 2019 07:34:10 -0800 (PST) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, Julien Thierry , Russell King Subject: [PATCH v9 05/26] arm/arm64: gic-v3: Add PMR and RPR accessors Date: Mon, 21 Jan 2019 15:33:24 +0000 Message-Id: <1548084825-8803-6-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1548084825-8803-1-git-send-email-julien.thierry@arm.com> References: <1548084825-8803-1-git-send-email-julien.thierry@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add helper functions to access system registers related to interrupt priorities: PMR and RPR. Signed-off-by: Julien Thierry Reviewed-by: Mark Rutland Acked-by: Catalin Marinas Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier --- arch/arm/include/asm/arch_gicv3.h | 16 ++++++++++++++++ arch/arm64/include/asm/arch_gicv3.h | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/arm/include/asm/arch_gicv3.h b/arch/arm/include/asm/arch_gicv3.h index 0bd5307..bef0b5d 100644 --- a/arch/arm/include/asm/arch_gicv3.h +++ b/arch/arm/include/asm/arch_gicv3.h @@ -34,6 +34,7 @@ #define ICC_SRE __ACCESS_CP15(c12, 0, c12, 5) #define ICC_IGRPEN1 __ACCESS_CP15(c12, 0, c12, 7) #define ICC_BPR1 __ACCESS_CP15(c12, 0, c12, 3) +#define ICC_RPR __ACCESS_CP15(c12, 0, c11, 3) #define __ICC_AP0Rx(x) __ACCESS_CP15(c12, 0, c8, 4 | x) #define ICC_AP0R0 __ICC_AP0Rx(0) @@ -245,6 +246,21 @@ static inline void gic_write_bpr1(u32 val) write_sysreg(val, ICC_BPR1); } +static inline u32 gic_read_pmr(void) +{ + return read_sysreg(ICC_PMR); +} + +static inline void gic_write_pmr(u32 val) +{ + write_sysreg(val, ICC_PMR); +} + +static inline u32 gic_read_rpr(void) +{ + return read_sysreg(ICC_RPR); +} + /* * Even in 32bit systems that use LPAE, there is no guarantee that the I/O * interface provides true 64bit atomic accesses, so using strd/ldrd doesn't diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h index e278f94..37193e2 100644 --- a/arch/arm64/include/asm/arch_gicv3.h +++ b/arch/arm64/include/asm/arch_gicv3.h @@ -114,6 +114,21 @@ static inline void gic_write_bpr1(u32 val) write_sysreg_s(val, SYS_ICC_BPR1_EL1); } +static inline u32 gic_read_pmr(void) +{ + return read_sysreg_s(SYS_ICC_PMR_EL1); +} + +static inline void gic_write_pmr(u32 val) +{ + write_sysreg_s(val, SYS_ICC_PMR_EL1); +} + +static inline u32 gic_read_rpr(void) +{ + return read_sysreg_s(SYS_ICC_RPR_EL1); +} + #define gic_read_typer(c) readq_relaxed(c) #define gic_write_irouter(v, c) writeq_relaxed(v, c) #define gic_read_lpir(c) readq_relaxed(c) -- 1.9.1