From nobody Tue Feb 10 20:50:03 2026 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) (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 5D42D185E53 for ; Thu, 26 Dec 2024 13:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.18.73.165 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735221402; cv=none; b=F47mvOC9nUyW2MtIBxK10CPtWxUJG2HCQMHifB4aBN3X2Ihr/Qhdg2aFsrnZBI+8vv1Oob3htoSq+D/MwJC8DenA0se33IbJdBXPmNE5QslSZaE7JqOhBBZqGpzN9R1qksxdLNeYlnoFAdZmJqNnQ2a2DVdrtCwYmq9yTqrnwAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735221402; c=relaxed/simple; bh=XKjaz6vAorsG5tRlJPMGt5nH/dPFs/cWvt49q4c9Y2c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bwfwqcqne8L9+jpXSKlJJ29TWJnX+syLg+GtMhcQhOGQMBYE5y+EbZ+CqJnvd6h+IUV0G0LBxaN5qxjjx+FVQERdCDBGFxwLod19EFr4XU/TvEYBRlvD1TjYO1vBi2b5VUjYlI8YztyQNloRyaxQV6D/t65pPKok4tZ9haPHOwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=salutedevices.com; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=s2cW43T4; arc=none smtp.client-ip=37.18.73.165 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="s2cW43T4" Received: from p-infra-ksmg-sc-msk01.sberdevices.ru (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 27ADF100009; Thu, 26 Dec 2024 16:56:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 27ADF100009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1735221397; bh=Nu38CUOAfNVgdmBMZ6cigO1QOgYOx2qWaYB6HSqY2G4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=s2cW43T4LSCWcZkCG/SFSI7pmTvayT2mtWSTmc1fWD9o8SoKdg8D5p1Wt0gUteawX Pu4gdZGZUP8Z20yBAW8zqduBDMCRoma8Lne8jXYz38siR/cLM0j+RCLI5iXp9zPu0S F2MFF4R39QU03P9Ze2wB0xLlujag1GN9vvJ1bK+297Q1tWFbIZ1Nl+Tl4qHeJXjuPc a4U5469lS1KNREv9lQqa66mWE3CkP4RNY2lHAw0KW/d1qFp8/grp6dN6khwt/16jOB LNWJDDYm+L7mHkTzY4bZN04b/IfW2FjoWLell4tIlTr7P0qAdejMkbH+/aR5IMHtyL Iw17bYAkYal7Q== Received: from smtp.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Thu, 26 Dec 2024 16:56:36 +0300 (MSK) From: Martin Kurbanov To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Ezra Buehler , Alexey Romanov , Frieder Schrempf CC: , , , Martin Kurbanov Subject: [PATCH v3 4/7] mtd: spinand: add start_page to otp layout Date: Thu, 26 Dec 2024 16:55:49 +0300 Message-ID: <20241226135623.43098-5-mmkurbanov@salutedevices.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241226135623.43098-1-mmkurbanov@salutedevices.com> References: <20241226135623.43098-1-mmkurbanov@salutedevices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: p-i-exch-a-m2.sberdevices.ru (172.24.196.120) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 190075 [Dec 26 2024] X-KSMG-AntiSpam-Version: 6.1.1.7 X-KSMG-AntiSpam-Envelope-From: mmkurbanov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 49 0.3.49 28b3b64a43732373258a371bd1554adb2caa23cb, {Tracking_from_domain_doesnt_match_to}, smtp.sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/12/26 12:50:00 #26919000 X-KSMG-AntiVirus-Status: Clean, skipped Content-Type: text/plain; charset="utf-8" The OTP area is divided into two parts: the factory and the user. In SPI-NAND, it is usually this one OTP region: the first few pages are allocated to the factory area. Therefore, enter the start_page field, which indicates from which page the custom OTP region starts. Signed-off-by: Martin Kurbanov --- include/linux/mtd/spinand.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 19d76057c0444..d6dbb85094283 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -325,9 +325,11 @@ struct spinand_ondie_ecc_conf { /** * struct spinand_otp_layout - structure to describe the SPI NAND OTP area * @npages: number of pages in the OTP + * @start_page: start page of the user OTP area. */ struct spinand_otp_layout { unsigned int npages; + unsigned int start_page; }; =20 /** @@ -417,10 +419,11 @@ struct spinand_info { #define SPINAND_SELECT_TARGET(__func) \ .select_target =3D __func, =20 -#define SPINAND_OTP_INFO(__npages, __ops) \ +#define SPINAND_OTP_INFO(__npages, __start_page, __ops) \ .otp =3D { \ .layout =3D { \ .npages =3D __npages, \ + .start_page =3D __start_page, \ }, \ .ops =3D __ops, \ } --=20 2.43.0