Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp977299pxj; Fri, 4 Jun 2021 03:05:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHq5cI9qD34oVQp4OUc/GBV/6AMrem8qnYlRQBD5jRGVMt5+BAk0iieF0wWiwh6rfXrhd8 X-Received: by 2002:a17:906:2c4a:: with SMTP id f10mr3332914ejh.493.1622801109606; Fri, 04 Jun 2021 03:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622801109; cv=none; d=google.com; s=arc-20160816; b=avXBAZTYZr4TA45pw34cSooniZmEjFLmNaz235efomMPFWmX7/B6TCTa1pp1yID5nA dSPr7FQqjx7pRK3ED6iO9kt5e3HYlHzqxL3/XiNz6XC5CJPEBY/8erNis46SHnb5yY/L Bh588pJiSTb8DKge/DQ+C2O82DFK7S2f7mev0r0fFyHxzWJvRRMO0/yvgkpHbTSlbPhN yk2Fpwy0M7WypVNieYuJr589sXv/Yi6IoLBxhnNZBamBb55xClALxnfCXZfKwrtdIPKq gsIVg2d1W1Xz5jSYfRMQb/bG3kHIGC5POvR5e0ivIFqSsVTvC4wRTJWhRP6rsmi67tLP Rw0g== 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=QTGOuq0Tp1H1o8U2iUjRUlYX6F/stIxQslHbe9vhQ+E=; b=vFah6HtKzrdq2ecnwAHHmPZZCIx1yF3UFk44RzxePy222Jdo8GBIN6NBkrBEB1ELQ9 AVrqPePhWtktZhALBBp6NfohrFzXiMyounABVodksI5NYlm6Hf7RoC8V34Gniv33ZiM1 nITx57nX7qeVrWdggSu5QEG+ayftXpWJYe/0YkVSvc9pDOgc8uq8Kw024X1v2MWjIVBk UvNiUPEjqzeVHIVA7Af9S3+AvqLquJnJE4KeDd14JYvFdmgHvCOSS0mZhDeEEzLfXFr3 z/PEwLvO89WxPn309f3JC/uTBcrlWLz+3Bry2q5jFU8hrRAjt2JqohbP8c8VL5x8uwwL iLcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=tWNyV+8u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si1814773edd.585.2021.06.04.03.04.44; Fri, 04 Jun 2021 03:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=tWNyV+8u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhFDKEx (ORCPT + 99 others); Fri, 4 Jun 2021 06:04:53 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:39653 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbhFDKEu (ORCPT ); Fri, 4 Jun 2021 06:04:50 -0400 Received: from mwalle01.fritz.box (ip4d17858c.dynamic.kabel-deutschland.de [77.23.133.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 86BD12224E; Fri, 4 Jun 2021 12:03:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1622800983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QTGOuq0Tp1H1o8U2iUjRUlYX6F/stIxQslHbe9vhQ+E=; b=tWNyV+8u6GEtc9v7xojbo5um0S714793VDKRtWT37I7mWkaaruTb0+IU/CBb5/hjM0XBuS VUw3SOFUHTg1rVxkzKxqlZotIwQSlUXZMH9+xAvzVez/n4fPf1zB/2JqWdge0pi9t5I3I1 kUnf2OKPevx4wqQFlJveJMC381RI9H0= From: Michael Walle To: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tudor Ambarus , Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: [PATCH v5 2/5] mtd: spi-nor: otp: use more consistent wording Date: Fri, 4 Jun 2021 12:02:49 +0200 Message-Id: <20210604100252.9975-3-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210604100252.9975-1-michael@walle.cc> References: <20210604100252.9975-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the wording as used in the datasheet to describe the access methods of the security registers (aka OTP storage). This will also match the function names. Signed-off-by: Michael Walle Reviewed-by: Pratyush Yadav Reviewed-by: Tudor Ambarus --- drivers/mtd/spi-nor/otp.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/spi-nor/otp.c b/drivers/mtd/spi-nor/otp.c index 91a4c510ed51..3898ed67ba1c 100644 --- a/drivers/mtd/spi-nor/otp.c +++ b/drivers/mtd/spi-nor/otp.c @@ -15,14 +15,21 @@ #define spi_nor_otp_n_regions(nor) ((nor)->params->otp.org->n_regions) /** - * spi_nor_otp_read_secr() - read OTP data + * spi_nor_otp_read_secr() - read security register * @nor: pointer to 'struct spi_nor' * @addr: offset to read from * @len: number of bytes to read * @buf: pointer to dst buffer * - * Read OTP data from one region by using the SPINOR_OP_RSECR commands. This - * method is used on GigaDevice and Winbond flashes. + * Read a security register by using the SPINOR_OP_RSECR commands. + * + * In Winbond/GigaDevice datasheets the term "security register" stands for + * an one-time-programmable memory area, consisting of multiple bytes (usually + * 256). Thus one "security register" maps to one OTP region. + * + * This method is used on GigaDevice and Winbond flashes. + * + * Please note, the read must not span multiple registers. * * Return: number of bytes read successfully, -errno otherwise */ @@ -56,16 +63,20 @@ int spi_nor_otp_read_secr(struct spi_nor *nor, loff_t addr, size_t len, u8 *buf) } /** - * spi_nor_otp_write_secr() - write OTP data + * spi_nor_otp_write_secr() - write security register * @nor: pointer to 'struct spi_nor' * @addr: offset to write to * @len: number of bytes to write * @buf: pointer to src buffer * - * Write OTP data to one region by using the SPINOR_OP_PSECR commands. This - * method is used on GigaDevice and Winbond flashes. + * Write a security register by using the SPINOR_OP_PSECR commands. + * + * For more information on the term "security register", see the documentation + * of spi_nor_otp_read_secr(). + * + * This method is used on GigaDevice and Winbond flashes. * - * Please note, the write must not span multiple OTP regions. + * Please note, the write must not span multiple registers. * * Return: number of bytes written successfully, -errno otherwise */ @@ -88,7 +99,7 @@ int spi_nor_otp_write_secr(struct spi_nor *nor, loff_t addr, size_t len, /* * We only support a write to one single page. For now all winbond - * flashes only have one page per OTP region. + * flashes only have one page per security register. */ ret = spi_nor_write_enable(nor); if (ret) -- 2.20.1