Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp588382ioo; Thu, 26 May 2022 10:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxHlZqiAnsZht8ahbXfllYUpVD3fkuNl7rI/usX8aOY5IeM6wII6/JIx2wSr8z3JqpXCqU X-Received: by 2002:a17:902:8602:b0:162:eaf:3630 with SMTP id f2-20020a170902860200b001620eaf3630mr26382812plo.118.1653584492796; Thu, 26 May 2022 10:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653584492; cv=none; d=google.com; s=arc-20160816; b=0+DvHYZCT6g/TwNDDlKU/jSsr6m7gZLlYa2Wr/v/b0/FlhnmaEL1f3tcbkSqcutYTr 4e/meanNdzGXXa7qqJOEcFmHKAEmKeDQxZHlvdk0C1KAbx/uEv8Z3qWpirBbl5J/Fpyr gk9iLXhUzPmc2Xu3Ym4iiK+c+ouqzNGiES8eJotut+ZbMEltbrCq3fbCmQ9FjFgWkAl1 VgryPC4vLKo21i8ogDpHXXW/EMYHiI8v/MXehKJRe3Mf0CX06Gk0f4bHSgpB8sG1fIfJ tJyqexYMW8ZbTlwG1AubHUulYbksOr+1QgeMqClKQOx0mj0SoDFy3q47iGyEBLSawM9R Uesw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=XLpxWonmRq/QNBq/fkI4YPPckQU+cClBjO26u6WbxLY=; b=sPLhf+zWsG5wo8LPEPY7xso+8AGYTAJfqppfEP7KeiO3lXaGpciuEhWPWyaPKPXgTZ QM2ia//gwIX0ka+lZ9m6IFH/c8kIuzkk0YcWNJF5CQCRa8oAKeq6quaxsk56t+ViGqTR 34Px5gezpZAOYXCfYVfxJ07L9mz5bNCUy8DciQHmTzYRrGT90XqIVG4x8nAubJxeZ1A6 9tM2E+m1iw0YEi1GhmSZkBlI5U7AaC05k4W/3vfUPd7jOv+/zF2GnY+kDsfQf9k8vRuo D0zVqqcI7dWLVkm5Zc0w8XqQD2eWtCD+mLNqcwNwDZgnDPRtfLRC8N4pm4zj1XbS6Wx3 UWNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=RduT0S70; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=ok282z8N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a056a00130400b00505b7215af5si2720080pfu.149.2022.05.26.10.01.18; Thu, 26 May 2022 10:01:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=RduT0S70; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=ok282z8N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343739AbiEYSdQ (ORCPT + 99 others); Wed, 25 May 2022 14:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343734AbiEYSdO (ORCPT ); Wed, 25 May 2022 14:33:14 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDE4B2244; Wed, 25 May 2022 11:33:10 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 68863320095C; Wed, 25 May 2022 14:33:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 25 May 2022 14:33:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1653503587; x= 1653589987; bh=XLpxWonmRq/QNBq/fkI4YPPckQU+cClBjO26u6WbxLY=; b=R duT0S70ogz23s1DW4MwE8/UjTcbotvH6+5M/D7H47QszgjJNIg65/dbsUB+dvQ10 25qL54EAq2ECaiFHbrA53bLpTV0oMHIk48HshNL194GFQGimQPgCVectL5BwTs7I InZqQiwXONnw2HIOjxIpyUSArvFDnrfXMiQ+C6L4xtxLTd8Zlg2ChvZC3aoE15XZ X2YYQ3yiZx++zLhS0ctz/kvKDMat4hdbybHC715flEEmUiY1XpMokcFUK5Ys8CL6 7APDrRTF3bt5WA9s7t3ILdr45z7g9FKpnx4Lv90ojc0eNU+X3h8VYvXWxNbG5dPL U35DUVSvftnkOHcbiuG3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1653503587; x= 1653589987; bh=XLpxWonmRq/QNBq/fkI4YPPckQU+cClBjO26u6WbxLY=; b=o k282z8NEnxPIrLE1dxkSstBjQHLUzSIoAUn8IsvBe+D7zhDU9nlwdtzZWEtTuuBE CplGM5qC+hnvZBXaUQlFlK1CvnhQW+Ui3/cM8LKV8WT7F5PD/+vvSoNdqwSRbysQ ICj0C0/pPOZ+D+qZjHM6K/gKZgR2xbwM9Iq4QyrjyEs2CRs4BrQLkyK9x0AJIyox koubErTsUSz0sJgs9mLfy3BVUrnNGwv0wtcVHA+Q8tNf6kMS10a6pf4AHXVR8kV+ Lqq3FusF4E+QAz8XKogxgFK1+Me5Iz99Rbp7O20EElLXbK/9+d5z+kToHuItH0z2 98W6OsedT/w+f+uqOS7pQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeehgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepudfhkeevvddtueekfeefgfetlefgueegueeltddtieejgeei heevgfehgfdvfeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 May 2022 14:33:04 -0400 (EDT) Message-ID: Date: Wed, 25 May 2022 19:33:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2 02/12] MIPS: GIC: Generate redirect block accessors Content-Language: en-GB To: Dragan Mladjenovic , Thomas Bogendoerfer Cc: Chao-ying Fu , Daniel Lezcano , Geert Uytterhoeven , Greg Ungerer , Hauke Mehrtens , Ilya Lipnitskiy , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Marc Zyngier , Paul Burton , Peter Zijlstra , Serge Semin , Thomas Gleixner , Tiezhu Yang References: <20220525121030.16054-1-Dragan.Mladjenovic@syrmia.com> <20220525121030.16054-3-Dragan.Mladjenovic@syrmia.com> From: Jiaxun Yang In-Reply-To: <20220525121030.16054-3-Dragan.Mladjenovic@syrmia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/5/25 13:10, Dragan Mladjenovic 写道: > From: Paul Burton > > With CM 3.5 the "core-other" register block evolves into the "redirect" > register block, which is capable of accessing not only the core local > registers of other cores but also the shared/global registers of other > clusters. > > This patch generates accessor functions for shared/global registers > accessed via the redirect block, with "redir_" inserted after "gic_" in > their names. For example the accessor function: > > read_gic_config() > > ...accesses the GIC_CONFIG register of the GIC in the local cluster. > With this patch a new function: > > read_gic_redir_config() > > ...is added which accesses the GIC_CONFIG register of the GIC in > whichever cluster the GCR_CL_REDIRECT register is configured to access. > > This mirrors the similar redirect block accessors already provided for > the CM & CPC. > > Signed-off-by: Paul Burton > Signed-off-by: Chao-ying Fu > Signed-off-by: Dragan Mladjenovic Reviewed-by: Jiaxun Yang Checked against I6500 system programming manual. Thanks. - Jiaxun > > diff --git a/arch/mips/include/asm/mips-gic.h b/arch/mips/include/asm/mips-gic.h > index 084cac1c5ea2..fd9da5e3beaa 100644 > --- a/arch/mips/include/asm/mips-gic.h > +++ b/arch/mips/include/asm/mips-gic.h > @@ -28,11 +28,13 @@ extern void __iomem *mips_gic_base; > > /* For read-only shared registers */ > #define GIC_ACCESSOR_RO(sz, off, name) \ > - CPS_ACCESSOR_RO(gic, sz, MIPS_GIC_SHARED_OFS + off, name) > + CPS_ACCESSOR_RO(gic, sz, MIPS_GIC_SHARED_OFS + off, name) \ > + CPS_ACCESSOR_RO(gic, sz, MIPS_GIC_REDIR_OFS + off, redir_##name) > > /* For read-write shared registers */ > #define GIC_ACCESSOR_RW(sz, off, name) \ > - CPS_ACCESSOR_RW(gic, sz, MIPS_GIC_SHARED_OFS + off, name) > + CPS_ACCESSOR_RW(gic, sz, MIPS_GIC_SHARED_OFS + off, name) \ > + CPS_ACCESSOR_RW(gic, sz, MIPS_GIC_REDIR_OFS + off, redir_##name) > > /* For read-only local registers */ > #define GIC_VX_ACCESSOR_RO(sz, off, name) \ > @@ -45,7 +47,7 @@ extern void __iomem *mips_gic_base; > CPS_ACCESSOR_RW(gic, sz, MIPS_GIC_REDIR_OFS + off, vo_##name) > > /* For read-only shared per-interrupt registers */ > -#define GIC_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > +#define _GIC_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > static inline void __iomem *addr_gic_##name(unsigned int intr) \ > { \ > return mips_gic_base + (off) + (intr * (stride)); \ > @@ -58,8 +60,8 @@ static inline unsigned int read_gic_##name(unsigned int intr) \ > } > > /* For read-write shared per-interrupt registers */ > -#define GIC_ACCESSOR_RW_INTR_REG(sz, off, stride, name) \ > - GIC_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > +#define _GIC_ACCESSOR_RW_INTR_REG(sz, off, stride, name) \ > + _GIC_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > \ > static inline void write_gic_##name(unsigned int intr, \ > unsigned int val) \ > @@ -68,22 +70,30 @@ static inline void write_gic_##name(unsigned int intr, \ > __raw_writel(val, addr_gic_##name(intr)); \ > } > > +#define GIC_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > + _GIC_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > + _GIC_ACCESSOR_RO_INTR_REG(sz, MIPS_GIC_REDIR_OFS + off, stride, redir_##name) > + > +#define GIC_ACCESSOR_RW_INTR_REG(sz, off, stride, name) \ > + _GIC_ACCESSOR_RW_INTR_REG(sz, off, stride, name) \ > + _GIC_ACCESSOR_RW_INTR_REG(sz, MIPS_GIC_REDIR_OFS + off, stride, redir_##name) > + > /* For read-only local per-interrupt registers */ > #define GIC_VX_ACCESSOR_RO_INTR_REG(sz, off, stride, name) \ > - GIC_ACCESSOR_RO_INTR_REG(sz, MIPS_GIC_LOCAL_OFS + off, \ > + _GIC_ACCESSOR_RO_INTR_REG(sz, MIPS_GIC_LOCAL_OFS + off, \ > stride, vl_##name) \ > - GIC_ACCESSOR_RO_INTR_REG(sz, MIPS_GIC_REDIR_OFS + off, \ > + _GIC_ACCESSOR_RO_INTR_REG(sz, MIPS_GIC_REDIR_OFS + off, \ > stride, vo_##name) > > /* For read-write local per-interrupt registers */ > #define GIC_VX_ACCESSOR_RW_INTR_REG(sz, off, stride, name) \ > - GIC_ACCESSOR_RW_INTR_REG(sz, MIPS_GIC_LOCAL_OFS + off, \ > + _GIC_ACCESSOR_RW_INTR_REG(sz, MIPS_GIC_LOCAL_OFS + off, \ > stride, vl_##name) \ > - GIC_ACCESSOR_RW_INTR_REG(sz, MIPS_GIC_REDIR_OFS + off, \ > + _GIC_ACCESSOR_RW_INTR_REG(sz, MIPS_GIC_REDIR_OFS + off, \ > stride, vo_##name) > > /* For read-only shared bit-per-interrupt registers */ > -#define GIC_ACCESSOR_RO_INTR_BIT(off, name) \ > +#define _GIC_ACCESSOR_RO_INTR_BIT(off, name) \ > static inline void __iomem *addr_gic_##name(void) \ > { \ > return mips_gic_base + (off); \ > @@ -106,8 +116,8 @@ static inline unsigned int read_gic_##name(unsigned int intr) \ > } > > /* For read-write shared bit-per-interrupt registers */ > -#define GIC_ACCESSOR_RW_INTR_BIT(off, name) \ > - GIC_ACCESSOR_RO_INTR_BIT(off, name) \ > +#define _GIC_ACCESSOR_RW_INTR_BIT(off, name) \ > + _GIC_ACCESSOR_RO_INTR_BIT(off, name) \ > \ > static inline void write_gic_##name(unsigned int intr) \ > { \ > @@ -146,6 +156,14 @@ static inline void change_gic_##name(unsigned int intr, \ > } \ > } > > +#define GIC_ACCESSOR_RO_INTR_BIT(off, name) \ > + _GIC_ACCESSOR_RO_INTR_BIT(off, name) \ > + _GIC_ACCESSOR_RO_INTR_BIT(MIPS_GIC_REDIR_OFS + off, redir_##name) > + > +#define GIC_ACCESSOR_RW_INTR_BIT(off, name) \ > + _GIC_ACCESSOR_RW_INTR_BIT(off, name) \ > + _GIC_ACCESSOR_RW_INTR_BIT(MIPS_GIC_REDIR_OFS + off, redir_##name) > + > /* For read-only local bit-per-interrupt registers */ > #define GIC_VX_ACCESSOR_RO_INTR_BIT(sz, off, name) \ > GIC_ACCESSOR_RO_INTR_BIT(sz, MIPS_GIC_LOCAL_OFS + off, \ > @@ -155,10 +173,10 @@ static inline void change_gic_##name(unsigned int intr, \ > > /* For read-write local bit-per-interrupt registers */ > #define GIC_VX_ACCESSOR_RW_INTR_BIT(sz, off, name) \ > - GIC_ACCESSOR_RW_INTR_BIT(sz, MIPS_GIC_LOCAL_OFS + off, \ > - vl_##name) \ > - GIC_ACCESSOR_RW_INTR_BIT(sz, MIPS_GIC_REDIR_OFS + off, \ > - vo_##name) > + _GIC_ACCESSOR_RW_INTR_BIT(sz, MIPS_GIC_LOCAL_OFS + off, \ > + vl_##name) \ > + _GIC_ACCESSOR_RW_INTR_BIT(sz, MIPS_GIC_REDIR_OFS + off, \ > + vo_##name) > > /* GIC_SH_CONFIG - Information about the GIC configuration */ > GIC_ACCESSOR_RW(32, 0x000, config)