From patchwork Mon Aug 26 06:04:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 1976577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=salutedevices.com header.i=@salutedevices.com header.a=rsa-sha256 header.s=mail header.b=mPdfHInd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WsgSl1zzFz1yZd for ; Mon, 26 Aug 2024 16:17:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0789388846; Mon, 26 Aug 2024 08:17:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=salutedevices.com header.i=@salutedevices.com header.b="mPdfHInd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2514B88840; Mon, 26 Aug 2024 08:17:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7AA668831F for ; Mon, 26 Aug 2024 08:17:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=avkrasnov@salutedevices.com Received: from p-infra-ksmg-sc-msk02.sberdevices.ru (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id E5029120008; Mon, 26 Aug 2024 09:17:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru E5029120008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1724653030; bh=zj/bAFyAmzrMgz04rnhp+Ihd/G1cVWD/23kiqlNChkU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=mPdfHIndBerRNFIXFmRt0c0J5mw02cypHgE97408ox3XxWpXGYBeOs7cLOmJXuRiI 2YkL9+3dytoSawb59NvJWrOyIrvFItKg1ICqszbfvrJFn4YW/yYgZuTxRliZKyr5/Q SVw57F5NSSCYTSBpx9ppib+03j/8i+XLzAHd46sWtOyDIwUNEv/W4xS6QNUo5j9dfS DlpQjEjUY9670t4nA+0aOwQLDHFeCFdesk6I87VNuuJaPLOXm82Z2zBehL0SWUH+Ht IPH7KQhdCzdpp7LqLAKwvjfofSTi5n+FoTTLPrOKAt1EuRaEK/hRijqaSI/o2ugdoI UiLj38MdR9Ruw== 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; Mon, 26 Aug 2024 09:17:10 +0300 (MSK) From: Arseniy Krasnov To: Dario Binacchi , Michael Trimarchi , Neil Armstrong , Miquel Raynal , Tom Rini , Sean Anderson CC: , , , , Subject: [RESEND PATCH v2 0/3] Meson: R/W support for pages used by boot ROM Date: Mon, 26 Aug 2024 09:04:08 +0300 Message-ID: <20240826060411.3532105-1-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 X-Originating-IP: [172.28.161.232] X-ClientProxiedBy: p-i-exch-a-m2.sberdevices.ru (172.24.196.120) To p-i-exch-a-m1.sberdevices.ru (172.24.196.116) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 187287 [Aug 26 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: avkrasnov@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: 27 0.3.27 71302da218a62dcd84ac43314e19b5cc6b38e0b6, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; smtp.sberdevices.ru:7.1.1,5.0.1; salutedevices.com:7.1.1; lore.kernel.org:7.1.1; 127.0.0.199:7.1.2, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2024/08/26 04:18:00 X-KSMG-LinksScanning: Clean, bases: 2024/08/26 04:18:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/08/26 02:45:00 #26434133 X-KSMG-AntiVirus-Status: Clean, skipped X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Patchset is based on patchset for Linux (today merged to nand-next): https://lore.kernel.org/linux-mtd/20240507230903.3399594-1-avkrasnov@salutedevices.com/ Here is description from it: > Amlogic's boot ROM code needs that some pages on NAND must be written > in special "short" ECC mode with scrambling enabled. Such pages: > 1) Contain some metadata about hardware. > 2) Located with some interval starting from 0 offset, until some > specified offset. Interval and second offset are set in the > device tree. > > This patchset adds R/W support for such pages. To enable it we can setup > it in dts: > > nand-is-boot-medium; > amlogic,boot-pages = <1024>; > amlogic,boot-page-step = <128>; > > It means that each 128th page in range 0 to 1024 pages will be accessed > in special mode ("short" ECC + scrambling). In practice this feature is > needed when we want to update first block of NAND - driver will enable > required mode by itself using value from device tree. The only difference is that patchset for Linux updates DT bindings, while this adds NAND_IS_BOOT_MEDIUM flag support. Changelog: v1 -> v2: * Pls see per-patch changelog. Arseniy Krasnov (3): mtd: rawnand: nand_base: support for 'NAND_IS_BOOT_MEDIUM' flag mtd: rawnand: meson: refactor use of 'meson_nfc_cmd_access()' mtd: rawnand: meson: read/write access for boot ROM pages drivers/mtd/nand/raw/meson_nand.c | 84 +++++++++++++++++++++---------- drivers/mtd/nand/raw/nand_base.c | 3 ++ include/linux/mtd/rawnand.h | 5 ++ 3 files changed, 65 insertions(+), 27 deletions(-)