From patchwork Mon Oct 17 15:49:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 3574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1526247wrs; Mon, 17 Oct 2022 09:04:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM59kvKc02B7pSIg0h1R32FCj1RDFwqGXzg+Sel9hAFZRtCMmrHMAgZrBI0wk0uhIXX/RH6w X-Received: by 2002:a17:906:5a4b:b0:78d:4e5a:d101 with SMTP id my11-20020a1709065a4b00b0078d4e5ad101mr9038759ejc.196.1666022666925; Mon, 17 Oct 2022 09:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666022666; cv=none; d=google.com; s=arc-20160816; b=bSERSmzo21mUUeAH6qAU/R1HETzjDo0u+/P2n1UG2doRiCdZPSJsTaaCURR37mfjvU fMZXu0JAuPP6Y22l6/UyVpxDbxSbPeZU7qATgIo8s6tT6Y1uGfGSRYk70R5I35G9sdUM WVR96X2clSSJ0uIRfHGbhEUDOeKvsxtv0yLOp/FjXn2AkFZ8/2Z0ujUW0/VsjdVX6fJg C9ByIM7wyXe1spWEUv/MH9TAd2Rry4uLQbfStjiL9J9irncOQZXPJgPkHvgXeeah/xk5 3aDi63lnXiCc+J3imJ+LdBjprhzc1cuWAbu7DUjzLXF4x4mTd2ceV46GQOb9bb16l94D PKMw== 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=PTD29u9H2awREq7QER5NbK7XrTS7AE1TFO8vQSlVClg=; b=nAIMdkoKRedtPrMGcOnIfJWGzHb8Gj4Wk0JSaBKbtaYkhG5DFFxiNefSqkoHEC1jVl itjT1MKmo4K+baZwMWeTdumcLDdPn+eYZE9Ta6MWoUA/M+H+LGNzPEfAFBYRDJ4AM5f/ gDy2A9gZipHIgPNHftzhpLpHjjplJaCOWzeoHfLvaTPsdDzeGMzubZyH37mPJffgZj1F CzvUmhRWmtW6Pay5ZOgcBZH4onpVJAjqZKRev2tzepccMas9aaJXJi2ZmFzOH1AQX/Yr F/CkjGV03r07xyzxesOCVcMPCobGb9namaE3CWlZl7yZ+wLiIDNplKgnPGdtBB5oePHR +OpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=GoCAm0Me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z88-20020a509e61000000b00459dc4e4b7fsi8840531ede.143.2022.10.17.09.03.58; Mon, 17 Oct 2022 09:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=GoCAm0Me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiJQPuz (ORCPT + 99 others); Mon, 17 Oct 2022 11:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbiJQPuv (ORCPT ); Mon, 17 Oct 2022 11:50:51 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ACD166862 for ; Mon, 17 Oct 2022 08:50:49 -0700 (PDT) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29HFHYl6024503; Mon, 17 Oct 2022 17:50:43 +0200 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=PTD29u9H2awREq7QER5NbK7XrTS7AE1TFO8vQSlVClg=; b=GoCAm0MeFgww0b3B9e+jZXZIRjKAv0voa5MKl1riNytrpKGs0vu+LjoBqKa+3dxIe1K6 B0QubPfx8lJ42DBOObR0JDHfF3l+T5wDRt7WK7Cdj8KKegE7GekZMSfGQg7F8WhDOgLP iCEfhqB8hf7fB2BOc8JMj/RAJz5mtphBP7GTY2MJidvNFczQhsfRURars6U3LjHzsPPH zmD37dT+gPta/9cI5yvYpbLP8fY0OIbkfcuGHVmn9e6nTf6hQ43wMCWFzPi/4Wry4/fm xgBtA4NDz4XahkhmyF0lSrbdSOgR1/zjVexcLHQSv3N6qBfxqwUlgAs42i8teHCOGX8B Ng== 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 3k7krjnsh6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Oct 2022 17:50:43 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F22C8100034; Mon, 17 Oct 2022 17:50:39 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id ED81323C6A0; Mon, 17 Oct 2022 17:50:39 +0200 (CEST) Received: from localhost (10.75.127.48) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 17:50:36 +0200 From: Patrick Delaunay To: Srinivas Kandagatla , Maxime Coquelin , Alexandre Torgue CC: Patrick Delaunay , , , Subject: [PATCH v2 1/3] nvmem: stm32: move STM32MP15_BSEC_NUM_LOWER in config Date: Mon, 17 Oct 2022 17:49:55 +0200 Message-ID: <20221017174953.v2.1.I95e71328dd654723bd4c57206bd008ff81c726bb@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221017154957.277120-1-patrick.delaunay@foss.st.com> References: <20221017154957.277120-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-17_13,2022-10-17_02,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746951383813505060?= X-GMAIL-MSGID: =?utf-8?q?1746951383813505060?= Support STM32MP15_BSEC_NUM_LOWER in stm32 romem config to prepare the next SoC in STM32MP family. Signed-off-by: Patrick Delaunay --- Changes in v2: - Add patch "move STM32MP15_BSEC_NUM_LOWER in config" in the serie, solve dependency issue for "priv->lower" in patch "nvmem: stm32: add warning when upper OTPs are updated" drivers/nvmem/stm32-romem.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c index 354be526897f..d93baee01d7b 100644 --- a/drivers/nvmem/stm32-romem.c +++ b/drivers/nvmem/stm32-romem.c @@ -22,16 +22,15 @@ /* shadow registers offest */ #define STM32MP15_BSEC_DATA0 0x200 -/* 32 (x 32-bits) lower shadow registers */ -#define STM32MP15_BSEC_NUM_LOWER 32 - struct stm32_romem_cfg { int size; + u8 lower; }; struct stm32_romem_priv { void __iomem *base; struct nvmem_config cfg; + u8 lower; }; static int stm32_romem_read(void *context, unsigned int offset, void *buf, @@ -85,7 +84,7 @@ static int stm32_bsec_read(void *context, unsigned int offset, void *buf, for (i = roffset; (i < roffset + rbytes); i += 4) { u32 otp = i >> 2; - if (otp < STM32MP15_BSEC_NUM_LOWER) { + if (otp < priv->lower) { /* read lower data from shadow registers */ val = readl_relaxed( priv->base + STM32MP15_BSEC_DATA0 + i); @@ -159,6 +158,8 @@ static int stm32_romem_probe(struct platform_device *pdev) priv->cfg.priv = priv; priv->cfg.owner = THIS_MODULE; + priv->lower = 0; + cfg = (const struct stm32_romem_cfg *) of_match_device(dev->driver->of_match_table, dev)->data; if (!cfg) { @@ -167,6 +168,7 @@ static int stm32_romem_probe(struct platform_device *pdev) priv->cfg.reg_read = stm32_romem_read; } else { priv->cfg.size = cfg->size; + priv->lower = cfg->lower; priv->cfg.reg_read = stm32_bsec_read; priv->cfg.reg_write = stm32_bsec_write; } @@ -174,8 +176,17 @@ static int stm32_romem_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &priv->cfg)); } +/* + * STM32MP15 BSEC OTP regions: 4096 OTP bits (with 3072 effective bits) + * => 96 x 32-bits data words + * - Lower: 1K bits, 2:1 redundancy, incremental bit programming + * => 32 (x 32-bits) lower shadow registers = words 0 to 31 + * - Upper: 2K bits, ECC protection, word programming only + * => 64 (x 32-bits) = words 32 to 95 + */ static const struct stm32_romem_cfg stm32mp15_bsec_cfg = { - .size = 384, /* 96 x 32-bits data words */ + .size = 384, + .lower = 32, }; static const struct of_device_id stm32_romem_of_match[] = { From patchwork Mon Oct 17 15:49:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 3575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1526263wrs; Mon, 17 Oct 2022 09:04:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4o/5RajpDZ1tXMq9g/i9U3xyM0R9Xw3Q1fMVRFMqBcW4z17Ovmc9gVyIvmQ1/rdObSs1pD X-Received: by 2002:a05:6402:1a4d:b0:459:319f:ff80 with SMTP id bf13-20020a0564021a4d00b00459319fff80mr10989721edb.144.1666022668677; Mon, 17 Oct 2022 09:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666022668; cv=none; d=google.com; s=arc-20160816; b=NL+okncH6EcsdWYhg5WciqKX5YyYp/Wjfw5BgSzjuv4/AH8wSi3PsqTg94PATnFZOt NQZF1T+RBjtV65cfd1nysKbhvmg2EOIMIqrQ8S+hiLglhZTqLiU+ZqF0Y8eJFqP8Y+mk Ryn+CB9KvAGiUICp0C3/izjxbM8suKN8lAX0QskaasjYWOExH84On9+es0fpANFS4VWF Ow99regzu9QeRBy169/OlATlzNxoLnluB/X+EWT/KCTpxMCkNUgtxHzvml9MyDsEVzwJ PfR5G41wor9Whu+MHPh3OajeoP8sWZUpPyn8q6vkO1H20eOnJA3yHU0UL2p3Z3rzyi2D XxVA== 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=phlzu4FsLYCgo+33k55masOClxFOICgga//eKhVT5DA=; b=Ei+I/OuqSik7SD2jc+JyiIBPBRnsfQO3BTXUIt29xk+p/s9MGczTHoFGEVYK2Rek62 0HEUNOd+r+p1uTtBBU2Wb1yvCb/1EAMZgXGL0v7KRnJm8WGly+e08V1p14A00YAeORJE sB3hDSlFOituplLpZfRG6d8rWn+fbhSp7fo5su5ZK5TFEWZMJWZkCpSZ1JFDQbT04dYw PfmkKEgXECnc78/V0JGNufBol2NE8h8KSHsm7vSvyEQupn/NBzi+WQuoJoObk/yFmTj/ 6HsFsxoOjUu7HCU9y0hYd63WAnMAnM+ERjlYBNKkNksYbXg8xeO394c/CYODWdDw6c/t KDQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=m0kBsPwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt18-20020a170907729200b0078db656378bsi9265801ejc.763.2022.10.17.09.04.00; Mon, 17 Oct 2022 09:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=m0kBsPwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbiJQPu6 (ORCPT + 99 others); Mon, 17 Oct 2022 11:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbiJQPuu (ORCPT ); Mon, 17 Oct 2022 11:50:50 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1810966867 for ; Mon, 17 Oct 2022 08:50:49 -0700 (PDT) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29HEnXPi031465; Mon, 17 Oct 2022 17:50:43 +0200 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=phlzu4FsLYCgo+33k55masOClxFOICgga//eKhVT5DA=; b=m0kBsPwO7CE8y2TIS764D0+CDjpFLbruiUt5BdWM/Y+5Qa6z8so8W7gWR8xiunow8D/2 Ag3MKDsbAGZK/mY32jTN+NytkpII29vKQ6mQ5exp3vsgT/rkKIMLluW571BGiBb8N+cs 6jcYfXL3toxjYhrwSxp85jYYJQJPaggP2Y1OfdRpBNSDsPZ5n0grj9yNfgYzK96TeQ9Y AeMZ1BN0gLKokbG3J3Odh5dbCZTQy/ayv1Z/SkTNTRLZX2vhALBbS77hM9Y94gaDlw62 GMNuMEfZLEKwOJuaCg4Ndpi9p8IE5gl80CX3OLRPrsnMECb4LY8Qzh97z0r3H8hEbtop aQ== 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 3k7krjnsh8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Oct 2022 17:50:43 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F230210002A; Mon, 17 Oct 2022 17:50:38 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id ED63723C6A0; Mon, 17 Oct 2022 17:50:38 +0200 (CEST) Received: from localhost (10.75.127.120) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 17:50:38 +0200 From: Patrick Delaunay To: Srinivas Kandagatla , Maxime Coquelin , Alexandre Torgue CC: Patrick Delaunay , , , Subject: [PATCH v2 2/3] nvmem: stm32: add warning when upper OTPs are updated Date: Mon, 17 Oct 2022 17:49:56 +0200 Message-ID: <20221017174953.v2.2.Ifa806ff30d7c669ba9a3df9c6b64698a2dcc073a@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221017154957.277120-1-patrick.delaunay@foss.st.com> References: <20221017154957.277120-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.120] X-ClientProxiedBy: GPXDAG2NODE4.st.com (10.75.127.68) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-17_13,2022-10-17_02,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746951385671542963?= X-GMAIL-MSGID: =?utf-8?q?1746951385671542963?= As the upper OTPs are ECC protected, they support only one 32 bits word programming. For a second modification of this word, these ECC become invalid and this OTP will be no more accessible, the shadowed value is invalid. This patch adds a warning to indicate an upper OTP update, because this operation is dangerous as OTP is not locked by the driver after the first update to avoid a second update. Signed-off-by: Patrick Delaunay --- (no changes since v1) drivers/nvmem/stm32-romem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c index d93baee01d7b..bb8aa72ba2f9 100644 --- a/drivers/nvmem/stm32-romem.c +++ b/drivers/nvmem/stm32-romem.c @@ -132,6 +132,9 @@ static int stm32_bsec_write(void *context, unsigned int offset, void *buf, } } + if (offset + bytes >= priv->lower * 4) + dev_warn(dev, "Update of upper OTPs with ECC protection (word programming, only once)\n"); + return 0; } From patchwork Mon Oct 17 15:49:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 3579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1528134wrs; Mon, 17 Oct 2022 09:07:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7os2OGxTNO32RHOuRxqP+mX1hO+6DLBejFzQMf1yhsCoLr80mhEpmqGLXRXzRf6vsO+iJc X-Received: by 2002:a05:6402:e87:b0:456:c93c:5361 with SMTP id h7-20020a0564020e8700b00456c93c5361mr10716577eda.88.1666022845844; Mon, 17 Oct 2022 09:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666022845; cv=none; d=google.com; s=arc-20160816; b=AU6IkLNA+h5t/g+rGldstJ2mSUym42wnhVu5PtuLaleZt8wrJaxAuTP5OWpsqG6ivL /wmn/e/i18DfhCNLnogbOBFqwr9KuCSNuTdunl9n+x2LBllgA5W1pfK8+4v0FcAiAGin pTiHULSIqIHN9nAwHlqhLyu8dqEvlwqaJd0ENZY3mQFPETfpjuOdC+/IPw+g/3yyjMZ9 1kish2ljWSoEkkJbsEfAPzPvf7VgY2/o167N4Y9cDKg01Sxtx0qfBggtx1LA/McjdTeJ /h6Q0LpcQXNr7Dw4f8YwkbfiJOqw2MfqF3LpOZVEeah22S3jfDpSFvCckCysqWF8wA6g YSyA== 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=1dhJBOe2QEKMxFJRVTYoEK+8j5HO9AbVW9D0uLmIH90=; b=GKN3YZTLumPXE0dDfNKctbk2WDcS0kvM1ME0MwR1EQWM5wQjImqEVrYXUeQFPhq8fx t1w2qHYhozyFkE1zWLnmvvyQp/b0lWiyWtgk1NgPnqTXmikxm3OA5xqN1j2fg9B+EmW5 +oOJ3dbBOj4e6VtyYsMHS+ulvjD4cF6KJdSM9pOMvlPaqJ+Jq0u7krYUHk5Q9x/pPvKi MEZpF59XN0p9okpYg+f3zEa9LPFsfZbD9+x98NZgn9cu8V44nA7tf1x+cSJqxGpJbMnY UoXhMGfOxjodH7QiygbCEq8IEElq8oGYt5knlbK4+sAMRMxi9vuDJZZF+hqmWv8oAyr7 tDEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=Mlrhgpb2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mc10-20020a170906eb4a00b00767e24156dbsi8436432ejb.256.2022.10.17.09.06.57; Mon, 17 Oct 2022 09:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=Mlrhgpb2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbiJQPvC (ORCPT + 99 others); Mon, 17 Oct 2022 11:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbiJQPuv (ORCPT ); Mon, 17 Oct 2022 11:50:51 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70DBB64DE for ; Mon, 17 Oct 2022 08:50:50 -0700 (PDT) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29HF6Z4J017497; Mon, 17 Oct 2022 17:50:45 +0200 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=1dhJBOe2QEKMxFJRVTYoEK+8j5HO9AbVW9D0uLmIH90=; b=Mlrhgpb2d2m+9U0VpV1rf9gzsREe9S2m8yogPEOIdjfHF1n5R/DHvUli+tITMa7e459x WBofqSpU+COm8KI2Ui9b1HKKdg/3UjxAvC6EAYWDE1/uxsBgePEp++Sj3QSlIw0tt/X7 N3uVQoOgLBhUQ+EPaYK6B7vUZ1kKiRGXZZAG2uxBkI1NWsllreAgc+rdT0dOOtHw+jBm pEwbb7Kl+UUv/fr2FucBOw0wFF4AK59qKEbL49aZ0KKbsJzPlLadkVcjPRkWTZAGMWfT +ah/2Ii+Mwm6Gj1yxPlTcjFbnO3FIGaggMH1Vyq3mCVMqFS0n1F9kDP0t74wGTak0ZIz 7Q== 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 3k7j0cxabx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Oct 2022 17:50:45 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5EA78100039; Mon, 17 Oct 2022 17:50:42 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5A36423C6A0; Mon, 17 Oct 2022 17:50:42 +0200 (CEST) Received: from localhost (10.75.127.123) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 17:50:39 +0200 From: Patrick Delaunay To: Srinivas Kandagatla , Maxime Coquelin , Alexandre Torgue CC: Patrick Delaunay , , , Subject: [PATCH v2 3/3] nvmem: stm32: add nvmem type attribute Date: Mon, 17 Oct 2022 17:49:57 +0200 Message-ID: <20221017174953.v2.3.Iaff264d5b87f54b7c5fe3a408b4d1662d1fdfd2a@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221017154957.277120-1-patrick.delaunay@foss.st.com> References: <20221017154957.277120-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.123] X-ClientProxiedBy: GPXDAG2NODE4.st.com (10.75.127.68) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-17_13,2022-10-17_02,2022-06-22_01 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746951571687356996?= X-GMAIL-MSGID: =?utf-8?q?1746951571687356996?= Inform NVMEM framework of type attribute for stm32-romem as NVMEM_TYPE_OTP so userspace is able to know how the data is stored in BSEC. Signed-off-by: Patrick Delaunay --- (no changes since v1) drivers/nvmem/stm32-romem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c index bb8aa72ba2f9..6de565639d5f 100644 --- a/drivers/nvmem/stm32-romem.c +++ b/drivers/nvmem/stm32-romem.c @@ -160,6 +160,7 @@ static int stm32_romem_probe(struct platform_device *pdev) priv->cfg.dev = dev; priv->cfg.priv = priv; priv->cfg.owner = THIS_MODULE; + priv->cfg.type = NVMEM_TYPE_OTP; priv->lower = 0;