[v5,03/12] dt-bindings: mtd: brcmnand: Add ecc strap property

Message ID 20240207202257.271784-4-william.zhang@broadcom.com
State New
Headers
Series mtd: rawnand: brcmnand: driver and doc updates |

Commit Message

William Zhang Feb. 7, 2024, 8:22 p.m. UTC
  Add brcm,nand-ecc-use-strap to get ecc and spare area size settings from
board boot strap for broadband board designs because they do not specify
ecc setting in dts but rather using the strap setting.

Signed-off-by: William Zhang <william.zhang@broadcom.com>

---

Changes in v5:
- Update the description for this ecc strap property
- Add check to make sure brcm,nand-ecc-use-strap and
  nand-ecc-strength/brcm,nand-oob-sector-size can not be used at the
  same time

Changes in v4:
- Move ecc strap property to this separate patch and remove some
non-binding related text from the description

Changes in v3: None
Changes in v2: None

 .../bindings/mtd/brcm,brcmnand.yaml           | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Comments

Conor Dooley Feb. 9, 2024, 5:42 p.m. UTC | #1
On Wed, Feb 07, 2024 at 12:22:48PM -0800, William Zhang wrote:
> Add brcm,nand-ecc-use-strap to get ecc and spare area size settings from
> board boot strap for broadband board designs because they do not specify
> ecc setting in dts but rather using the strap setting.
> 
> Signed-off-by: William Zhang <william.zhang@broadcom.com>

If Miquel is happy with this, then I am too.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> 
> ---
> 
> Changes in v5:
> - Update the description for this ecc strap property
> - Add check to make sure brcm,nand-ecc-use-strap and
>   nand-ecc-strength/brcm,nand-oob-sector-size can not be used at the
>   same time
> 
> Changes in v4:
> - Move ecc strap property to this separate patch and remove some
> non-binding related text from the description
> 
> Changes in v3: None
> Changes in v2: None
> 
>  .../bindings/mtd/brcm,brcmnand.yaml           | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
> index 6a717bcedfd3..52a4c993b6f1 100644
> --- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
> +++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
> @@ -146,6 +146,13 @@ patternProperties:
>            layout.
>          $ref: /schemas/types.yaml#/definitions/uint32
>  
> +      brcm,nand-ecc-use-strap:
> +        description:
> +          This property requires the host system to get the ECC strength
> +          and step size from the SoC NAND boot strap setting. This is a
> +          common hardware design on BCMBCA based boards.
> +        $ref: /schemas/types.yaml#/definitions/flag
> +
>      unevaluatedProperties: false
>  
>  allOf:
> @@ -195,6 +202,18 @@ allOf:
>        required:
>          - interrupt-names
>  
> +  - if:
> +      patternProperties:
> +        "^nand@[a-f0-9]$":
> +          required:
> +            - brcm,nand-ecc-use-strap
> +    then:
> +      patternProperties:
> +        "^nand@[a-f0-9]$":
> +          properties:
> +            nand-ecc-strength: false
> +            brcm,nand-oob-sector-size: false
> +
>  unevaluatedProperties: false
>  
>  required:
> -- 
> 2.37.3
>
  
Miquel Raynal Feb. 20, 2024, 9:56 a.m. UTC | #2
Hi William,

william.zhang@broadcom.com wrote on Wed,  7 Feb 2024 12:22:48 -0800:

> Add brcm,nand-ecc-use-strap to get ecc and spare area size settings from
> board boot strap for broadband board designs because they do not specify
> ecc setting in dts but rather using the strap setting.
> 
> Signed-off-by: William Zhang <william.zhang@broadcom.com>
> 
> ---
> 
> Changes in v5:
> - Update the description for this ecc strap property
> - Add check to make sure brcm,nand-ecc-use-strap and
>   nand-ecc-strength/brcm,nand-oob-sector-size can not be used at the
>   same time
> 
> Changes in v4:
> - Move ecc strap property to this separate patch and remove some
> non-binding related text from the description
> 
> Changes in v3: None
> Changes in v2: None
> 
>  .../bindings/mtd/brcm,brcmnand.yaml           | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
> index 6a717bcedfd3..52a4c993b6f1 100644
> --- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
> +++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
> @@ -146,6 +146,13 @@ patternProperties:
>            layout.
>          $ref: /schemas/types.yaml#/definitions/uint32
>  
> +      brcm,nand-ecc-use-strap:
> +        description:
> +          This property requires the host system to get the ECC strength
> +          and step size from the SoC NAND boot strap setting. This is a
> +          common hardware design on BCMBCA based boards.
> +        $ref: /schemas/types.yaml#/definitions/flag
> +
>      unevaluatedProperties: false
>  
>  allOf:
> @@ -195,6 +202,18 @@ allOf:
>        required:
>          - interrupt-names
>  
> +  - if:
> +      patternProperties:
> +        "^nand@[a-f0-9]$":
> +          required:
> +            - brcm,nand-ecc-use-strap
> +    then:
> +      patternProperties:
> +        "^nand@[a-f0-9]$":
> +          properties:
> +            nand-ecc-strength: false
> +            brcm,nand-oob-sector-size: false

Can you also excluse all the other nand-ecc- settings and brcm,
settings as well? Either you use the strap *or* you provide values in
the DT, but not both.

> +
>  unevaluatedProperties: false
>  
>  required:


Thanks,
Miquèl
  

Patch

diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
index 6a717bcedfd3..52a4c993b6f1 100644
--- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
+++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
@@ -146,6 +146,13 @@  patternProperties:
           layout.
         $ref: /schemas/types.yaml#/definitions/uint32
 
+      brcm,nand-ecc-use-strap:
+        description:
+          This property requires the host system to get the ECC strength
+          and step size from the SoC NAND boot strap setting. This is a
+          common hardware design on BCMBCA based boards.
+        $ref: /schemas/types.yaml#/definitions/flag
+
     unevaluatedProperties: false
 
 allOf:
@@ -195,6 +202,18 @@  allOf:
       required:
         - interrupt-names
 
+  - if:
+      patternProperties:
+        "^nand@[a-f0-9]$":
+          required:
+            - brcm,nand-ecc-use-strap
+    then:
+      patternProperties:
+        "^nand@[a-f0-9]$":
+          properties:
+            nand-ecc-strength: false
+            brcm,nand-oob-sector-size: false
+
 unevaluatedProperties: false
 
 required: