Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3984550imu; Mon, 12 Nov 2018 04:01:04 -0800 (PST) X-Google-Smtp-Source: AJdET5df06F3q7NDZyIi8XCCbgGv73U4n4pVlnkjDcApOqqdaj1P0qJw/cwRloU6X9dzeZiZrU5P X-Received: by 2002:a63:f0c:: with SMTP id e12mr570540pgl.274.1542024064718; Mon, 12 Nov 2018 04:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542024064; cv=none; d=google.com; s=arc-20160816; b=dhiXrapFLjGp6a9bX9i+570q8uDZZVwWgxnc4fhPlZD3Ve6lYfuyin2F4ym0vE/Rry HBx+/vvNB6VGwHk6xC/L9InKQZ2okEuGM4uTpzS/mrpkdauKw3h/L4LqJwTwVuOY9VLw pK8S+//o9fu2DZ3Y86Cv502CbIAfHgK4e2iL7hSVzUnd9moVpxtl3FI/2d+L2urycj1N f2zOskbafbmQXa1eS4bkN7ddJGXErZIGkuWfGZq6mHUkdxc/TVbIA5CCH+BV521zOxgE mDHp1aSxIGKqB+RvaoaZTxTM5FRmgjSyDunJqjJ2ENG7IJy67jnpjW0bspIXs8uO+m+4 OUJQ== 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=whNYMHjVt2y/oFdgMSH8rSPdxrSnQkXLJpv46zg2Lck=; b=nq1sYSa3QXx84E7I5IoVVQcy0J/hXlHopIiKYFE0QWbEDuZXAttfK75zn7LFn7dov/ jazAXaQnkm6zwJ4XhR6Lkqfi5ZU3uzUXqEURxo+wuFk6MvAD22N6aw+nioZlFoCjqyQp MxtKBc7/PdOZQVAKHZNWYmEjDn9Cgtzumt2J4VHqPKDuJMf0xCl9oczdTFD7SkbLrL+g r5G6OEs+Vpd4BPHcM7YTvq0ufWLmluwPLyApFxJDPndG7DMl0vCMQrRVNG1xoi+V29K6 FUD3C75ggJkL8M1Ix9qlt90qcvip4Qp+ADHvAZEKvdxi+mhF6RFHLjb7GoMc98PTovC3 aPpg== 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 d12si6711355pga.506.2018.11.12.04.00.49; Mon, 12 Nov 2018 04:01:04 -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 S1730069AbeKLVxB (ORCPT + 99 others); Mon, 12 Nov 2018 16:53:01 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34536 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729610AbeKLVuc (ORCPT ); Mon, 12 Nov 2018 16:50:32 -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 3C51C1682; Mon, 12 Nov 2018 03:57:36 -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 704E03F5A0; Mon, 12 Nov 2018 03:57:34 -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, Julien Thierry , Russell King Subject: [PATCH v6 04/24] arm/arm64: gic-v3: Add PMR and RPR accessors Date: Mon, 12 Nov 2018 11:56:55 +0000 Message-Id: <1542023835-21446-5-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542023835-21446-1-git-send-email-julien.thierry@arm.com> References: <1542023835-21446-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 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