diff mbox series

[v3,1/2] dt-bindings: mtd: nuvoton,ma35d1-nand: add new bindings

Message ID 20240821071132.281018-2-hpchen0nvt@gmail.com
State New
Headers show
Series Add support for nuvoton ma35 nand controller | expand

Commit Message

Hui-Ping Chen Aug. 21, 2024, 7:11 a.m. UTC
Add dt-bindings for the Nuvoton MA35 SoC NAND Controller.

Signed-off-by: Hui-Ping Chen <hpchen0nvt@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/mtd/nuvoton,ma35d1-nand.yaml     | 93 +++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml

Comments

Miquel Raynal Aug. 23, 2024, 4:26 p.m. UTC | #1
Hi,

hpchen0nvt@gmail.com wrote on Wed, 21 Aug 2024 07:11:31 +0000:

> Add dt-bindings for the Nuvoton MA35 SoC NAND Controller.
> 
> Signed-off-by: Hui-Ping Chen <hpchen0nvt@gmail.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/mtd/nuvoton,ma35d1-nand.yaml     | 93 +++++++++++++++++++
>  1 file changed, 93 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
> new file mode 100644
> index 000000000000..152784e73263
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
> @@ -0,0 +1,93 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mtd/nuvoton,ma35d1-nand.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Nuvoton MA35D1 NAND Flash Interface (NFI) Controller
> +
> +maintainers:
> +  - Hui-Ping Chen <hpchen0nvt@gmail.com>
> +
> +allOf:
> +  - $ref: nand-controller.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - nuvoton,ma35d1-nand

Can we please use the -nand-controller suffix. A NAND is a the common
name for a chip with storage inside. You are describing a host
controller that can be connected to in order to talk to a NAND.

Thanks,
Miquèl
Hui-Ping Chen Aug. 28, 2024, 2:47 a.m. UTC | #2
Dear Miquèl,

Thank you for your reply.



On 2024/8/24 上午 12:26, Miquel Raynal wrote:
> Hi,
>
> hpchen0nvt@gmail.com wrote on Wed, 21 Aug 2024 07:11:31 +0000:
>
>> Add dt-bindings for the Nuvoton MA35 SoC NAND Controller.
>>
>> Signed-off-by: Hui-Ping Chen <hpchen0nvt@gmail.com>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>   .../bindings/mtd/nuvoton,ma35d1-nand.yaml     | 93 +++++++++++++++++++
>>   1 file changed, 93 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
>> new file mode 100644
>> index 000000000000..152784e73263
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
>> @@ -0,0 +1,93 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mtd/nuvoton,ma35d1-nand.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Nuvoton MA35D1 NAND Flash Interface (NFI) Controller
>> +
>> +maintainers:
>> +  - Hui-Ping Chen <hpchen0nvt@gmail.com>
>> +
>> +allOf:
>> +  - $ref: nand-controller.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - nuvoton,ma35d1-nand
> Can we please use the -nand-controller suffix. A NAND is a the common
> name for a chip with storage inside. You are describing a host
> controller that can be connected to in order to talk to a NAND.


Okay, I will change it to nuvoton,ma35d1-nfi.

Because in our platform, it is the NAND Flash Interface.



> Thanks,
> Miquèl


Best regards,

Hui-Ping Chen
Miquel Raynal Aug. 28, 2024, 7:48 a.m. UTC | #3
Hi Hui-Ping,

hpchen0nvt@gmail.com wrote on Wed, 28 Aug 2024 10:47:17 +0800:

> Dear Miquèl,
> 
> Thank you for your reply.
> 
> 
> 
> On 2024/8/24 上午 12:26, Miquel Raynal wrote:
> > Hi,
> >
> > hpchen0nvt@gmail.com wrote on Wed, 21 Aug 2024 07:11:31 +0000:
> >  
> >> Add dt-bindings for the Nuvoton MA35 SoC NAND Controller.
> >>
> >> Signed-off-by: Hui-Ping Chen <hpchen0nvt@gmail.com>
> >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> ---
> >>   .../bindings/mtd/nuvoton,ma35d1-nand.yaml     | 93 +++++++++++++++++++
> >>   1 file changed, 93 insertions(+)
> >>   create mode 100644 Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
> >> new file mode 100644
> >> index 000000000000..152784e73263
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
> >> @@ -0,0 +1,93 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/mtd/nuvoton,ma35d1-nand.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: Nuvoton MA35D1 NAND Flash Interface (NFI) Controller
> >> +
> >> +maintainers:
> >> +  - Hui-Ping Chen <hpchen0nvt@gmail.com>
> >> +
> >> +allOf:
> >> +  - $ref: nand-controller.yaml#
> >> +
> >> +properties:
> >> +  compatible:
> >> +    enum:
> >> +      - nuvoton,ma35d1-nand  
> > Can we please use the -nand-controller suffix. A NAND is a the common
> > name for a chip with storage inside. You are describing a host
> > controller that can be connected to in order to talk to a NAND.  
> 
> 
> Okay, I will change it to nuvoton,ma35d1-nfi.
> 
> Because in our platform, it is the NAND Flash Interface.

nfi is not an acronym that is understandable by everyone. Please use
-nand-controller. Don't be worried by the size of the string.

You can use the acronym as prefix for your NAND controller functions
though.

Thanks,
Miquèl
Hui-Ping Chen Aug. 28, 2024, 7:57 a.m. UTC | #4
Dear Miquel,

Thank you for your reply.



On 2024/8/28 下午 03:48, Miquel Raynal wrote:
> Hi Hui-Ping,
>
> hpchen0nvt@gmail.com wrote on Wed, 28 Aug 2024 10:47:17 +0800:
>
>> Dear Miquèl,
>>
>> Thank you for your reply.
>>
>>
>>
>> On 2024/8/24 上午 12:26, Miquel Raynal wrote:
>>> Hi,
>>>
>>> hpchen0nvt@gmail.com wrote on Wed, 21 Aug 2024 07:11:31 +0000:
>>>   
>>>> Add dt-bindings for the Nuvoton MA35 SoC NAND Controller.
>>>>
>>>> Signed-off-by: Hui-Ping Chen <hpchen0nvt@gmail.com>
>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> ---
>>>>    .../bindings/mtd/nuvoton,ma35d1-nand.yaml     | 93 +++++++++++++++++++
>>>>    1 file changed, 93 insertions(+)
>>>>    create mode 100644 Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
>>>> new file mode 100644
>>>> index 000000000000..152784e73263
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
>>>> @@ -0,0 +1,93 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/mtd/nuvoton,ma35d1-nand.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Nuvoton MA35D1 NAND Flash Interface (NFI) Controller
>>>> +
>>>> +maintainers:
>>>> +  - Hui-Ping Chen <hpchen0nvt@gmail.com>
>>>> +
>>>> +allOf:
>>>> +  - $ref: nand-controller.yaml#
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    enum:
>>>> +      - nuvoton,ma35d1-nand
>>> Can we please use the -nand-controller suffix. A NAND is a the common
>>> name for a chip with storage inside. You are describing a host
>>> controller that can be connected to in order to talk to a NAND.
>>
>> Okay, I will change it to nuvoton,ma35d1-nfi.
>>
>> Because in our platform, it is the NAND Flash Interface.
> nfi is not an acronym that is understandable by everyone. Please use
> -nand-controller. Don't be worried by the size of the string.
>
> You can use the acronym as prefix for your NAND controller functions
> though.

Okay, I will change it to nuvoton,ma35d1-nand-controller.



> Thanks,
> Miquèl


Best regards,

Hui-Ping Chen
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
new file mode 100644
index 000000000000..152784e73263
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml
@@ -0,0 +1,93 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/nuvoton,ma35d1-nand.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton MA35D1 NAND Flash Interface (NFI) Controller
+
+maintainers:
+  - Hui-Ping Chen <hpchen0nvt@gmail.com>
+
+allOf:
+  - $ref: nand-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - nuvoton,ma35d1-nand
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+patternProperties:
+  "^nand@[a-f0-9]$":
+    type: object
+    $ref: raw-nand-chip.yaml
+    properties:
+      nand-ecc-step-size:
+        enum: [512, 1024]
+
+      nand-ecc-strength:
+        enum: [8, 12, 24]
+
+    required:
+      - nand-ecc-step-size
+      - nand-ecc-strength
+
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        nand-controller@401A0000 {
+            compatible = "nuvoton,ma35d1-nand";
+            reg = <0x0 0x401A0000 0x0 0x1000>;
+            interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+            clocks = <&clk NAND_GATE>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            nand@0 {
+                reg = <0>;
+
+                nand-on-flash-bbt;
+                nand-ecc-step-size = <512>;
+                nand-ecc-strength = <8>;
+
+                partitions {
+                    compatible = "fixed-partitions";
+                    #address-cells = <1>;
+                    #size-cells = <1>;
+
+                    uboot@0 {
+                        label = "nand-uboot";
+                        read-only;
+                        reg = <0x0 0x300000>;
+                    };
+                };
+            };
+        };
+    };
+
+...