diff mbox series

[v6,1/3] dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code

Message ID 20240507230903.3399594-2-avkrasnov@salutedevices.com
State Not Applicable
Headers show
Series Meson: R/W support for pages used by boot ROM | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Arseniy Krasnov May 7, 2024, 11:09 p.m. UTC
Boot ROM code on Meson requires that some pages on NAND must be written
in special mode: "short" ECC mode where each block is 384 bytes and
scrambling mode is on. Such pages are located on the chip in the
following way (for example):

[ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ]
  ^           ^           ^           ^

pX is page number "X". "^" means "special" page used by boot ROM - e.g.
every 2nd page in the range of [0, 7]. Step (2 in example is set by
'amlogic,boot-page-step' field. Last page in range (7 in example) is
set by 'amlogic,boot-pages' field.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
---
 .../bindings/mtd/amlogic,meson-nand.yaml       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Rob Herring May 8, 2024, 2:09 p.m. UTC | #1
On Wed, 08 May 2024 02:09:01 +0300, Arseniy Krasnov wrote:
> Boot ROM code on Meson requires that some pages on NAND must be written
> in special mode: "short" ECC mode where each block is 384 bytes and
> scrambling mode is on. Such pages are located on the chip in the
> following way (for example):
> 
> [ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ]
>   ^           ^           ^           ^
> 
> pX is page number "X". "^" means "special" page used by boot ROM - e.g.
> every 2nd page in the range of [0, 7]. Step (2 in example is set by
> 'amlogic,boot-page-step' field. Last page in range (7 in example) is
> set by 'amlogic,boot-pages' field.
> 
> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
> ---
>  .../bindings/mtd/amlogic,meson-nand.yaml       | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 


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:

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Arseniy Krasnov May 12, 2024, 5:26 p.m. UTC | #2
Sorry, sending from proper mail client again (not sure it was delivered sent from gmail client on 08.05) :)

R-b was removed, because this patch was updated

Thanks, Arseniy

On 08.05.2024 20:07, Krasnov Arseniy wrote:
> Hi! I removed Your R-b because patch was changed in this version, after
> comments from Miquel Raynal
> 
> Thanks
> 
> ср, 8 мая 2024 г., 17:09 Rob Herring (Arm) <robh@kernel.org>:
> 
>>
>> On Wed, 08 May 2024 02:09:01 +0300, Arseniy Krasnov wrote:
>>> Boot ROM code on Meson requires that some pages on NAND must be written
>>> in special mode: "short" ECC mode where each block is 384 bytes and
>>> scrambling mode is on. Such pages are located on the chip in the
>>> following way (for example):
>>>
>>> [ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ]
>>>   ^           ^           ^           ^
>>>
>>> pX is page number "X". "^" means "special" page used by boot ROM - e.g.
>>> every 2nd page in the range of [0, 7]. Step (2 in example is set by
>>> 'amlogic,boot-page-step' field. Last page in range (7 in example) is
>>> set by 'amlogic,boot-pages' field.
>>>
>>> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
>>> ---
>>>  .../bindings/mtd/amlogic,meson-nand.yaml       | 18 ++++++++++++++++++
>>>  1 file changed, 18 insertions(+)
>>>
>>
>>
>> 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:
>>
>> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
>>
>>
>>
>>
>
Krzysztof Kozlowski May 13, 2024, 9:05 a.m. UTC | #3
On 12/05/2024 19:26, Arseniy Krasnov wrote:
> Sorry, sending from proper mail client again (not sure it was delivered sent from gmail client on 08.05) :)
> 
> R-b was removed, because this patch was updated

Then, as Rob requested, explain what changed and why the tag was
removed. There was nothing in this patch's changelog.


Best regards,
Krzysztof
Arseniy Krasnov May 13, 2024, 10:10 a.m. UTC | #4
Changelog:

v5 -> v6:

* Update description in 'yaml' and commit message by adding more details
  about such special Meson mode. R-b was removed so.

Thanks, Arseniy

On 08.05.2024 02:09, Arseniy Krasnov wrote:
> Boot ROM code on Meson requires that some pages on NAND must be written
> in special mode: "short" ECC mode where each block is 384 bytes and
> scrambling mode is on. Such pages are located on the chip in the
> following way (for example):
> 
> [ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ]
>   ^           ^           ^           ^
> 
> pX is page number "X". "^" means "special" page used by boot ROM - e.g.
> every 2nd page in the range of [0, 7]. Step (2 in example is set by
> 'amlogic,boot-page-step' field. Last page in range (7 in example) is
> set by 'amlogic,boot-pages' field.
> 
> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
> ---
>  .../bindings/mtd/amlogic,meson-nand.yaml       | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> index 57b6957c8415..284f0f882c32 100644
> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> @@ -64,11 +64,29 @@ patternProperties:
>          items:
>            maximum: 0
>  
> +      amlogic,boot-pages:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description:
> +          Number of pages starting from offset 0, where a special ECC
> +          configuration must be used because it is accessed by the ROM
> +          code. This ECC configuration uses 384 bytes data blocks.
> +          Also scrambling mode is enabled for such pages.
> +
> +      amlogic,boot-page-step:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description:
> +          Interval between pages, accessed by the ROM code. For example
> +          we have 8 pages [0, 7]. Pages 0,2,4,6 are accessed by the
> +          ROM code, so this field will be 2 (e.g. every 2nd page). Rest
> +          of pages - 1,3,5,7 are read/written without this mode.
> +
>      unevaluatedProperties: false
>  
>      dependencies:
>        nand-ecc-strength: [nand-ecc-step-size]
>        nand-ecc-step-size: [nand-ecc-strength]
> +      amlogic,boot-pages: [nand-is-boot-medium, "amlogic,boot-page-step"]
> +      amlogic,boot-page-step: [nand-is-boot-medium, "amlogic,boot-pages"]
>  
>  
>  required:
Miquel Raynal May 27, 2024, 12:19 p.m. UTC | #5
On Tue, 2024-05-07 at 23:09:01 UTC, Arseniy Krasnov wrote:
> Boot ROM code on Meson requires that some pages on NAND must be written
> in special mode: "short" ECC mode where each block is 384 bytes and
> scrambling mode is on. Such pages are located on the chip in the
> following way (for example):
> 
> [ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ]
>   ^           ^           ^           ^
> 
> pX is page number "X". "^" means "special" page used by boot ROM - e.g.
> every 2nd page in the range of [0, 7]. Step (2 in example is set by
> 'amlogic,boot-page-step' field. Last page in range (7 in example) is
> set by 'amlogic,boot-pages' field.
> 
> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
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 57b6957c8415..284f0f882c32 100644
--- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
@@ -64,11 +64,29 @@  patternProperties:
         items:
           maximum: 0
 
+      amlogic,boot-pages:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Number of pages starting from offset 0, where a special ECC
+          configuration must be used because it is accessed by the ROM
+          code. This ECC configuration uses 384 bytes data blocks.
+          Also scrambling mode is enabled for such pages.
+
+      amlogic,boot-page-step:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Interval between pages, accessed by the ROM code. For example
+          we have 8 pages [0, 7]. Pages 0,2,4,6 are accessed by the
+          ROM code, so this field will be 2 (e.g. every 2nd page). Rest
+          of pages - 1,3,5,7 are read/written without this mode.
+
     unevaluatedProperties: false
 
     dependencies:
       nand-ecc-strength: [nand-ecc-step-size]
       nand-ecc-step-size: [nand-ecc-strength]
+      amlogic,boot-pages: [nand-is-boot-medium, "amlogic,boot-page-step"]
+      amlogic,boot-page-step: [nand-is-boot-medium, "amlogic,boot-pages"]
 
 
 required: