Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3180269pxj; Mon, 7 Jun 2021 04:31:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRW4I6ROgo7cJ8bzNvcI/XrOdq51/eCctCYVG+IL3ISAEFti2axO7IN1fhjZyPJacZSC/J X-Received: by 2002:a17:906:3395:: with SMTP id v21mr16986433eja.102.1623065503976; Mon, 07 Jun 2021 04:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623065503; cv=none; d=google.com; s=arc-20160816; b=r8uRMg+TV0awkItl5UC8Zn+TpIObgHkd15MbJB7VcYqlgCMGy3UNzCIoHNdtTVumeW eyeVv/XYd6JWMJiSLvIvsk1Teoomqra0v2hNnwst92k84TzJer4bZc5TeXN9XJqWcgZ0 7eDWLSTCKx0xm/8fHHpaw6UAO9glvDir49hKIoWW8As6IgflBzFdZiXHGLcZ8b0nkSFy HWRIIEigDWErmZkmAtjCATJ2rK2pbENIwLv+xT5vX/2gQ3X3d2/HjvN8Np+Y1pjDlrZr 6DIyL6vYCD8HA/XNHlMOCdomdJ1V4McMSQ/ZU0QAEcVHt4l6hDm+Ai4TiGzhApr+7jJz s/fQ== 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=s0/b0nMeWZyeOj1KmtKvP6T339wTrF0ElADODNr+OQyDa4FtGKtcLi5B0//RA8rtBE OBkvBfeg8qHoglAuV0F++AnFbxhOAU9E1kd2M70crpLcTgdccIpmgzO5nDIhwUCztzqD kzhSSu7DNXq3b446ZA/CRLxw+q3Iia5tTzKrDZFL8S2VgBgZJj9AULrDco4a8zvcKxYb /f0/wyjeRfPwGEZz3oFcLsmek2HCJm7+hHk2Cl//7mPHEJRpRMPNsTy/rT1Cquv3uOSC c2b7TGnYY7UELe4jYm/Mir3qz3nTa0nqHJ6T/0Scjt01m4EyFARwNqcO/Gn0KTbeB5Bn YoMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=NVcqAo8x; 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 z11si12392675edq.40.2021.06.07.04.31.19; Mon, 07 Jun 2021 04:31:43 -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=NVcqAo8x; 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 S231286AbhFGL3q (ORCPT + 99 others); Mon, 7 Jun 2021 07:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbhFGL3n (ORCPT ); Mon, 7 Jun 2021 07:29:43 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88985C061787 for ; Mon, 7 Jun 2021 04:27:52 -0700 (PDT) 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 953892224B; Mon, 7 Jun 2021 13:27:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1623065270; 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=NVcqAo8x1MVfaVGPUINY/ET7nLeIku9B8jbZmEFC7Aqcq2265DoAORl0MSBqaEaPNv9VpZ 5t/+VkCpn2Y6AKIHU4bfgbWGclyM3YJeNUOgUk1+g3X1eQeN3hyeaD+HIktrHD4hkptTXx tW41bO7hQqHGS+Hkf+ZAyRCfQjF0od4= 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 v6 2/4] mtd: spi-nor: otp: use more consistent wording Date: Mon, 7 Jun 2021 13:27:42 +0200 Message-Id: <20210607112744.21587-3-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210607112744.21587-1-michael@walle.cc> References: <20210607112744.21587-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