xref: /freebsd-src/sys/contrib/device-tree/Bindings/mtd/amlogic,meson-nand.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
17ef62cebSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
27ef62cebSEmmanuel Vadot%YAML 1.2
37ef62cebSEmmanuel Vadot---
47ef62cebSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/amlogic,meson-nand.yaml#
57ef62cebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
67ef62cebSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: Amlogic NAND Flash Controller (NFC) for GXBB/GXL/AXG family SoCs
87ef62cebSEmmanuel Vadot
97ef62cebSEmmanuel VadotallOf:
107ef62cebSEmmanuel Vadot  - $ref: nand-controller.yaml
117ef62cebSEmmanuel Vadot
127ef62cebSEmmanuel Vadotmaintainers:
137ef62cebSEmmanuel Vadot  - liang.yang@amlogic.com
147ef62cebSEmmanuel Vadot
157ef62cebSEmmanuel Vadotproperties:
167ef62cebSEmmanuel Vadot  compatible:
177ef62cebSEmmanuel Vadot    enum:
187ef62cebSEmmanuel Vadot      - amlogic,meson-gxl-nfc
197ef62cebSEmmanuel Vadot      - amlogic,meson-axg-nfc
207ef62cebSEmmanuel Vadot
217ef62cebSEmmanuel Vadot  reg:
227ef62cebSEmmanuel Vadot    maxItems: 2
237ef62cebSEmmanuel Vadot
247ef62cebSEmmanuel Vadot  reg-names:
257ef62cebSEmmanuel Vadot    items:
267ef62cebSEmmanuel Vadot      - const: nfc
277ef62cebSEmmanuel Vadot      - const: emmc
287ef62cebSEmmanuel Vadot
297ef62cebSEmmanuel Vadot  interrupts:
307ef62cebSEmmanuel Vadot    maxItems: 1
317ef62cebSEmmanuel Vadot
327ef62cebSEmmanuel Vadot  clocks:
337ef62cebSEmmanuel Vadot    minItems: 2
347ef62cebSEmmanuel Vadot
357ef62cebSEmmanuel Vadot  clock-names:
367ef62cebSEmmanuel Vadot    items:
377ef62cebSEmmanuel Vadot      - const: core
387ef62cebSEmmanuel Vadot      - const: device
397ef62cebSEmmanuel Vadot
407ef62cebSEmmanuel VadotpatternProperties:
417ef62cebSEmmanuel Vadot  "^nand@[0-7]$":
427ef62cebSEmmanuel Vadot    type: object
43f126890aSEmmanuel Vadot    $ref: raw-nand-chip.yaml
447ef62cebSEmmanuel Vadot    properties:
457ef62cebSEmmanuel Vadot      reg:
467ef62cebSEmmanuel Vadot        minimum: 0
477ef62cebSEmmanuel Vadot        maximum: 1
487ef62cebSEmmanuel Vadot
497ef62cebSEmmanuel Vadot      nand-ecc-mode:
507ef62cebSEmmanuel Vadot        const: hw
517ef62cebSEmmanuel Vadot
527ef62cebSEmmanuel Vadot      nand-ecc-step-size:
53aa1a8ff2SEmmanuel Vadot        enum: [512, 1024]
547ef62cebSEmmanuel Vadot
557ef62cebSEmmanuel Vadot      nand-ecc-strength:
567ef62cebSEmmanuel Vadot        enum: [8, 16, 24, 30, 40, 50, 60]
577ef62cebSEmmanuel Vadot        description: |
587ef62cebSEmmanuel Vadot          The ECC configurations that can be supported are as follows.
597ef62cebSEmmanuel Vadot            meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
607ef62cebSEmmanuel Vadot            meson-axg-nfc 8
617ef62cebSEmmanuel Vadot
62f126890aSEmmanuel Vadot      nand-rb:
63f126890aSEmmanuel Vadot        maxItems: 1
64f126890aSEmmanuel Vadot        items:
65f126890aSEmmanuel Vadot          maximum: 0
66f126890aSEmmanuel Vadot
67*0e8011faSEmmanuel Vadot      amlogic,boot-pages:
68*0e8011faSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
69*0e8011faSEmmanuel Vadot        description:
70*0e8011faSEmmanuel Vadot          Number of pages starting from offset 0, where a special ECC
71*0e8011faSEmmanuel Vadot          configuration must be used because it is accessed by the ROM
72*0e8011faSEmmanuel Vadot          code. This ECC configuration uses 384 bytes data blocks.
73*0e8011faSEmmanuel Vadot          Also scrambling mode is enabled for such pages.
74*0e8011faSEmmanuel Vadot
75*0e8011faSEmmanuel Vadot      amlogic,boot-page-step:
76*0e8011faSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
77*0e8011faSEmmanuel Vadot        description:
78*0e8011faSEmmanuel Vadot          Interval between pages, accessed by the ROM code. For example
79*0e8011faSEmmanuel Vadot          we have 8 pages [0, 7]. Pages 0,2,4,6 are accessed by the
80*0e8011faSEmmanuel Vadot          ROM code, so this field will be 2 (e.g. every 2nd page). Rest
81*0e8011faSEmmanuel Vadot          of pages - 1,3,5,7 are read/written without this mode.
82*0e8011faSEmmanuel Vadot
83f126890aSEmmanuel Vadot    unevaluatedProperties: false
84f126890aSEmmanuel Vadot
85aa1a8ff2SEmmanuel Vadot    dependencies:
86aa1a8ff2SEmmanuel Vadot      nand-ecc-strength: [nand-ecc-step-size]
87aa1a8ff2SEmmanuel Vadot      nand-ecc-step-size: [nand-ecc-strength]
88*0e8011faSEmmanuel Vadot      amlogic,boot-pages: [nand-is-boot-medium, "amlogic,boot-page-step"]
89*0e8011faSEmmanuel Vadot      amlogic,boot-page-step: [nand-is-boot-medium, "amlogic,boot-pages"]
90aa1a8ff2SEmmanuel Vadot
91f126890aSEmmanuel Vadot
927ef62cebSEmmanuel Vadotrequired:
937ef62cebSEmmanuel Vadot  - compatible
947ef62cebSEmmanuel Vadot  - reg
957ef62cebSEmmanuel Vadot  - interrupts
967ef62cebSEmmanuel Vadot  - clocks
977ef62cebSEmmanuel Vadot  - clock-names
987ef62cebSEmmanuel Vadot
997ef62cebSEmmanuel VadotunevaluatedProperties: false
1007ef62cebSEmmanuel Vadot
1017ef62cebSEmmanuel Vadotexamples:
1027ef62cebSEmmanuel Vadot  - |
1037ef62cebSEmmanuel Vadot    #include <dt-bindings/clock/axg-clkc.h>
1047ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1057ef62cebSEmmanuel Vadot    nand-controller@ffe07800 {
1067ef62cebSEmmanuel Vadot      compatible = "amlogic,meson-axg-nfc";
1077ef62cebSEmmanuel Vadot      reg = <0xffe07800 0x100>, <0xffe07000 0x800>;
1087ef62cebSEmmanuel Vadot      reg-names = "nfc", "emmc";
1097ef62cebSEmmanuel Vadot      interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
1107ef62cebSEmmanuel Vadot      clocks = <&clkc CLKID_SD_EMMC_C>,  <&clkc CLKID_FCLK_DIV2>;
1117ef62cebSEmmanuel Vadot      clock-names = "core", "device";
1127ef62cebSEmmanuel Vadot
1137ef62cebSEmmanuel Vadot      pinctrl-0 = <&nand_pins>;
1147ef62cebSEmmanuel Vadot      pinctrl-names = "default";
1157ef62cebSEmmanuel Vadot
1167ef62cebSEmmanuel Vadot      #address-cells = <1>;
1177ef62cebSEmmanuel Vadot      #size-cells = <0>;
1187ef62cebSEmmanuel Vadot
1197ef62cebSEmmanuel Vadot      nand@0 {
1207ef62cebSEmmanuel Vadot        reg = <0>;
121f126890aSEmmanuel Vadot        nand-rb = <0>;
1227ef62cebSEmmanuel Vadot      };
1237ef62cebSEmmanuel Vadot    };
1247ef62cebSEmmanuel Vadot
1257ef62cebSEmmanuel Vadot...
126