From patchwork Tue Nov 19 13:29:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13879911 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 0BF8AD44157 for ; Tue, 19 Nov 2024 13:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=heKbr9O2GKx5xLAYwPcBI72bkFwvVK0SwD6u81KEJCg=; b=j/5jesKGPF3Fi/5OedbKqBltLv GBwJC7WZ6bLuNojgbUrEdVYK6gbewZXJEaIUWcWJLakVjXFQ/VlX8DzXQLTfaoVu+lm/eu2+Ca6wA f2q/Ny9W0isKX/DLmSs1vhnftu+Mqe6yQHhX1gQJyCZBhywjCOMV9pXkkvEwdOkA0AiKDNf+ZjJbJ 6Dco1cHyhXuX2Hf2zzu7YH2dUut9E+bZBM7FqYTRs1LLXpFdv1xMHWesorAviUp5oE89Bhpg23fdx 0UOi+1kBPYot9kChIjA5hfs1IIbIkJga1D3DTrnBMLLUKkp/9H41kDKH1wdKUWonfSO4eNf9b6d7C 6DhARfqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDOLc-0000000CWIf-2k53; Tue, 19 Nov 2024 13:32:52 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDOIr-0000000CVcB-1UTY; Tue, 19 Nov 2024 13:30:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=heKbr9O2GKx5xLAYwPcBI72bkFwvVK0SwD6u81KEJCg=; b=gp1pAgKw78BBuGpxs/OTpQ/ciL KGYM30VM9wWnXMmSnqom84K92HtJ0ndUA9SJWLx908DkSCPhhxDjBBMoAlEbLOWHS9d3uq0EMQfNB ffDjTcjAMQEg2e2jtWKRUrC5QuNNh5D9xY63iUElj7Yczx1UBszoLILJ741LPwHcGA2lnli8Tx7F4 IDAc3qn5dV6+yKcCoQOythUqhKY+o/l4Mxr59ow7XsFS0B1wYXG9ZCb106Rb0JAxrbBOg8ec/e9MH 9udfg63N2JQuqkL8AYvUFYgn7L79OX/QCU9tfQYKOS0XMWs8NgDQ4iUp4WtjoGhIYfmoU4aMIZDer E6PBdXlg==; Received: from i53875a30.versanet.de ([83.135.90.48] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDOIn-0006z1-Dv; Tue, 19 Nov 2024 14:29:57 +0100 From: Heiko Stuebner To: srinivas.kandagatla@linaro.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, detlev.casanova@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, sebastian.reichel@collabora.com Subject: [PATCH 1/5] clk: rockchip: rk3576: define clk_otp_phy_g Date: Tue, 19 Nov 2024 14:29:12 +0100 Message-ID: <20241119132916.1057797-2-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119132916.1057797-1-heiko@sntech.de> References: <20241119132916.1057797-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_053001_421072_9F902B5B X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The phy clock of the OTP block is also present, but was not defined so far. Though its clk-id already existed, so just define its location. Signed-off-by: Heiko Stuebner --- drivers/clk/rockchip/clk-rk3576.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/rockchip/clk-rk3576.c b/drivers/clk/rockchip/clk-rk3576.c index 595e010341f7..029939a98416 100644 --- a/drivers/clk/rockchip/clk-rk3576.c +++ b/drivers/clk/rockchip/clk-rk3576.c @@ -541,6 +541,8 @@ static struct rockchip_clk_branch rk3576_clk_branches[] __initdata = { RK3576_CLKGATE_CON(5), 14, GFLAGS), GATE(CLK_OTPC_AUTO_RD_G, "clk_otpc_auto_rd_g", "xin24m", 0, RK3576_CLKGATE_CON(5), 15, GFLAGS), + GATE(CLK_OTP_PHY_G, "clk_otp_phy_g", "xin24m", 0, + RK3588_CLKGATE_CON(6), 0, GFLAGS), COMPOSITE(CLK_MIPI_CAMERAOUT_M0, "clk_mipi_cameraout_m0", mux_24m_spll_gpll_cpll_p, 0, RK3576_CLKSEL_CON(38), 8, 2, MFLAGS, 0, 8, DFLAGS, RK3576_CLKGATE_CON(6), 3, GFLAGS), From patchwork Tue Nov 19 13:29:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13879909 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 D323BD44157 for ; Tue, 19 Nov 2024 13:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+UKNcQIuo4FZ8hxEao64XciZrGRc+1MsKNkIDwCCJxM=; b=lZSbwKu8DK9dxR8o3nWuYpmsaF UDCFF2VoWScv4Mh3e0n/gZ8FW9hXMGmya2D0dURfWjFmQfIseB7HNoPrX11TKnnXkWVZGwaFO+wrF jjys6CZy85sKBRGPT0NptwjjWToDqg0yAxav9zy+Rv+7E10oYVjYD5Frcifa4nSH1AAGuTwzL28Wd Z7nItmXQ2+GutvFV0HhqiXTu1NlXCPHLhYNY5EWE23P5ci5ol+jiVVWersKQjj+aZ/SRJnNrBJ7km 2/ikxAW4yEKDh9139722xnWUM9G4bA1bsXk8bAmdcz6ZP5PD+5s/UuErXeef7Jetc3ifyVmEPCL8U b/dY3Juw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDOJn-0000000CVod-1yub; Tue, 19 Nov 2024 13:30:59 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDOIr-0000000CVcE-1GjC; Tue, 19 Nov 2024 13:30:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+UKNcQIuo4FZ8hxEao64XciZrGRc+1MsKNkIDwCCJxM=; b=r3Bs4ypdJP+mBkMHoea9Fg4XJV dJxNSut5tgxSYfCPlY/Fporh7OKiz4iHxa2VkGYuP5ayzzOrJTffwWrs45zmX3vbHhJ8aEh1o/+uP 6r3itTHRmryFSWU4F8DxRxWJSpUGftfRW517zIEh4nCN+caSyhEF4DHqZjQSKiPQ9JITvEBZYrtdT 49XD/7YEhPZLawfvDlnIhYq+JuMO9QFz/4+GZJxaTtxLkoJvVrf7uKXaer8Tv052CqJAaaKZIRhnd p/n4Ft1Ul1YpjLTsFTSd0C0FYITt91w3gCQMJhegr2cqRZqB5wLgepJTczU7O8KU3of6IiktSjtBp G0YwrBvw==; Received: from i53875a30.versanet.de ([83.135.90.48] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDOIn-0006z1-Uu; Tue, 19 Nov 2024 14:29:58 +0100 From: Heiko Stuebner To: srinivas.kandagatla@linaro.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, detlev.casanova@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, sebastian.reichel@collabora.com Subject: [PATCH 2/5] nvmem: rockchip-otp: Move read-offset into variant-data Date: Tue, 19 Nov 2024 14:29:13 +0100 Message-ID: <20241119132916.1057797-3-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119132916.1057797-1-heiko@sntech.de> References: <20241119132916.1057797-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_053001_377729_33EF9231 X-CRM114-Status: GOOD ( 16.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 ebc3f0b24166..3edfbfc2d722 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, From patchwork Tue Nov 19 13:29:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13879912 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 43163D44157 for ; Tue, 19 Nov 2024 13:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ai2f0tah5jxeBFbms+6cTIy86wh/DEb+Zml1HlpGnbU=; b=BxzrHNmeEzyatOIXBJMJ3hpLx5 OeldizAJPZ7C63PV77a98ZKHAUm2MrktLBFfBgq3SraLoJBXO8e7LTalZHap/loYQ6IiMXLKUShpa XY8wb4/rrGdchQj+1sd/qNFBpOpL/3OHxkUJWlT3WJoV32oyU/RCl4hm/rJaR6UddpqA0W2MtxHZz NQ9BMiVtb+E/B7fWKRnu/mEzjbiF7Zy9/q1sqnPRqWD6+88ZjdNRLMarO5xlucwlPlcGOw1nOejlT VwshmGawuZWNRpKbzKOyZOhjKk8jEnkdIqSvhEKFkBv3RDh2kudqbakVtybhr+mSuCCyD7XSPoDTl huFB+IPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDOMW-0000000CWVm-2qRr; Tue, 19 Nov 2024 13:33:48 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDOIr-0000000CVcF-2NdD; Tue, 19 Nov 2024 13:30:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ai2f0tah5jxeBFbms+6cTIy86wh/DEb+Zml1HlpGnbU=; b=K+lv0vqFGN2jXni4MeYTVKJO70 Sr6nk71LUV1RXmyQcg5zOyNf/0G9eayXPZzCxtgd0K09d/yj2/Oz0ZFPCVy2bZms8RqHMnjG41z9K iOo4LugCcZd6mq/PdzW85UJ+/PYIpC77+NnNmayNwbFAxcZgfeOYruQfYPBA3W61xx8Xo4wQNRy3c lM7kTySi7xu7UL6pr5Cwfq8uYJtO2F4PfRGYjz3dWPISiXdVit676hQ5kRgww5Im+b30CQDR1tohj HhTYhzGSB/W7TeRNZmc12eruunTu4/EoOW2qcM4LijtpKvg7PeQPGP9tVILHDif9X2W3XdfxK0L10 V8GBzhlA==; Received: from i53875a30.versanet.de ([83.135.90.48] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDOIo-0006z1-Fu; Tue, 19 Nov 2024 14:29:58 +0100 From: Heiko Stuebner To: srinivas.kandagatla@linaro.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, detlev.casanova@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, sebastian.reichel@collabora.com Subject: [PATCH 3/5] dt-bindings: nvmem: rockchip,otp: Add compatible for RK3576 Date: Tue, 19 Nov 2024 14:29:14 +0100 Message-ID: <20241119132916.1057797-4-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119132916.1057797-1-heiko@sntech.de> References: <20241119132916.1057797-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_053001_606900_9B0ED06A X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document the OTP memory found on Rockchip RK3576 SoC. The RK3576 uses the same set of clocks as the px30/rk3308 but has one reset more, so adapt the binding to handle this variant as well. Signed-off-by: Heiko Stuebner --- .../bindings/nvmem/rockchip,otp.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml index a44d44b32809..dae7543a0179 100644 --- a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml +++ b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml @@ -14,6 +14,7 @@ properties: enum: - rockchip,px30-otp - rockchip,rk3308-otp + - rockchip,rk3576-otp - rockchip,rk3588-otp reg: @@ -68,6 +69,23 @@ allOf: items: - const: phy + - if: + properties: + compatible: + contains: + enum: + - rockchip,rk3576-otp + then: + properties: + clocks: + minItems: 3 + resets: + minItems: 2 + reset-names: + items: + - const: otp + - const: apb + - if: properties: compatible: From patchwork Tue Nov 19 13:29:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13879924 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 3B571D44157 for ; Tue, 19 Nov 2024 13:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BEPLXOAQeugFgDKChVlT8VIgkLIi/DDxz/mYsa3wLfQ=; b=fg9dLydplhNic7ItH5IpFBp74F VMIMKpYQSWGOFUBBmn4B5TKPOuhjSgF5NTJK1mcAzffCKdlgO1DjAdDF3LmU1tGc8bM4qWaFzKGl/ QcgsDMdcwl6oAvNnVm0G0f6WBLo6Q87T68pdyOhejekHJM0aIbA0Tun5x7tDwF9pSWZdZKHRhzG1i 8MpuPQm51DPQJFfR2L3WRmVfy4jjYwfrzLQZZ0VxvR7qWC6QBlvSBZfzfdd0i82CG/fxtsWmedHRx ZU1Wvmf/lXVl6BGm/D/4S4CM1KWDoyQ4rBOjQMNYBVEY6zK+kk/eina+pZeAczejdZTPNSUI5VLju 5S91ZVIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDOOK-0000000CWmw-42HF; Tue, 19 Nov 2024 13:35:40 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDOIs-0000000CVcG-0i9o; Tue, 19 Nov 2024 13:30:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BEPLXOAQeugFgDKChVlT8VIgkLIi/DDxz/mYsa3wLfQ=; b=F5lQ5yigIzEZ8qRRmX5lvzMcWc yvBRTNsDD9j6GgWwKM186+eSV4S4TQ6AAIHIuyCuG4leCwOSIGyqRdCANxRp4bGI9+lNebfQ32gjl z340XFkZU1p56vLLHZN3BNo4GaeD2LA2EAskVS5LbniUuiKk7na1wNP5SV+1+ZRPACigRRNTsInau QsllgZa78IjqChyFL3VdGRMUqkrOyZcKNgXUYkVzjkRMWy3ajjYI+OEO7mX988ztJQSdH6MLvi1VL 8OT5I0tWY8OJ59dpO4KI1HPBy1VAzJujVVT0gPbyx/ldT71fldldtw/tpagd9Q+mfj2NaVAtsgdzW Uubfkl6A==; Received: from i53875a30.versanet.de ([83.135.90.48] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDOIo-0006z1-W7; Tue, 19 Nov 2024 14:29:59 +0100 From: Heiko Stuebner To: srinivas.kandagatla@linaro.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, detlev.casanova@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, sebastian.reichel@collabora.com Subject: [PATCH 4/5] nvmem: rockchip-otp: add rk3576 variant data Date: Tue, 19 Nov 2024 14:29:15 +0100 Message-ID: <20241119132916.1057797-5-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119132916.1057797-1-heiko@sntech.de> References: <20241119132916.1057797-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_053002_220203_E7301282 X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The variant works very similar to the rk3588, just with a different read-offset and size. Signed-off-by: Heiko Stuebner --- drivers/nvmem/rockchip-otp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c index 3edfbfc2d722..d88f12c53242 100644 --- a/drivers/nvmem/rockchip-otp.c +++ b/drivers/nvmem/rockchip-otp.c @@ -274,6 +274,14 @@ static const struct rockchip_data px30_data = { .reg_read = px30_otp_read, }; +static const struct rockchip_data rk3576_data = { + .size = 0x100, + .read_offset = 0x700, + .clks = px30_otp_clocks, + .num_clks = ARRAY_SIZE(px30_otp_clocks), + .reg_read = rk3588_otp_read, +}; + static const char * const rk3588_otp_clocks[] = { "otp", "apb_pclk", "phy", "arb", }; @@ -295,6 +303,10 @@ static const struct of_device_id rockchip_otp_match[] = { .compatible = "rockchip,rk3308-otp", .data = &px30_data, }, + { + .compatible = "rockchip,rk3576-otp", + .data = &rk3576_data, + }, { .compatible = "rockchip,rk3588-otp", .data = &rk3588_data, From patchwork Tue Nov 19 13:29:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13879923 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 4CD18D4415E for ; Tue, 19 Nov 2024 13:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m/2ZD36wJW8eluwjHkCBxTv9qiyzz866KACmcI1qvBI=; b=epBC+KiIr3F66ni0hvZ08Xw3ga qsUt6qPmOFsdzXi996GvK+jhRz2uXAU1FDvBcdczV5CNGWt2dVw3KMTgu63q0MqFI2/W1N1sCPGGk 2cQhipUjLLkMq4YYATkqZspmi8pzL5JqfvQk3hf46cxLXR/rs+4oBETCzaDSCD1vXKEB9nyQ1Ep1r +epHcI+hSZNQQgLE2oq3kDZPhqxa7LtQl+ucePD/VBRMauSRArzsIOAHTz+BVlJEw09t7XTa+rowp Gpl2IBI5LMCooZQMD9tJVchCLTggPz//roz75kt4dj0zyjzvgONC5F63dmXWFdDDvuBtcksqedZB2 yoZMVjzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDONR-0000000CWf7-1XVv; Tue, 19 Nov 2024 13:34:45 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDOIr-0000000CVcJ-1v82; Tue, 19 Nov 2024 13:30:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=m/2ZD36wJW8eluwjHkCBxTv9qiyzz866KACmcI1qvBI=; b=imSx+KhdtyMNcGkm3iyHvcyggu EMyEs4Jr8bF2o8lQtJU7npMjZB1euyc8RWkEbplSBlaQrgOQ+7XvxmyvwE2RU1/+k6UkRWsA4PHC7 kisi8cYA1WCEP88uiw2mGPLs4SGCNN2FLbmWLoNfH7RrYPTGQ3p+bcWyvPLTsXVlgE6S7g9H+2C1d K9Yo8/Uh1RG1lu4K41gYl6yM8/PpOB4+jmpYrz411M7+utDHh0/yfwSlgM5H+2slnpAlBTJEJ8jh4 Nx0sf5FRfWEO7DEWXN/VaLttUVw+bQdfJXHAX9FrkedFrxdhbLK6HydZIGmtPGGRlF0TcYeupOdOO IT56mhew==; Received: from i53875a30.versanet.de ([83.135.90.48] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDOIp-0006z1-Gn; Tue, 19 Nov 2024 14:29:59 +0100 From: Heiko Stuebner To: srinivas.kandagatla@linaro.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, detlev.casanova@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, sebastian.reichel@collabora.com Subject: [PATCH 5/5] arm64: dts: rockchip: add rk3576 otp node Date: Tue, 19 Nov 2024 14:29:16 +0100 Message-ID: <20241119132916.1057797-6-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119132916.1057797-1-heiko@sntech.de> References: <20241119132916.1057797-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_053001_530775_24E04935 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds the otp node to the rk3576 soc devicetree including the individual fields we know about. Signed-off-by: Heiko Stuebner --- arch/arm64/boot/dts/rockchip/rk3576.dtsi | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts/rockchip/rk3576.dtsi index 436232ffe4d1..c70c9dcfad82 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi @@ -1149,6 +1149,45 @@ sdhci: mmc@2a330000 { status = "disabled"; }; + otp: otp@2a580000 { + compatible = "rockchip,rk3576-otp"; + reg = <0x0 0x2a580000 0x0 0x400>; + #address-cells = <1>; + #size-cells = <1>; + clocks = <&cru CLK_OTPC_NS>, <&cru PCLK_OTPC_NS>, + <&cru CLK_OTP_PHY_G>; + clock-names = "otp", "apb_pclk", "phy"; + resets = <&cru SRST_OTPC_NS>, <&cru SRST_P_OTPC_NS>; + reset-names = "otp", "apb"; + + /* Data cells */ + cpu_code: cpu-code@2 { + reg = <0x02 0x2>; + }; + otp_cpu_version: cpu-version@5 { + reg = <0x05 0x1>; + bits = <3 3>; + }; + otp_id: id@a { + reg = <0x0a 0x10>; + }; + cpub_leakage: cpub-leakage@1e { + reg = <0x1e 0x1>; + }; + cpul_leakage: cpul-leakage@1f { + reg = <0x1f 0x1>; + }; + npu_leakage: npu-leakage@20 { + reg = <0x20 0x1>; + }; + gpu_leakage: gpu-leakage@21 { + reg = <0x21 0x1>; + }; + log_leakage: log-leakage@22 { + reg = <0x22 0x1>; + }; + }; + gic: interrupt-controller@2a701000 { compatible = "arm,gic-400"; reg = <0x0 0x2a701000 0 0x10000>,