Documentation / devicetree / bindings / mtd / amlogic,meson-nand.yaml


Based on kernel version 6.11. Page generated on 2024-09-24 08:21 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/amlogic,meson-nand.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic NAND Flash Controller (NFC) for GXBB/GXL/AXG family SoCs

allOf:
  - $ref: nand-controller.yaml

maintainers:
  - liang.yang@amlogic.com

properties:
  compatible:
    enum:
      - amlogic,meson-gxl-nfc
      - amlogic,meson-axg-nfc

  reg:
    maxItems: 2

  reg-names:
    items:
      - const: nfc
      - const: emmc

  interrupts:
    maxItems: 1

  clocks:
    minItems: 2

  clock-names:
    items:
      - const: core
      - const: device

patternProperties:
  "^nand@[0-7]$":
    type: object
    $ref: raw-nand-chip.yaml
    properties:
      reg:
        minimum: 0
        maximum: 1

      nand-ecc-mode:
        const: hw

      nand-ecc-step-size:
        enum: [512, 1024]

      nand-ecc-strength:
        enum: [8, 16, 24, 30, 40, 50, 60]
        description: |
          The ECC configurations that can be supported are as follows.
            meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
            meson-axg-nfc 8

      nand-rb:
        maxItems: 1
        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:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/axg-clkc.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    nand-controller@ffe07800 {
      compatible = "amlogic,meson-axg-nfc";
      reg = <0xffe07800 0x100>, <0xffe07000 0x800>;
      reg-names = "nfc", "emmc";
      interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
      clocks = <&clkc CLKID_SD_EMMC_C>,  <&clkc CLKID_FCLK_DIV2>;
      clock-names = "core", "device";
 
      pinctrl-0 = <&nand_pins>;
      pinctrl-names = "default";
 
      #address-cells = <1>;
      #size-cells = <0>;
 
      nand@0 {
        reg = <0>;
        nand-rb = <0>;
      };
    };

...