Message ID | 20230705065434.297040-2-AVKrasnov@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1697715vqx; Wed, 5 Jul 2023 00:48:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKHjdfkjJfVsbEcvBXxUphYzOugz+E4mdTpAH6QoVqzN6G+ZFnSyiDrVMDJEIopFpiV1Sq X-Received: by 2002:a05:6a00:1593:b0:681:c372:5aa4 with SMTP id u19-20020a056a00159300b00681c3725aa4mr21749745pfk.27.1688543296509; Wed, 05 Jul 2023 00:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688543296; cv=none; d=google.com; s=arc-20160816; b=ip13cAO2H2o5G2vv1oz50Q3WrT7WdcJMKSUkieV9f/b85+vi+1FjQOy+sq+NNFUyqL ERtr6TFiHv0Qvp/JQO8MRa3tkAEYZ5lUjCTds7MMF644VRNhoCK7PYzDeAFovhAUguZe lK+vQkqPC6mPqyxgMTx4t1y8ufFktRBwOg36t4JEdH4zk1T5IMOZniK/FY5B7mgdAPM9 d1JEGRilFAdQwtzKltLlU7LQN5wyJqofhe3G07tPJ8qHW89R6BlEJXZ9Dlq1/pdYJ/qP WerIFIBy1B502iz6T5c7/USh8qDnJBaBgapmA4LxWoYPu0JCHCsh959QNSXjohUGukxU AS3A== 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:dkim-filter; bh=KDFRo1F/relYiH5qRzc6WXkSpODxtEkzOUDJOWSBCEw=; fh=lJoip+811P4DCdtapn8hp1VALdd89JRa/wJoc6Om3Qk=; b=LbfMjKcnQPITUNkMgJuWGrCJEYOYd8aX3hW29aKXuJ4JoC2DFY61xOlR/NLpY2btMh nlF4VI1Zi+MrimNqXDf6rcd9HzZXcSFOy0mv6TGXyGna28FXVk4MFf+2ilWKMDW8m10o 0H3CeJFLIp/e8zHzVyy94Im7flpFfPRvJC3roC+tbPGksY79744dkbu0FvsqLan7NetZ i+phNdn3R/fNwaCl+02rbJyfB6G4ggWa/CjVgR6/3bYqzoXUFYJiZhvnIyCo/9L7sAmD 2KTAVh3KqyqZkfEXX6goMFAQSU6xlFAxLWDPwjbXSe999qAJ9RFVOJiXS7MMNaMtxI2+ 7JjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=dJa7Ur4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck11-20020a056a00328b00b0068255360b93si12077934pfb.332.2023.07.05.00.48.04; Wed, 05 Jul 2023 00:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=dJa7Ur4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231585AbjGEHAI (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 03:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231986AbjGEHAE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 03:00:04 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FA671A4; Wed, 5 Jul 2023 00:00:02 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 4E445120056; Wed, 5 Jul 2023 10:00:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 4E445120056 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688540400; bh=KDFRo1F/relYiH5qRzc6WXkSpODxtEkzOUDJOWSBCEw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=dJa7Ur4iM+RCVlUFdCD+Q1yR594sRZWgK0QsNJ0LmHZ4DuT83gj9O1d+MfAb/nDpr GxVfueuk8VnIM4ADA1U14LrezD4iLNsLm0+JGPN9Gon5wJDNmDGAvvgUGDf07JQB7a 5LlOtjPUiGsDYRTQQVlmJ9bGzbttpgvDJ6cSXZE1QmHhcOejy+ooxQXFF3v7BuIXRO MR4NVNezE7BCrMvzlpIrq2i4G3tfY4Xm/R/k2+OrFEDPW96MXhCZze68AlaGxKOpg3 5w4m+qyPSFJ2CCskZXMIMYuZgwNOJWNTnqug8hUu3uPh7hRwWdTHKNdUxsn0FSzoqs x8qVznTQz/pgg== Received: from p-i-exch-sc-m01.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; Wed, 5 Jul 2023 10:00:00 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 09:59:58 +0300 From: Arseniy Krasnov <AVKrasnov@sberdevices.ru> To: Liang Yang <liang.yang@amlogic.com>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Neil Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com> CC: <oxffffaa@gmail.com>, <kernel@sberdevices.ru>, Arseniy Krasnov <AVKrasnov@sberdevices.ru>, <linux-mtd@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-amlogic@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [RFC PATCH v2 1/2] dt-bindings: nand: meson: support for 512B ECC step size Date: Wed, 5 Jul 2023 09:54:33 +0300 Message-ID: <20230705065434.297040-2-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230705065434.297040-1-AVKrasnov@sberdevices.ru> References: <20230705065434.297040-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) 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: 178437 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: AVKrasnov@sberdevices.ru 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: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;sberdevices.ru:7.1.1,5.0.1;100.64.160.123:7.1.2, FromAlignment: s, {Tracking_white_helo}, 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: 2023/07/05 01:35:00 #21564271 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770565975280037788?= X-GMAIL-MSGID: =?utf-8?q?1770565975280037788?= |
Series |
support 512B ECC step size for Meson NAND
|
|
Commit Message
Arseniy Krasnov
July 5, 2023, 6:54 a.m. UTC
Meson NAND supports both 512B and 1024B ECC step size, so replace
'const' for only 1024B step size with enum for both sizes.
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
---
Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
Hi Arseniy, AVKrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 09:54:33 +0300: > Meson NAND supports both 512B and 1024B ECC step size, so replace > 'const' for only 1024B step size with enum for both sizes. > > Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> > --- > Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > index 3bec8af91bbb..81ca8828731a 100644 > --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > @@ -49,7 +49,8 @@ patternProperties: > const: hw > > nand-ecc-step-size: > - const: 1024 > + enum: [512, 1024] > + default: 1024 I was actually wrong in my previous review, there is no strong default here as the existing binding (and code) try to use the closest parameters required by the NAND chip: we pick the "optimal" configuration. So if you don't provide any value here, we expect the strength and step size advertized by the chip to be used. This is a common default in the raw NAND subsystem. Please drop the default line, re-integrate the missing R-by tag from Rob and in a separate patch please mark nand-ecc-step-size and nand-ecc-strength mandatory if the other is provide. IOW, we expect either both, or none of them, but not a single one. > > nand-ecc-strength: > enum: [8, 16, 24, 30, 40, 50, 60] > @@ -93,6 +94,7 @@ examples: > nand@0 { > reg = <0>; > nand-rb = <0>; > + nand-ecc-step-size = <1024>; So in the end this line is wrong and once you get the description right as I mentioned it above, this will fail to pass `make DT_SCHEMA_FILES=Documentation/devicetree/bindings/mtd/ dt_binidng_check` Please drop it from the example, don't add the second property here, it's best to show a clean example where people stop tampering for no reason with the optimal values. > }; > }; > Thanks, Miquèl
On 05.07.2023 10:37, Miquel Raynal wrote: > Hi Arseniy, > > AVKrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 09:54:33 +0300: > >> Meson NAND supports both 512B and 1024B ECC step size, so replace >> 'const' for only 1024B step size with enum for both sizes. >> >> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >> --- >> Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml >> index 3bec8af91bbb..81ca8828731a 100644 >> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml >> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml >> @@ -49,7 +49,8 @@ patternProperties: >> const: hw >> >> nand-ecc-step-size: >> - const: 1024 >> + enum: [512, 1024] >> + default: 1024 > > I was actually wrong in my previous review, there is no strong default > here as the existing binding (and code) try to use the closest > parameters required by the NAND chip: we pick the "optimal" > configuration. So if you don't provide any value here, we expect > the strength and step size advertized by the chip to be used. This is a > common default in the raw NAND subsystem. > > Please drop the default line, re-integrate the missing R-by tag from > Rob and in a separate patch please mark nand-ecc-step-size and > nand-ecc-strength mandatory if the other is provide. IOW, we expect > either both, or none of them, but not a single one. I see, no problem! "mandatory" means update description of both fields like: description: Mandatory if nand-ecc-step-size is set. etc. ? > >> >> nand-ecc-strength: >> enum: [8, 16, 24, 30, 40, 50, 60] >> @@ -93,6 +94,7 @@ examples: >> nand@0 { >> reg = <0>; >> nand-rb = <0>; >> + nand-ecc-step-size = <1024>; > > So in the end this line is wrong and once you get the description right > as I mentioned it above, this will fail to pass > `make DT_SCHEMA_FILES=Documentation/devicetree/bindings/mtd/ dt_binidng_check` > Please drop it from the example, don't add the second property here, > it's best to show a clean example where people stop tampering for no > reason with the optimal values. Ok! Thanks, Arseniy > >> }; >> }; >> > > > Thanks, > Miquèl
Hi Arseniy, avkrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 11:03:30 +0300: > On 05.07.2023 10:37, Miquel Raynal wrote: > > Hi Arseniy, > > > > AVKrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 09:54:33 +0300: > > > >> Meson NAND supports both 512B and 1024B ECC step size, so replace > >> 'const' for only 1024B step size with enum for both sizes. > >> > >> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> > >> --- > >> Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++- > >> 1 file changed, 3 insertions(+), 1 deletion(-) > >> > >> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > >> index 3bec8af91bbb..81ca8828731a 100644 > >> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > >> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > >> @@ -49,7 +49,8 @@ patternProperties: > >> const: hw > >> > >> nand-ecc-step-size: > >> - const: 1024 > >> + enum: [512, 1024] > >> + default: 1024 > > > > I was actually wrong in my previous review, there is no strong default > > here as the existing binding (and code) try to use the closest > > parameters required by the NAND chip: we pick the "optimal" > > configuration. So if you don't provide any value here, we expect > > the strength and step size advertized by the chip to be used. This is a > > common default in the raw NAND subsystem. > > > > Please drop the default line, re-integrate the missing R-by tag from > > Rob and in a separate patch please mark nand-ecc-step-size and > > nand-ecc-strength mandatory if the other is provide. IOW, we expect > > either both, or none of them, but not a single one. > > I see, no problem! "mandatory" means update description of both fields like: > > description: > Mandatory if nand-ecc-step-size is set. Nope :-) Something along: allOf: - if: <nand-chip>: properties: contains: - nand-ecc-step-size then: required: <nand-chip>: properties: - nand-ecc-strength And same with the opposite logic. > > etc. > > ? > > > > >> > >> nand-ecc-strength: > >> enum: [8, 16, 24, 30, 40, 50, 60] > >> @@ -93,6 +94,7 @@ examples: > >> nand@0 { > >> reg = <0>; > >> nand-rb = <0>; > >> + nand-ecc-step-size = <1024>; > > > > So in the end this line is wrong and once you get the description right > > as I mentioned it above, this will fail to pass > > `make DT_SCHEMA_FILES=Documentation/devicetree/bindings/mtd/ dt_binidng_check` > > Please drop it from the example, don't add the second property here, > > it's best to show a clean example where people stop tampering for no > > reason with the optimal values. > > Ok! > > Thanks, Arseniy > > > > >> }; > >> }; > >> > > > > > > Thanks, > > Miquèl Thanks, Miquèl
On Wed, 05 Jul 2023 09:54:33 +0300, Arseniy Krasnov wrote: > Meson NAND supports both 512B and 1024B ECC step size, so replace > 'const' for only 1024B step size with enum for both sizes. > > Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> > --- > Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply. If a tag was not added on purpose, please state why and what changed. Missing tags: Acked-by: Rob Herring <robh@kernel.org>
On 05.07.2023 11:22, Miquel Raynal wrote: > Hi Arseniy, > > avkrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 11:03:30 +0300: > >> On 05.07.2023 10:37, Miquel Raynal wrote: >>> Hi Arseniy, >>> >>> AVKrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 09:54:33 +0300: >>> >>>> Meson NAND supports both 512B and 1024B ECC step size, so replace >>>> 'const' for only 1024B step size with enum for both sizes. >>>> >>>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >>>> --- >>>> Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++- >>>> 1 file changed, 3 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml >>>> index 3bec8af91bbb..81ca8828731a 100644 >>>> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml >>>> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml >>>> @@ -49,7 +49,8 @@ patternProperties: >>>> const: hw >>>> >>>> nand-ecc-step-size: >>>> - const: 1024 >>>> + enum: [512, 1024] >>>> + default: 1024 >>> >>> I was actually wrong in my previous review, there is no strong default >>> here as the existing binding (and code) try to use the closest >>> parameters required by the NAND chip: we pick the "optimal" >>> configuration. So if you don't provide any value here, we expect >>> the strength and step size advertized by the chip to be used. This is a >>> common default in the raw NAND subsystem. >>> >>> Please drop the default line, re-integrate the missing R-by tag from >>> Rob and in a separate patch please mark nand-ecc-step-size and >>> nand-ecc-strength mandatory if the other is provide. IOW, we expect >>> either both, or none of them, but not a single one. >> >> I see, no problem! "mandatory" means update description of both fields like: >> >> description: >> Mandatory if nand-ecc-step-size is set. > > Nope :-) > > Something along: > > allOf: > - if: > <nand-chip>: > properties: > contains: > - nand-ecc-step-size > then: > required: > <nand-chip>: > properties: > - nand-ecc-strength > > And same with the opposite logic. I see, thanks! And this should be for all nand chips, not only Amlogic? I mean in nand-chip.yaml? I'll include it as third patch in this patchset. Thanks, Arseniy > >> >> etc. >> >> ? >> >>> >>>> >>>> nand-ecc-strength: >>>> enum: [8, 16, 24, 30, 40, 50, 60] >>>> @@ -93,6 +94,7 @@ examples: >>>> nand@0 { >>>> reg = <0>; >>>> nand-rb = <0>; >>>> + nand-ecc-step-size = <1024>; >>> >>> So in the end this line is wrong and once you get the description right >>> as I mentioned it above, this will fail to pass >>> `make DT_SCHEMA_FILES=Documentation/devicetree/bindings/mtd/ dt_binidng_check` >>> Please drop it from the example, don't add the second property here, >>> it's best to show a clean example where people stop tampering for no >>> reason with the optimal values. >> >> Ok! >> >> Thanks, Arseniy >> >>> >>>> }; >>>> }; >>>> >>> >>> >>> Thanks, >>> Miquèl > > > Thanks, > Miquèl
Hi Arseniy, avkrasnov@sberdevices.ru wrote on Thu, 6 Jul 2023 08:57:00 +0300: > On 05.07.2023 11:22, Miquel Raynal wrote: > > Hi Arseniy, > > > > avkrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 11:03:30 +0300: > > > >> On 05.07.2023 10:37, Miquel Raynal wrote: > >>> Hi Arseniy, > >>> > >>> AVKrasnov@sberdevices.ru wrote on Wed, 5 Jul 2023 09:54:33 +0300: > >>> > >>>> Meson NAND supports both 512B and 1024B ECC step size, so replace > >>>> 'const' for only 1024B step size with enum for both sizes. > >>>> > >>>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> > >>>> --- > >>>> Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 +++- > >>>> 1 file changed, 3 insertions(+), 1 deletion(-) > >>>> > >>>> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > >>>> index 3bec8af91bbb..81ca8828731a 100644 > >>>> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > >>>> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml > >>>> @@ -49,7 +49,8 @@ patternProperties: > >>>> const: hw > >>>> > >>>> nand-ecc-step-size: > >>>> - const: 1024 > >>>> + enum: [512, 1024] > >>>> + default: 1024 > >>> > >>> I was actually wrong in my previous review, there is no strong default > >>> here as the existing binding (and code) try to use the closest > >>> parameters required by the NAND chip: we pick the "optimal" > >>> configuration. So if you don't provide any value here, we expect > >>> the strength and step size advertized by the chip to be used. This is a > >>> common default in the raw NAND subsystem. > >>> > >>> Please drop the default line, re-integrate the missing R-by tag from > >>> Rob and in a separate patch please mark nand-ecc-step-size and > >>> nand-ecc-strength mandatory if the other is provide. IOW, we expect > >>> either both, or none of them, but not a single one. > >> > >> I see, no problem! "mandatory" means update description of both fields like: > >> > >> description: > >> Mandatory if nand-ecc-step-size is set. > > > > Nope :-) > > > > Something along: > > > > allOf: > > - if: > > <nand-chip>: > > properties: > > contains: > > - nand-ecc-step-size > > then: > > required: > > <nand-chip>: > > properties: > > - nand-ecc-strength > > > > And same with the opposite logic. > > I see, thanks! And this should be for all nand chips, not only Amlogic? I mean in > nand-chip.yaml? Some drivers can directly manage the user requests in terms of either step size *or* strength, so I would keep this into the Amlogic file for now. > I'll include it as third patch in this patchset. > > Thanks, Arseniy Thanks, Miquèl
diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml index 3bec8af91bbb..81ca8828731a 100644 --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml @@ -49,7 +49,8 @@ patternProperties: const: hw nand-ecc-step-size: - const: 1024 + enum: [512, 1024] + default: 1024 nand-ecc-strength: enum: [8, 16, 24, 30, 40, 50, 60] @@ -93,6 +94,7 @@ examples: nand@0 { reg = <0>; nand-rb = <0>; + nand-ecc-step-size = <1024>; }; };