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: 13879915 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F4F01CC163; Tue, 19 Nov 2024 13:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023012; cv=none; b=PTwSEMBsPl9zKqOHWy/smlidxzfE+srQLAzI0X2yj/DwBzx/djV+i7LPS7OU0zne9sJEvZ4oQT0V2hvOVTQ2CmGry+RvdLbHH1vhmVS9/GUBWxcapCCbtAS29+z3ZNOHZnGXG31HFIb34nyqfxU+J7PJHp5tp1X3bM9eUEFB8t0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023012; c=relaxed/simple; bh=OHaWP2CncpzzNuPG2amgndlMmmPI6sxu0hEoPCpaMj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oYVsP1cxSSgidxvnbevJ4aAX/6ZwxLWXTXHKexvNcWKIzBbXDQS5YbshE7iBqC0j+PoyUPVEI9vIvSwER1tD2ZmKTlDoOsTkNTAZXQr4en+hO5+uDwB7IaMpWoXSAhnf/nWyXpXA2llPnxnm7wVuS+ro/3HH0+1d3xhVcTETr7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=gp1pAgKw; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="gp1pAgKw" 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13879913 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EF3F54673; Tue, 19 Nov 2024 13:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023011; cv=none; b=TJYLIPmzewQCSXu7tXEXvhyh4HZOu0fqE+kbbWwyrPz/At7CP4r3+dHe4Dm//QXP8KdkGGR8M8OCwh8Q5UV7/QwYXI6OSxX4Q5YP1tLHY2uCew9Zr80V26URyAbddKCZBx+WCKao3MvHohSwWUeVmECWuHDxwKfFS4FIjW2aUSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023011; c=relaxed/simple; bh=d7gluzyAtUbNcVMFKVBZRhrjN1dG9oix3YuC0/L7+XU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a20FR6dY7TzsmJuBfzt5dStKGY1o3FyOKbsoSrLDpnF3rzuB5s6pVKUOpqm7cGRlyOnNejUFNMSPatAoy6hgOSMw2+s8gigWG7XEivYbQOJiq2FH5pYYwl/qZg9EIpxsbD2GI+Dhz9Pm0cul+KmRw10eLf6zXyAFxEtNEbVfKYw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=r3Bs4ypd; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="r3Bs4ypd" 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13879916 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 236011CC8A7; Tue, 19 Nov 2024 13:30:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023012; cv=none; b=spJTx2xnO7fpWJ+IWoHqvaFIEFcnlKB7aBYyB81QFHvP04668Ybpw/oEfwVKkn7mtOT1ei8vZZ0VG2OK56igIzcix+utbNkUg+WSh+Zx1ZEBl0sksZ2jYfIUXdCR31pvgyZhTQRi01dXggRUiCl/9a89/+9FyDT9Mggt6DMwh/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023012; c=relaxed/simple; bh=bU1STWlMKKDnOk0Ie0JO+uGCF8fcq5OCHyUWEDXwAWI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cxli00GGFQdcpnBhwrNN8AnPDNT5FnLDKB/TSif5wRNtIWpKZL4R1K8V4FotdLSJbXklUJikzuhZnohdRF27oaxNzCsH++2BRFxnUehPFl4QxWyJMUCUmERi6nCiWH+QMhBCgzDbIs7eBtl1Z4cXIA3TILUy+X2FpYDUqUIirnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=K+lv0vqF; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="K+lv0vqF" 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13879918 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2503F1CC8B7; Tue, 19 Nov 2024 13:30:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023014; cv=none; b=ldsGmbYnuKq1gUV7wQt0UF9C2yq5mnlU7U9xT9ciQGFo6BYgO1MMkgdqSEa76PKTtGjOeXka8CLubLOmSJ9hRJe7yKaqNVfd98wpReEfohbPD4a8blLAIF21QIPI8ZcXmU8JU6xVrCpiCI0r575ElEsIRGoJpC52eAo7G+7E3rI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023014; c=relaxed/simple; bh=xs0ilAFLu5mMTVLv0Wr9QhBYhfKjyOlTFHk348dBkz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UdbOFPFa6fzZsXLytw+oQDHv0D9GHnQunLbNuHRHuyiDpLaGAnVFAzw/d9dAhUC2CPiyBSfQwIwMCKRFrpuyzC9fd8FYDjKsoeNR0gjgRrhprJjqJiKV9mW+3yf/yFmPU1Qcoa4at/IAfdfaiJT3sZSJKXq1z4LXB3Iotve3drg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=F5lQ5yig; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="F5lQ5yig" 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13879917 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2123E1CC170; Tue, 19 Nov 2024 13:30:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023013; cv=none; b=gp0Hm/pwKUOmUv8U8WByemsR+XGoEDwLtl/nqK6qyS/iUxgovRnusQcBLILMEsziPll/2CAtkV31iGeckPfHRiX9BwVZNcuG5gp+SRoKN2XkvRIl6Kt4zudGk/Pb+hsavEbn2Lgoc6HNL3wsPveeVT7juQeXbWC1xSr7ln7ie/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732023013; c=relaxed/simple; bh=b+L9qbqGVR11JrLNz1yjtill0U5wtaM7q9wIn2S8mnw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DmLM50KKnwhaGcLvzd5kTj2hReXRB4bRVgklwwdRIJfzlENEjdXDcoRw8wIlAipq23kCTeg0388oukedHrSrJSFvxzksZBrLFjQqPYzMJ/NAPztLR9BK2ug6L9rEG6x+plSkwVesNW9g8ABZjso42SfP+oMoUItbfoh68s8ro+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=imSx+Khd; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="imSx+Khd" 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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>,