Message ID | 20241002-loongson1-nand-v10-1-17162eff80e2@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v10,1/2] dt-bindings: mtd: Add Loongson-1 NAND Controller | expand |
On Mon, Oct 7, 2024 at 10:10 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote: > > Hi Keguang, > > > +patternProperties: > > + "^nand@[0-3]$": > > + type: object > > + $ref: raw-nand-chip.yaml > > + > > + required: > > + - nand-use-soft-ecc-engine > > + - nand-ecc-algo > > Actually I told you a mistake. The no-ecc-engine case should remain > valid, so we cannot require these properties in the bindings. > Then, remove this section, right? > My fault, sorry about that. > > Thanks, > Miquèl
Hi Keguang, keguang.zhang@gmail.com wrote on Wed, 16 Oct 2024 16:06:09 +0800: > On Mon, Oct 7, 2024 at 10:10 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote: > > > > Hi Keguang, > > > > > +patternProperties: > > > + "^nand@[0-3]$": > > > + type: object > > > + $ref: raw-nand-chip.yaml > > > + > > > + required: > > > + - nand-use-soft-ecc-engine > > > + - nand-ecc-algo > > > > Actually I told you a mistake. The no-ecc-engine case should remain > > valid, so we cannot require these properties in the bindings. > > > Then, remove this section, right? Yes, please. Thanks, Miquèl
diff --git a/Documentation/devicetree/bindings/mtd/loongson,ls1b-nand-controller.yaml b/Documentation/devicetree/bindings/mtd/loongson,ls1b-nand-controller.yaml new file mode 100644 index 000000000000..308baf23221b --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/loongson,ls1b-nand-controller.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/loongson,ls1b-nand-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson-1 NAND Controller + +maintainers: + - Keguang Zhang <keguang.zhang@gmail.com> + +description: + The Loongson-1 NAND controller abstracts all supported operations, + meaning it does not support low-level access to raw NAND flash chips. + Moreover, the controller is paired with the DMA engine to perform + READ and PROGRAM functions. + +allOf: + - $ref: nand-controller.yaml + +properties: + compatible: + oneOf: + - enum: + - loongson,ls1b-nand-controller + - loongson,ls1c-nand-controller + - items: + - enum: + - loongson,ls1a-nand-controller + - const: loongson,ls1b-nand-controller + + reg: + maxItems: 1 + + dmas: + maxItems: 1 + + dma-names: + const: rxtx + +patternProperties: + "^nand@[0-3]$": + type: object + $ref: raw-nand-chip.yaml + + required: + - nand-use-soft-ecc-engine + - nand-ecc-algo + + unevaluatedProperties: false + +required: + - compatible + - reg + - dmas + - dma-names + +unevaluatedProperties: false + +examples: + - | + nand-controller@1fe78000 { + compatible = "loongson,ls1b-nand-controller"; + reg = <0x1fe78000 0x40>; + dmas = <&dma 0>; + dma-names = "rxtx"; + #address-cells = <1>; + #size-cells = <0>; + + nand@0 { + reg = <0>; + nand-use-soft-ecc-engine; + nand-ecc-algo = "hamming"; + }; + };