From patchwork Fri Nov 17 14:33:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 166203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp571102vqn; Fri, 17 Nov 2023 06:34:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/JP5zAAvb1gGXA/xMJr+GoBT0H9pODakWy0O8y3pBu6CiO5CKSOFAjz8eRm3qA3jzmJjd X-Received: by 2002:a05:6e02:1c0b:b0:357:3d32:bf76 with SMTP id l11-20020a056e021c0b00b003573d32bf76mr25361005ilh.1.1700231687772; Fri, 17 Nov 2023 06:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700231687; cv=none; d=google.com; s=arc-20160816; b=VhQDeh+Mv1TLQb7Cj4/Oeg7V3y5105xAT+E4x1lQODusZuB/mvDV8ctNqDGeZpCK5g Fkh7RZjciuVnyQuPr4jTozs1mrbttqIEEShdYbWsHq+fTDEga8hJyQyZCwlvTkgFK7Oe gsN0DnJQ4jIFASh6cGHSndRqCFIBopY6lwJjnLu/yxvHCDILYR99aR9ZM3rhCeJk5lZP lN7qr8sxQcpk0kL+tS24hIeGPfVS7DQoQX93tyl0nns3if8zT7tSW8ItMUivQ0eYcFtj pu9AXI41/q9vx4JXx3kxiOALSoZwg/QFaV6mMBs18gwdYruoqEojZdXliQF0NwU5VJC0 ZH4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X7vC/oh1sqsCBQ9A3jJscHwCqNijqttGlrrT0QsvOmc=; fh=ErbdN4yRmJxmqa54npRVAnyAONXRdPYfhjutrUtAxi8=; b=JzYWvnuB8TgyS/eYzSB/KTemvj0hn6GlaeBsBNPzTc41ZuUUacFJO557pMe0WUEzhW HZFpUnzzl8Kel58T+G5dm9jVsirvCS2AAAtF+9uP9IMcSB3hxCI90daQQTEU6MCa54Pc UIY7FxHTGsChKTMIbwT30jl+B7roVfUmmSj5e8MRPlDSO/LIQBS3kLrV6n7OeOsmP3eF kpYycbykQr/Ua83awamdZpJoSPbprjjBQCj84FKTkRoCc/eNNWisav4Plf6eVPvaUbAS 2ZrYbea62bry6HWFkQuEskh8PPkZhzWvsyU9FkhjwcBjIWxguYKBIGl/dTo+ff+Gb069 s18Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=Rwdg4qj7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 15-20020a63154f000000b0057d7cff25besi1913952pgv.829.2023.11.17.06.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:34:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=Rwdg4qj7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9A436822CB26; Fri, 17 Nov 2023 06:34:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232173AbjKQOeW (ORCPT + 30 others); Fri, 17 Nov 2023 09:34:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231864AbjKQOeR (ORCPT ); Fri, 17 Nov 2023 09:34:17 -0500 Received: from mx08-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0797C4; Fri, 17 Nov 2023 06:34:13 -0800 (PST) Received: from pps.filterd (m0369457.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3AHB9I00011299; Fri, 17 Nov 2023 15:33:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=X7vC/oh1sqsCBQ9A3jJscHwCqNijqttGlrrT0QsvOmc=; b=Rw dg4qj7QbukbvkX0twVSUDUY8ZxPNFKSK6dlwNsTEyX3CfqB/NgJCL5iDnNs20tDW XiDdjnH0wVRCxZ6UGNkkWnmWrgZJg08udXvXQ3+Dv4jvKWzZ4itk2oofee60akn3 tWZ4/6Jv1BhjU2CVFbeMFl8xsOQh7CoYmYIyDRNqVdGDiGmWnPAT61da4kSzOFab RTE/+Oa530W5O1hPYPAT77+hzlsylWhF1Dj3eCa1wF68FS89zbKT1hez7Ax+8KK4 6NunQ0Z6+IW2mQEBFYOpj/XZezcBUzhNkR3DtL9fc7gSpmXJ14t0+NEX/HgQxCM+ KdvhtuMCvuz/PBvEukLg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3uanep98jv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 15:33:48 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DCBE7100034; Fri, 17 Nov 2023 15:33:47 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D3AE52309C5; Fri, 17 Nov 2023 15:33:47 +0100 (CET) Received: from localhost (10.201.22.165) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 17 Nov 2023 15:33:47 +0100 From: Patrick Delaunay To: Alexandre TORGUE , Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Fabrice Gasnier CC: Patrick Delaunay , , , , Subject: [PATCH 1/4] dt-bindings: nvmem: add new stm32mp25 compatible for stm32-romem Date: Fri, 17 Nov 2023 15:33:34 +0100 Message-ID: <20231117153310.1.I1784fc7f33cc928e9007d85354707d6382b48b72@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> References: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.22.165] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-17_13,2023-11-17_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 06:34:45 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782822142554547582 X-GMAIL-MSGID: 1782822142554547582 Add a new compatible for stm32mp25 support. Signed-off-by: Patrick Delaunay Acked-by: Conor Dooley --- Documentation/devicetree/bindings/nvmem/st,stm32-romem.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/nvmem/st,stm32-romem.yaml b/Documentation/devicetree/bindings/nvmem/st,stm32-romem.yaml index a69de3e92282..92bfe25f0571 100644 --- a/Documentation/devicetree/bindings/nvmem/st,stm32-romem.yaml +++ b/Documentation/devicetree/bindings/nvmem/st,stm32-romem.yaml @@ -24,6 +24,7 @@ properties: - st,stm32f4-otp - st,stm32mp13-bsec - st,stm32mp15-bsec + - st,stm32mp25-bsec reg: maxItems: 1 From patchwork Fri Nov 17 14:33:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 166206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp571264vqn; Fri, 17 Nov 2023 06:35:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4q5rltaMYY/yEJmErfr1vU6xHL6ztXJLWDapEVwVJ7cMNF3qzsD1tMgbH7uW4u3xBx1pX X-Received: by 2002:a05:6a21:7890:b0:187:4118:c0ee with SMTP id bf16-20020a056a21789000b001874118c0eemr11796973pzc.46.1700231702653; Fri, 17 Nov 2023 06:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700231702; cv=none; d=google.com; s=arc-20160816; b=njOmFrXGkP5QDqekVlsJuF6BPAR0Lrj1YrXrBY/7gpS76/Zs2048EKZRA7URILBP+2 8Qv1+Ie5XpfCqlshUXASr7Cjbbbw1OoHcQ6UpbJsPa1mLqgtVoGv0CAA+LtIgPq8oqnT hYKXvNBNYz4aZySNq7Z18wlqR5mqLDSmKt2BwlT2ttVH9I8o1hy/0IZ6DcryflobnmSZ DkztzGT00ih9N/3n4/lqlukLZ6oiNUQOzf5rrEGpCy7rIpXF7wlJu1YJUujp3AdhIQ1w fgaUrTl7DJ+Zc53ZUIYxl+ozFsp03wR+HhpGUO/qjpgH5QftT4HTtRe5h0oK3e/1MIg8 iJlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2kptbLSUBCjfzpDr3d+grhLzBCudtePeEMBFobZJJgo=; fh=/kP+9bdEFz3MKkOcLW/lQIRRJBhKPist974Z6nQv/e4=; b=VG3WfvIVvre/eJNhGQvLU/ppEJyppMaSESAPBxhmSbLVYwJQn2ujzNfsHmefQKJZfV voySAZKgYK+kshwwK3i02sZX9KcWNnxmfgXEv3o2kIaMxyAxGbI6pM91B7dMBC5n0ilw RsOvlHMDKc0Xcf5ZrahN0fSLkSx3L0cmFVraSLiH6ZjoAOmbrTbGZk4IbMyzi+S/CsnY y/eSISQtiLqQdxfAJvLQNx7QYVCvrYg6bL2FramDI/InCpGMfcRgMklAp1sQNS/Gdsvu I26y1v7RVN+xvld+BeaRymtRywyIE+xSGc59u1WujG0LOzqx0Y6ob0cvcbzO6GN3qmr/ yFZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=nb5WDD3p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l191-20020a6391c8000000b005be1ee5bde9si1885197pge.295.2023.11.17.06.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:35:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=nb5WDD3p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 00804809EE28; Fri, 17 Nov 2023 06:34:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232091AbjKQOeQ (ORCPT + 30 others); Fri, 17 Nov 2023 09:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231864AbjKQOeN (ORCPT ); Fri, 17 Nov 2023 09:34:13 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54EAED4E for ; Fri, 17 Nov 2023 06:34:10 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3AH9Mg4v015626; Fri, 17 Nov 2023 15:33:53 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=2kptbLSUBCjfzpDr3d+grhLzBCudtePeEMBFobZJJgo=; b=nb 5WDD3paSc2RkhJSUfJJ2/D0CYb3COTreycw9IHutG7jRF4w/xSbj73ZOwamcLVCB L1wNvKb8HBb0SVP9boqYv/bUevAfvPPDMUAN1jighVeMs+erhNXlqv6LxqysSLKB 6qGlc5aQ4cw80s5/Zc3xA9aPacmaUETSvNFsXxpGrFAZhc7V3X6Y5EoUt+r/MF4H 0cMMoT6AQ91PbTXj1qCu4GpxYzAB5dAyOuvC54Q4osREbR/mTHvfHTO7YgPfe35E 8AqqzbM0MA0Lop9FDSqWK53Pxgba215kchdTyuQMf3HQtQNJrr13vONE5iA+clpQ 73mhqBNsdQ+mIrTp67pw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3udn0m4t7s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 15:33:53 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F26FD100039; Fri, 17 Nov 2023 15:33:48 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EC6552309C5; Fri, 17 Nov 2023 15:33:48 +0100 (CET) Received: from localhost (10.201.22.165) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 17 Nov 2023 15:33:48 +0100 From: Patrick Delaunay To: Alexandre TORGUE , Srinivas Kandagatla , Maxime Coquelin CC: Patrick Delaunay , , , Subject: [PATCH 2/4] nvmem: stm32: add support for STM32MP25 BSEC to control OTP data Date: Fri, 17 Nov 2023 15:33:35 +0100 Message-ID: <20231117153310.2.I76e50bf760c893b11edfb2ed77388e2939612288@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> References: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.22.165] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-17_13,2023-11-17_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 17 Nov 2023 06:35:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782822157784057466 X-GMAIL-MSGID: 1782822157784057466 On STM32MP25, OTP area may be read/written by using BSEC (boot, security and OTP control). The BSEC internal peripheral is only managed by the secure world. The 12 Kbits of OTP (effective) are organized into the following regions: - lower OTP (OTP0 to OTP127) = 4096 lower OTP bits, bitwise (1-bit) programmable - mid OTP (OTP128 to OTP255) = 4096 middle OTP bits, bulk (32-bit) programmable - upper OTP (OTP256 to OTP383) = 4096 upper OTP bits, bulk (32-bit) programmable, only accessible when BSEC is in closed state. As HWKEY and ECIES key are only accessible by ROM code; only 368 OTP words are managed in this driver (OTP0 to OTP267). This patch adds the STM32MP25 configuration for reading and writing the OTP data using the OP-TEE BSEC TA services. Signed-off-by: Patrick Delaunay --- drivers/nvmem/stm32-romem.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c index 8a553b1799a8..82879b1c9eb9 100644 --- a/drivers/nvmem/stm32-romem.c +++ b/drivers/nvmem/stm32-romem.c @@ -269,6 +269,19 @@ static const struct stm32_romem_cfg stm32mp13_bsec_cfg = { .ta = true, }; +/* + * STM32MP25 BSEC OTP: 3 regions of 32-bits data words + * lower OTP (OTP0 to OTP127), bitwise (1-bit) programmable + * mid OTP (OTP128 to OTP255), bulk (32-bit) programmable + * upper OTP (OTP256 to OTP383), bulk (32-bit) programmable + * but no access to HWKEY and ECIES key: limited at OTP367 + */ +static const struct stm32_romem_cfg stm32mp25_bsec_cfg = { + .size = 368 * 4, + .lower = 127, + .ta = true, +}; + static const struct of_device_id stm32_romem_of_match[] __maybe_unused = { { .compatible = "st,stm32f4-otp", }, { .compatible = "st,stm32mp15-bsec", @@ -276,6 +289,9 @@ static const struct of_device_id stm32_romem_of_match[] __maybe_unused = { }, { .compatible = "st,stm32mp13-bsec", .data = (void *)&stm32mp13_bsec_cfg, + }, { + .compatible = "st,stm32mp25-bsec", + .data = (void *)&stm32mp25_bsec_cfg, }, { /* sentinel */ }, }; From patchwork Fri Nov 17 14:33:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 166204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp571181vqn; Fri, 17 Nov 2023 06:34:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNomljyuOhxU9ZPUStgFpIbae2NDbnVdEpHFKdWLvtHxfVomfW/vYJXBz0iLWoPr5yFvUr X-Received: by 2002:a05:6e02:20c5:b0:359:47b9:7bef with SMTP id 5-20020a056e0220c500b0035947b97befmr22718494ilq.1.1700231694867; Fri, 17 Nov 2023 06:34:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700231694; cv=none; d=google.com; s=arc-20160816; b=f447GW8SPx1UwvO1n5XSBSzwnh3rdT2mipEk45/D8zioHrw/1gH+wOU1FsFbn/8T7J ArHpVTQHjBm3d5hHLTF/LYdvd4RYkY4sy/5JdqUfnTo/IC4D88y9d6AlQpSjZMZoGEsy rgNuFHpLlo2zbxmO9CL3gwyLX9YFq9sM8mHlQGmMsa0IfwbUTDd4jpCuCdMdGeJ8kies LgClbMLRI0UsDLD4er3HWQdFPswkkNz9G1oOHYC4KB4IkUz+uqgpvjzWrHC2L+yRyZQD An2JmBU8Zcxq7bL+4/84mIlOFntWgdye2JwB1oXRdhZma0X4JSIWwz3xcyxO7WKtMkP1 kjWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3dfNmD9UkyMozPB1+rlLIqboCKGY0kezri6Od962cVg=; fh=8GJQromneixMjq1/cCwOzEnnIdxLxB3Z9s2pqJRNY8w=; b=rLKzSPkVvPruj4jfefzMDXhyuldmEdZvecHa0oobjpp6wC5R0wFDdi5/WFmc0Yawmu JnWOYCfiNJLxdTg5EdkkpniTkg12W1RgUFx+Gmpe0zog50Iavgspm9U5KQoYhfPO0yos VjePaiHOB93eQBoyMfQs292dbFuO7p2aqj35TO/c5qKm0NjnstO2PV4hkhBl1rK86LR6 4JM0cDs01ezrkaQoT5xtwGfa6DBhz/r5oNpd4aVyXiOD0BADF4C5fneMsqSb0cV44ogb KyS2Ot/SJQgnnf7zgxgJNur3vR/v/7HwNKD8aKj6MPT0vqht1elWS4iTwLFMzseHGZ2U 3xxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=szJtkplC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 195-20020a6302cc000000b005bdd6beacb0si1920316pgc.445.2023.11.17.06.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:34:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=szJtkplC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6CE60822CB3D; Fri, 17 Nov 2023 06:34:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235706AbjKQOef (ORCPT + 30 others); Fri, 17 Nov 2023 09:34:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235675AbjKQOea (ORCPT ); Fri, 17 Nov 2023 09:34:30 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A48E173E for ; Fri, 17 Nov 2023 06:34:25 -0800 (PST) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3AHB1wSV030506; Fri, 17 Nov 2023 15:34:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=3dfNmD9UkyMozPB1+rlLIqboCKGY0kezri6Od962cVg=; b=sz JtkplCULuzvm4Hs0VdDLL9Hsl4X4m8w1hdtd5a7iOcpfFDr1NOgemrKsE8vvJCu2 UJ2Xys3KqgMuddjTduJaLok1IALy0hDokTc2Pz4n5kqkw69UmldhvoK7tdQ44C3V p9tvlch70nDNVtmtl9OMYX3BXL57HNNYbS+ghEePLbuD4bbyBOHmc5tPDovInMAR I2UlI4wRvV+dUljeOOlaHsRSJOe4iPVnL4Xvm4xEgDNT3Uj+aihmvsiori/BE2uQ S+ylCSpMafVfizlrv20zCJ2iX/rSOWLxomfO0RS2KrbVcVK9HKbgaJej43jZN/Ef zPbLgyTLGxMffT9Iam0Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3ua1u2bs10-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 15:33:59 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7494710004A; Fri, 17 Nov 2023 15:33:50 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 59B6F231504; Fri, 17 Nov 2023 15:33:50 +0100 (CET) Received: from localhost (10.201.22.165) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 17 Nov 2023 15:33:50 +0100 From: Patrick Delaunay To: Alexandre TORGUE , Catalin Marinas , Will Deacon CC: Patrick Delaunay , Arnd Bergmann , Bjorn Andersson , Dmitry Baryshkov , Geert Uytterhoeven , Konrad Dybcio , Krzysztof Kozlowski , Marek Szyprowski , Neil Armstrong , =?utf-8?b?TsOtY29sYXMgRi4gUi4g?= =?utf-8?b?QS4gUHJhZG8=?= , Peng Fan , Udit Kumar , , Subject: [PATCH 3/4] arm64: defconfig: enable NVMEM STM32 ROMEM for stm32mp25 Date: Fri, 17 Nov 2023 15:33:36 +0100 Message-ID: <20231117153310.3.I01a380760a51fce06473104685c70aef4aecacd5@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> References: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.22.165] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-17_13,2023-11-17_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 06:34:50 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782822149483153666 X-GMAIL-MSGID: 1782822149483153666 Enable the NVMEM driver STM32 ROMEM for STM32MP25x SoCs to allow access to OTP provided by OP-TEE BSEC PTA Signed-off-by: Patrick Delaunay --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index b60aa1f89343..1df4020ec688 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1485,6 +1485,7 @@ CONFIG_NVMEM_ROCKCHIP_EFUSE=y CONFIG_NVMEM_ROCKCHIP_OTP=y CONFIG_NVMEM_SNVS_LPGPR=y CONFIG_NVMEM_SPMI_SDAM=m +CONFIG_NVMEM_STM32_ROMEM=m CONFIG_NVMEM_SUNXI_SID=y CONFIG_NVMEM_UNIPHIER_EFUSE=y CONFIG_FPGA=y From patchwork Fri Nov 17 14:33:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 166205 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp571228vqn; Fri, 17 Nov 2023 06:34:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8sl+9SRnlInAnRG5IIBwmY1aj5KE9W+rEK0bJjcgDfOPZLTyGiJC/WVK2Uq0qyLqiXc+L X-Received: by 2002:a05:6a20:244b:b0:187:ac8f:6bec with SMTP id t11-20020a056a20244b00b00187ac8f6becmr6307442pzc.41.1700231698557; Fri, 17 Nov 2023 06:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700231698; cv=none; d=google.com; s=arc-20160816; b=tTqntDwF+1areQxAselXLJ4mV8xY79sb2sbjGwPPs5ZInaLXQEnu/uj9LNGv7fQ9nq CX+C8vF32jgSLxv4jbcQ61RCvoEasWE/aMuV6ttWryVcf8mf5KOKBs7XXyrlhULzbSZm f4aEfrXbxDrkemUW/yEeATCiaDZ+dw4QOMMA4AOknoeIkOqm9AY5f9SG0qNh5AzQXtaz rBFgbG30ffe9wFvMsIewypX8dNkiX3LD0e0kNq4nDRkBKDELA8FA6AuV8SqSzBlOB8rn LAB7/+XPloL6Xg7+SQ0uJHpL+C1J1sg1yWK7BokI5tCY85U7e/DXVzBhtZn9QBiQWUml VYNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OldM9nSyGvxquN5zF8rDqdrgCIgxRf4RySMadaUT0cM=; fh=0iVDGcN/KJsw6zHLkCjV9nVVtYOZYZDFx2OEx6DqOEY=; b=LcsPQjm1kgAX4GWSZwgAc9DA9hWZ1CeqkIi9dIUCAwJSFTD4uraPSUfGdd6yqAUFJu TZo7bCE8TGPfm5lWki4xGwMRCoq2zXjYzFxRioI/eg5O3olpu7WQwmnZ5ADVyeEex3pb nTipjFMzskwe1CT5MOEbcNIftiArz/s1f6lJjJbr6Q4hnvjkKE9RyHkq0PVAmhS+yjMA 98EuRkGB3sA0O4Agtj7rlUmy9b+TTbXLl6Vbs0f1ybpIvKgJpR3nUkYkKk3f2YLOjdxI OTWsMAFg+wfPdYI5ISjLVmuYZE4WeSyADs/JGl/010TORwAQn7gMYNkbYH9QVQiEXyxi I5yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=br5Zbs9K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h63-20020a625342000000b006cb2dd42908si928488pfb.360.2023.11.17.06.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:34:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=br5Zbs9K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E3D778040825; Fri, 17 Nov 2023 06:34:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbjKQOec (ORCPT + 30 others); Fri, 17 Nov 2023 09:34:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232912AbjKQOe3 (ORCPT ); Fri, 17 Nov 2023 09:34:29 -0500 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47999D4B; Fri, 17 Nov 2023 06:34:21 -0800 (PST) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AHBUdKT007319; Fri, 17 Nov 2023 15:34:09 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=OldM9nSyGvxquN5zF8rDqdrgCIgxRf4RySMadaUT0cM=; b=br 5Zbs9KuAVSVJHup9dJNV02jTCaNz/+XrwTMkIc8X6HPaM6LnHzFGdYqs13TgcQ/M HiMY6rPtY0eNJh4mzfVOEwO/GtDIDEhoIrhObNUnQsi0rSgxS3Hs398fR2HVjZhq F7hhRyb8CngCxNOaoRb5QmCUbnFRCdsZyib3m/vu0rtzD6Z7ul66KvMYqJZku633 lFlmbawbi2j7ATxWJwsgCsFiflKtXYtbSeeAK72dCABjkZJNNd7mqwwd0Wh4DSBf i1b62y5oV39HtR6KDIjMeacCFOB3ayw+baHTbN6kbExDhWXyZhJHeqMjOZV36L6I aJ/Fo+6tuwAlVIxN2X5g== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3u9ym943d3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 15:34:08 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 83FC610004D; Fri, 17 Nov 2023 15:33:51 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7B7AC231509; Fri, 17 Nov 2023 15:33:51 +0100 (CET) Received: from localhost (10.201.22.165) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 17 Nov 2023 15:33:51 +0100 From: Patrick Delaunay To: Alexandre TORGUE , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin CC: Patrick Delaunay , , , , Subject: [PATCH 4/4] nvmem: add bsec support to stm32mp25 Date: Fri, 17 Nov 2023 15:33:37 +0100 Message-ID: <20231117153310.4.I8fa60abf176f777721ee5beb2bad216f833ed31a@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> References: <20231117143338.1173475-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.22.165] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-17_13,2023-11-17_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 17 Nov 2023 06:34:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782822153833768469 X-GMAIL-MSGID: 1782822153833768469 Add BSEC support to STM32MP25 SoC family with SoC information: - RPN = Device part number (BSEC_OTP_DATA9) - PKG = package data register (Bits 2:0 of BSEC_OTP_DATA122) Signed-off-by: Patrick Delaunay --- arch/arm64/boot/dts/st/stm32mp251.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi index 124403f5f1f4..96859d098ef8 100644 --- a/arch/arm64/boot/dts/st/stm32mp251.dtsi +++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi @@ -140,6 +140,22 @@ sdmmc1: mmc@48220000 { }; }; + bsec: efuse@44000000 { + compatible = "st,stm32mp25-bsec"; + reg = <0x44000000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + part_number_otp@24 { + reg = <0x24 0x4>; + }; + + package_otp@1e8 { + reg = <0x1e8 0x1>; + bits = <0 3>; + }; + }; + syscfg: syscon@44230000 { compatible = "st,stm32mp25-syscfg", "syscon"; reg = <0x44230000 0x10000>;