Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp180227lqo; Tue, 7 May 2024 16:59:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIss4oIR/FrlR/B0ydmDNCvcytrzgJ6AFIzXaB0+sfzZtA5hV5+b1j/8HYSwNBRns9MDbEBJDIysGeTOMecsInwQOer1HDf668FsVF+A== X-Google-Smtp-Source: AGHT+IHrlOdDEHuDDbZIdJ4gY0/wtef4IXs7DiJzqBIsP3vRAt3EkKl7iyC7xSrdMFIe+zGOa7hx X-Received: by 2002:a17:906:c34b:b0:a59:aa1f:55bd with SMTP id a640c23a62f3a-a59fa865d2dmr107007866b.6.1715126359451; Tue, 07 May 2024 16:59:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715126359; cv=pass; d=google.com; s=arc-20160816; b=xbntoXMQg6niQv2BzK3qCYK2ZmiPkaGLvSfWLJaMcocanXRuM2GK3cwq5jWLEMXE2S ioT1127NuwGnlLGNz+6jVr58qVvvsoGfjEszGJZRp0nksLwCvPE4EATZJrWe9WdcXp/o IDu4pSO87qapGTotXKa4/YIdEc6mLGMxccXVnvFAbvdMCJZBblLwHuAiC78CRBggc8Gt SBy6oF14RwuqE0w8WcVnjuNrDfB56nazZreMVk9aR7zhVOBbOQ6zqHoLhYAsIrb7aFn0 fHleGLRnTNZZ1/JntkM8V7FkfCa69hvO99U1bWOyzbN1B295A71aslHWG2aptN6qxskz Ngzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=FTEc3DcCrnODzUlI904uenRxffR/nTndkV7UF8lCKs0=; fh=nhecQrwVApGCu1TdcailefrHyWo/zWU/hH6HfNaDWJI=; b=Z1nyNfXZ/OICRGPe5mTFT8k19+4VATWZ7zIn84/1N/vpHUUFs+iOtBGihIox6yZDU3 uO5T2nCMKJyGSHY2ecKBxghkuImUMTqIsH/09m0xcUNq58MzLhufrxqWdqweS5p9d/e5 AUvIfFsYwEdm2Xy13DKdIY/TCaFJOAlhcNgVivKXIoIHAmv/TGc3oAM3hF3IviOCZ9zL Zp1V+f+AbLe0u0/Vmku8Ub4gv+u8WHNOQLY/HTEZWEAI4+cCRMzc3xdcAp2Qtq88w3Xf BkbZfUp6M8HYZJj6qH0WGP0XWLFepn5Vg/ECgourRiCDaXo28t88YPz+/TKi6MMhKpOV W6OA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=MOaqecEa; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-172504-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t21-20020a170906a11500b00a5928453723si6589663ejy.459.2024.05.07.16.59.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172504-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=MOaqecEa; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-172504-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 313F71F227E5 for ; Tue, 7 May 2024 23:59:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBD3E13AA56; Tue, 7 May 2024 23:20:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="MOaqecEa" 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id 8433212B148; Tue, 7 May 2024 23:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.89.224.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715124007; cv=none; b=rI5vxonSf0NCMU9VXfjbYZ3be+ns5cVLRIhaSPl4RbX9fyl4lPAU4/t+A29kAIK4SXV0YvF3YBhgBr70R5dmXR9iqIWpFxqNY8RxTZgfWb3c7jlkwWWBk+1iHscUWD1v8S2CEMNx8m04zAx0n/tROJpkheQSq7nnvVlMd1EbLFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715124007; c=relaxed/simple; bh=b/0FkzHkilB95lUbP7MEunDu86ZpEsqHeKZVNfq+xIQ=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=MXKKs87FIjwrV8lqELe+BqW0DDvAlK/FPyKjJSM/vDVHuuD3Pw49k6aPw3JLfte9mkAzzQipLH5tJrUxWpKM9U/fHbvGBvSSJTJiEOOkbY29n+EVBCuOcMfY1KiezzsZmaueSVUYVtUOGdH+16o/3E8wLCj14V5RQJ/VeHfFspY= 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=MOaqecEa; arc=none smtp.client-ip=45.89.224.132 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 Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 99472120005; Wed, 8 May 2024 02:19:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 99472120005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1715123999; bh=FTEc3DcCrnODzUlI904uenRxffR/nTndkV7UF8lCKs0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=MOaqecEa7KzpL1uHnPOVQMAfm++G+nohFnyBcWYFaRlh/G0AO9QWjk82Et1kkHApv YDOkYJZt5Aar9dxZo5Cy2Hms33xkHc+AGcUS07i8C2OSlSQGZTiB8KaZtJUSzTqAnG OP7pLGOXuyUQ8V9w/tThPVtkNlrt7QEDoOyC8izhFQzAodLGoiZjafSqOEXq98jBqd R0zSh/eyDeuDttGiM+DeL9OoAXyWWIyJ/OxNWSfbvEaCbYwvkHHey23l5Sv1ktgK8P 2vy/Cz2tPB5M2HcbRB7gN+zCXH6TuwS+v+TtKXddyXVo+uzjmJJ4g14mGMg2FjlDwx FvZ2+VVkv5mMA== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 8 May 2024 02:19:59 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 8 May 2024 02:19:58 +0300 From: Arseniy Krasnov To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl CC: , , , , , , , Arseniy Krasnov Subject: [PATCH v6 0/3] Meson: R/W support for pages used by boot ROM Date: Wed, 8 May 2024 02:09:00 +0300 Message-ID: <20240507230903.3399594-1-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 185123 [May 07 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: 19 0.3.19 07c7fa124d1a1dc9662cdc5aace418c06ae99d2b, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;smtp.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 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/05/07 17:58:00 #25118681 X-KSMG-AntiVirus-Status: Clean, skipped 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. Changelog: v1 -> v2: * Rename 'meson,boot-page-XXX' -> 'amlogic,boot-page-XXX'. * Add words that 'amlogic,boot-page-step' is measured in pages. * Remove words that 'amlogic,boot-page-XXX' depends on 'nand-is-boot-medium'. * Make both 'amlogic,boot-page-XXX' depend on each other also, in addition to 'nand-is-boot-medium' dependency. v2 -> v3: * Add quotes to 0001 in dependencies. This fixes 'make dt_binding_check' warning. v3 -> v4: * Rename 'amlogic,boot-page-last' to 'amlogic,boot-pages'. v4 -> v5: * Update 'description' fields in bindings. v5 -> v6: * Split patch for meson_nand.c to 2 patches: first is refactoring of scrambling mode handling, another is support for special pages for boot ROM. * Update description and commit message in the bindings patch. Arseniy Krasnov (3): dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code mtd: rawnand: meson: refactor use of 'meson_nfc_cmd_access()' mtd: rawnand: meson: read/write access for boot ROM pages .../bindings/mtd/amlogic,meson-nand.yaml | 18 ++++ drivers/mtd/nand/raw/meson_nand.c | 86 +++++++++++++------ 2 files changed, 77 insertions(+), 27 deletions(-) -- 2.35.0