From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F599E95A67 for ; Sun, 8 Oct 2023 21:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QU/F5TnQ2C6/1QB6H+++G4ijZbDZJDSpBVJB6Q+CjcI=; b=BRidoCpb3xBRGx hLmS5InnrGI7LYx2256BZT2PasPlEfdVBiDA+N4KAotBxXQA7+T9Q6MkHfsNcMIfeqtH+cO7zw1c4 bL2ZtuSy/3RiQNKdUHQi1VrZ98ELimte/dHEhlgkz/s5f4NriR/dBJ6X3LA+pbhb4R9FDr5ZidcFU EQU4VOk7AM0xG5zfuMPBahqGbDyouAHWV9MDOnz9WPRDkNnHNapLdJxO2178EPy6GS87Faigjpjhh dFqnjz1lHFclON4NM4MJUpl3zsgLecZdRPyBiE1odIR7wwhS8NeohRSXQtR236uzcmJKkGcmFKWAB BGeG78M4o7LrR7nz9U1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qpbmM-009N5P-1y; Sun, 08 Oct 2023 21:57:38 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qpbmE-009N32-0M; Sun, 08 Oct 2023 21:57:31 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 71C3BCE0B7E; Sun, 8 Oct 2023 21:57:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F1A4C433C7; Sun, 8 Oct 2023 21:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696802244; bh=D6g+fHkvWXqT9fQPLmLkAurQi+eFTlkTGLEB1/+HK5o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=U79ADZLI5HNnhwsw/3rhB0wj0GDu3gACikHFAm3MkH2IJ41zjXOtmFEDZD9zsjR1C P+4nRa4+TMWPbwkMFMwEonwk2wd7sUVhQjYMbADGticlmDi4Wl0OP1VWv0hMbWGyfd Q/ioCBkWxvDRIdatsQ6K5gtlIUgXgMzq3uPSq2f/Ga+unVPqews/DIkp0/3FBKijgN lPypN27ujCPn4c13dUFV500lKjXw/PyBHHmgdQaHggB9p7dGlIyOheVxrz6fbIJMcI V4e0RsbKB2/U6PSUADLDYscdQR1lfJFpXFJ/Ff3WnsT37yqAQmVIWLv2qyxyXlX+fV LjFTzBOX1He7g== Message-ID: <8c97db33-ee83-6f2c-cc5a-00c185e35770@kernel.org> Date: Mon, 9 Oct 2023 06:57:19 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v7 17/26] PM / devfreq: rockchip-dfi: make register stride SoC specific Content-Language: en-US To: Sascha Hauer , linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pengutronix.de, Michael Riesch , Robin Murphy , Vincent Legoll , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, Sebastian Reichel , Jonathan Cameron References: <20230704093242.583575-1-s.hauer@pengutronix.de> <20230704093242.583575-18-s.hauer@pengutronix.de> From: Chanwoo Choi In-Reply-To: <20230704093242.583575-18-s.hauer@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231008_145730_493022_08EF4078 X-CRM114-Status: GOOD ( 21.59 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 23. 7. 4. 18:32, Sascha Hauer wrote: > The currently supported RK3399 has a stride of 20 between the channel > specific registers. Upcoming RK3588 has a different stride, so put > the stride into driver data to make it configurable. > While at it convert decimal 20 to hex 0x14 for consistency with RK3588 > which has a register stride 0x4000 and we want to write that in hex > as well. > > Reviewed-by: Jonathan Cameron > Reviewed-by: Sebastian Reichel > Signed-off-by: Sascha Hauer > --- > drivers/devfreq/event/rockchip-dfi.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c > index 969b62f071b83..85ec93fd41858 100644 > --- a/drivers/devfreq/event/rockchip-dfi.c > +++ b/drivers/devfreq/event/rockchip-dfi.c > @@ -112,6 +112,7 @@ struct rockchip_dfi { > int active_events; > int burst_len; > int buswidth[DMC_MAX_CHANNELS]; > + int ddrmon_stride; > }; > > static int rockchip_dfi_enable(struct rockchip_dfi *dfi) > @@ -189,13 +190,13 @@ static void rockchip_dfi_read_counters(struct rockchip_dfi *dfi, struct dmc_coun > if (!(dfi->channel_mask & BIT(i))) > continue; > c->c[i].read_access = readl_relaxed(dfi_regs + > - DDRMON_CH0_RD_NUM + i * 20); > + DDRMON_CH0_RD_NUM + i * dfi->ddrmon_stride); > c->c[i].write_access = readl_relaxed(dfi_regs + > - DDRMON_CH0_WR_NUM + i * 20); > + DDRMON_CH0_WR_NUM + i * dfi->ddrmon_stride); > c->c[i].access = readl_relaxed(dfi_regs + > - DDRMON_CH0_DFI_ACCESS_NUM + i * 20); > + DDRMON_CH0_DFI_ACCESS_NUM + i * dfi->ddrmon_stride); > c->c[i].clock_cycles = readl_relaxed(dfi_regs + > - DDRMON_CH0_COUNT_NUM + i * 20); > + DDRMON_CH0_COUNT_NUM + i * dfi->ddrmon_stride); Before this path, rk3399 and rk3568 have used the same stride. But, this patch add the ddrmon_stride for only rk3399. It seems that the behavior of rk3568 is changed. If ddrmon_stride is not required for rk3568, you must move this patch before adding rk3568 support patch ("PM / devfreq: rockchip-dfi: Add RK3568 support"). > } > } > > @@ -664,6 +665,8 @@ static int rk3399_dfi_init(struct rockchip_dfi *dfi) > dfi->buswidth[0] = FIELD_GET(RK3399_PMUGRF_OS_REG2_BW_CH0, val) == 0 ? 4 : 2; > dfi->buswidth[1] = FIELD_GET(RK3399_PMUGRF_OS_REG2_BW_CH1, val) == 0 ? 4 : 2; > > + dfi->ddrmon_stride = 0x14; > + > return 0; > }; > -- Best Regards, Samsung Electronics Chanwoo Choi _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip