diff mbox series

[RFC,v3,2/3] dt-bindings: nand: meson: make ECC properties dependent

Message ID 20230711122129.2635558-3-AVKrasnov@sberdevices.ru (mailing list archive)
State Superseded
Headers show
Series support 512B ECC step size for Meson NAND | expand

Commit Message

Arseniy Krasnov July 11, 2023, 12:21 p.m. UTC
ECC properties 'nand-ecc-strength' and 'nand-ecc-step-size' depends on
each other, so they must be both either set or not set. In first case
ECC core will try to use these values if possible (by checking ECC caps
provided by driver), in second case ECC core will select most optimal
values for both properties.

Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
---
 Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Rob Herring July 14, 2023, 3:55 p.m. UTC | #1
On Tue, Jul 11, 2023 at 03:21:28PM +0300, Arseniy Krasnov wrote:
> ECC properties 'nand-ecc-strength' and 'nand-ecc-step-size' depends on
> each other, so they must be both either set or not set. 

Is that true for all drivers or just meson?

> In first case
> ECC core will try to use these values if possible (by checking ECC caps
> provided by driver), in second case ECC core will select most optimal
> values for both properties.
> 
> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
> ---
>  Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> index e81757c9e0ed..4f6e56542a7e 100644
> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> @@ -58,6 +58,10 @@ patternProperties:
>              meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
>              meson-axg-nfc 8
>  
> +    dependencies:
> +      nand-ecc-strength: ['nand-ecc-step-size']
> +      nand-ecc-step-size: ['nand-ecc-strength']
> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.35.0
>
Arseniy Krasnov July 14, 2023, 7:22 p.m. UTC | #2
On 14.07.2023 18:55, Rob Herring wrote:
> On Tue, Jul 11, 2023 at 03:21:28PM +0300, Arseniy Krasnov wrote:
>> ECC properties 'nand-ecc-strength' and 'nand-ecc-step-size' depends on
>> each other, so they must be both either set or not set. 
> 
> Is that true for all drivers or just meson?

As Miquel Raynal suggested, this will be implemented only for Meson driver at this moment.
Here is link with reply:
https://lore.kernel.org/linux-mtd/20230705065434.297040-1-AVKrasnov@sberdevices.ru/T/#m88705a0039fb30c18a9bb2b03a1add5f7e212a3b

Thanks, Arseniy

> 
>> In first case
>> ECC core will try to use these values if possible (by checking ECC caps
>> provided by driver), in second case ECC core will select most optimal
>> values for both properties.
>>
>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
>> ---
>>  Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>> index e81757c9e0ed..4f6e56542a7e 100644
>> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>> @@ -58,6 +58,10 @@ patternProperties:
>>              meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
>>              meson-axg-nfc 8
>>  
>> +    dependencies:
>> +      nand-ecc-strength: ['nand-ecc-step-size']
>> +      nand-ecc-step-size: ['nand-ecc-strength']
>> +
>>  required:
>>    - compatible
>>    - reg
>> -- 
>> 2.35.0
>>
Rob Herring July 14, 2023, 8:44 p.m. UTC | #3
On Tue, 11 Jul 2023 15:21:28 +0300, Arseniy Krasnov wrote:
> ECC properties 'nand-ecc-strength' and 'nand-ecc-step-size' depends on
> each other, so they must be both either set or not set. In first case
> ECC core will try to use these values if possible (by checking ECC caps
> provided by driver), in second case ECC core will select most optimal
> values for both properties.
> 
> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
> ---
>  Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
index e81757c9e0ed..4f6e56542a7e 100644
--- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
@@ -58,6 +58,10 @@  patternProperties:
             meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
             meson-axg-nfc 8
 
+    dependencies:
+      nand-ecc-strength: ['nand-ecc-step-size']
+      nand-ecc-step-size: ['nand-ecc-strength']
+
 required:
   - compatible
   - reg