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 A448DC369DC for ; Tue, 29 Apr 2025 23:56:19 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/Jg1TuBpM5dj+B91gqI8xYglUPI/eAGw2o+E3snzhFQ=; b=Wo/1OVK2ErvLq0 Il0PSqfkXxpBprDXtZCIzoDnqSxpwZ9mpW5v1uO+rOTNBXhb79B1yWM4DthkuDetVtiJ72x4mDr0r +0NoNVphD9I4U5tWckpiTL/SMT/I/AuD0V2OikjeS/IN351RnPf6LN7oMf0xLaL43gwpJQ66zok9g /fVtKoJ12vgvJapJjWIYUeBdoGg9KcxhZ0kBEQNB4fDryjRsjUiBhjkD870JjZoHJsGpPq9xe0BbH zVzVt5Lo9yWCl5caj1QOlChznNif+7fid1/TysIZHpXWpMbxEwdZ5cNTF/aaSgNRWnDibxR4obsru rTrfO4mseHNobK6XwhUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u9uoA-0000000BB9a-2sP2; Tue, 29 Apr 2025 23:56:14 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u9ujb-0000000BA3u-3dKa; Tue, 29 Apr 2025 23:51:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 611D1A4C35F; Tue, 29 Apr 2025 23:46:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EFCFC4CEEB; Tue, 29 Apr 2025 23:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745970690; bh=voo/0fCvIhLMHf88zqX/e7QC57lFb1Bp8RSTAegByJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3k1MQ1BWQYtjcnI5XK89AzPEShVAw2IMSL2f9PRdksC0IPH9GF+0sA6CCnJ6RSsI YdyItK7WGxwG7NddKsqk9Yo1MuXf10RHCWqp/GnSQZPr0rQBzSh3c02Hs6CBO8s5ki 8Uz/oVwDAFVvPx7Ca9y+rmfCt4LIU8xZUyXsM+LW3xvKaQzAi3DiuntWJvmOCG1C6H P8FXIbcsfT3gvAwQZoMp9qPHqm+G91kh2vdZ3F32dK0+mMJGZIqb547faG8EP1V1EM izHHFIHQ69BUh5Fuu+ezTnJ2Hsn+wOQdhorvA9mqdgK+c7q+l2MPzbLGmQl/NPPxxA pfXz5H74r+1YQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.12 03/37] nvmem: rockchip-otp: Move read-offset into variant-data Date: Tue, 29 Apr 2025 19:50:48 -0400 Message-Id: <20250429235122.537321-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250429235122.537321-1-sashal@kernel.org> References: <20250429235122.537321-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.25 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250429_165131_960500_E72C235C X-CRM114-Status: GOOD ( 14.97 ) 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: , Cc: Sasha Levin , Heiko Stuebner , Greg Kroah-Hartman , linux-rockchip@lists.infradead.org, Srinivas Kandagatla , srini@kernel.org, linux-arm-kernel@lists.infradead.org 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 From: Heiko Stuebner [ Upstream commit 6907e8093b3070d877ee607e5ceede60cfd08bde ] The RK3588 has an offset into the OTP area where the readable area begins and automatically adds this to the start address. Other variants are very much similar to rk3588, just with a different offset, so move that value into variant-data. To match the size in bytes, store this value also in bytes and not in number of blocks. Signed-off-by: Heiko Stuebner Tested-by: Nicolas Frattaroli Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20250411112251.68002-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/nvmem/rockchip-otp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c index ebc3f0b24166b..3edfbfc2d7220 100644 --- a/drivers/nvmem/rockchip-otp.c +++ b/drivers/nvmem/rockchip-otp.c @@ -59,7 +59,6 @@ #define RK3588_OTPC_AUTO_EN 0x08 #define RK3588_OTPC_INT_ST 0x84 #define RK3588_OTPC_DOUT0 0x20 -#define RK3588_NO_SECURE_OFFSET 0x300 #define RK3588_NBYTES 4 #define RK3588_BURST_NUM 1 #define RK3588_BURST_SHIFT 8 @@ -69,6 +68,7 @@ struct rockchip_data { int size; + int read_offset; const char * const *clks; int num_clks; nvmem_reg_read_t reg_read; @@ -196,7 +196,7 @@ static int rk3588_otp_read(void *context, unsigned int offset, addr_start = round_down(offset, RK3588_NBYTES) / RK3588_NBYTES; addr_end = round_up(offset + bytes, RK3588_NBYTES) / RK3588_NBYTES; addr_len = addr_end - addr_start; - addr_start += RK3588_NO_SECURE_OFFSET; + addr_start += otp->data->read_offset / RK3588_NBYTES; buf = kzalloc(array_size(addr_len, RK3588_NBYTES), GFP_KERNEL); if (!buf) @@ -280,6 +280,7 @@ static const char * const rk3588_otp_clocks[] = { static const struct rockchip_data rk3588_data = { .size = 0x400, + .read_offset = 0xc00, .clks = rk3588_otp_clocks, .num_clks = ARRAY_SIZE(rk3588_otp_clocks), .reg_read = rk3588_otp_read, -- 2.39.5 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip