mediatek,mtk-nfc.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mtd/mediatek,mtk-nfc.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: MediaTek(MTK) SoCs raw NAND FLASH controller (NFC)
  7. maintainers:
  8. - Xiangsheng Hou <xiangsheng.hou@mediatek.com>
  9. properties:
  10. compatible:
  11. enum:
  12. - mediatek,mt2701-nfc
  13. - mediatek,mt2712-nfc
  14. - mediatek,mt7622-nfc
  15. reg:
  16. items:
  17. - description: Base physical address and size of NFI.
  18. interrupts:
  19. items:
  20. - description: NFI interrupt
  21. clocks:
  22. items:
  23. - description: clock used for the controller
  24. - description: clock used for the pad
  25. clock-names:
  26. items:
  27. - const: nfi_clk
  28. - const: pad_clk
  29. ecc-engine:
  30. description: device-tree node of the required ECC engine.
  31. $ref: /schemas/types.yaml#/definitions/phandle
  32. patternProperties:
  33. "^nand@[a-f0-9]$":
  34. $ref: raw-nand-chip.yaml#
  35. unevaluatedProperties: false
  36. properties:
  37. reg:
  38. maximum: 1
  39. nand-ecc-mode:
  40. const: hw
  41. allOf:
  42. - $ref: nand-controller.yaml#
  43. - if:
  44. properties:
  45. compatible:
  46. contains:
  47. const: mediatek,mt2701-nfc
  48. then:
  49. patternProperties:
  50. "^nand@[a-f0-9]$":
  51. properties:
  52. nand-ecc-step-size:
  53. enum: [ 512, 1024 ]
  54. nand-ecc-strength:
  55. enum: [4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36,
  56. 40, 44, 48, 52, 56, 60]
  57. - if:
  58. properties:
  59. compatible:
  60. contains:
  61. const: mediatek,mt2712-nfc
  62. then:
  63. patternProperties:
  64. "^nand@[a-f0-9]$":
  65. properties:
  66. nand-ecc-step-size:
  67. enum: [ 512, 1024 ]
  68. nand-ecc-strength:
  69. enum: [4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36,
  70. 40, 44, 48, 52, 56, 60, 68, 72, 80]
  71. - if:
  72. properties:
  73. compatible:
  74. contains:
  75. const: mediatek,mt7622-nfc
  76. then:
  77. patternProperties:
  78. "^nand@[a-f0-9]$":
  79. properties:
  80. nand-ecc-step-size:
  81. const: 512
  82. nand-ecc-strength:
  83. enum: [4, 6, 8, 10, 12]
  84. required:
  85. - compatible
  86. - reg
  87. - interrupts
  88. - clocks
  89. - clock-names
  90. - ecc-engine
  91. unevaluatedProperties: false
  92. examples:
  93. - |
  94. #include <dt-bindings/clock/mt2701-clk.h>
  95. #include <dt-bindings/interrupt-controller/arm-gic.h>
  96. #include <dt-bindings/interrupt-controller/irq.h>
  97. soc {
  98. #address-cells = <2>;
  99. #size-cells = <2>;
  100. nand-controller@1100d000 {
  101. compatible = "mediatek,mt2701-nfc";
  102. reg = <0 0x1100d000 0 0x1000>;
  103. interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>;
  104. clocks = <&pericfg CLK_PERI_NFI>,
  105. <&pericfg CLK_PERI_NFI_PAD>;
  106. clock-names = "nfi_clk", "pad_clk";
  107. ecc-engine = <&bch>;
  108. #address-cells = <1>;
  109. #size-cells = <0>;
  110. nand@0 {
  111. reg = <0>;
  112. nand-on-flash-bbt;
  113. nand-ecc-mode = "hw";
  114. nand-ecc-step-size = <1024>;
  115. nand-ecc-strength = <24>;
  116. partitions {
  117. compatible = "fixed-partitions";
  118. #address-cells = <1>;
  119. #size-cells = <1>;
  120. preloader@0 {
  121. label = "pl";
  122. read-only;
  123. reg = <0x0 0x400000>;
  124. };
  125. android@400000 {
  126. label = "android";
  127. reg = <0x400000 0x12c00000>;
  128. };
  129. };
  130. };
  131. };
  132. };