atmel-nand.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. Atmel NAND flash controller bindings
  2. The NAND flash controller node should be defined under the EBI bus (see
  3. Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt).
  4. One or several NAND devices can be defined under this NAND controller.
  5. The NAND controller might be connected to an ECC engine.
  6. * NAND controller bindings:
  7. Required properties:
  8. - compatible: should be one of the following
  9. "atmel,at91rm9200-nand-controller"
  10. "atmel,at91sam9260-nand-controller"
  11. "atmel,at91sam9261-nand-controller"
  12. "atmel,at91sam9g45-nand-controller"
  13. "atmel,sama5d3-nand-controller"
  14. - ranges: empty ranges property to forward EBI ranges definitions.
  15. - #address-cells: should be set to 2.
  16. - #size-cells: should be set to 1.
  17. - atmel,nfc-io: phandle to the NFC IO block. Only required for sama5d3
  18. controllers.
  19. - atmel,nfc-sram: phandle to the NFC SRAM block. Only required for sama5d3
  20. controllers.
  21. Optional properties:
  22. - ecc-engine: phandle to the PMECC block. Only meaningful if the SoC embeds
  23. a PMECC engine.
  24. * NAND device/chip bindings:
  25. Required properties:
  26. - reg: describes the CS lines assigned to the NAND device. If the NAND device
  27. exposes multiple CS lines (multi-dies chips), your reg property will
  28. contain X tuples of 3 entries.
  29. 1st entry: the CS line this NAND chip is connected to
  30. 2nd entry: the base offset of the memory region assigned to this
  31. device (always 0)
  32. 3rd entry: the memory region size (always 0x800000)
  33. Optional properties:
  34. - rb-gpios: the GPIO(s) used to check the Ready/Busy status of the NAND.
  35. - cs-gpios: the GPIO(s) used to control the CS line.
  36. - det-gpios: the GPIO used to detect if a Smartmedia Card is present.
  37. - atmel,rb: an integer identifying the native Ready/Busy pin. Only meaningful
  38. on sama5 SoCs.
  39. All generic properties described in
  40. Documentation/devicetree/bindings/mtd/{common,nand}.txt also apply to the NAND
  41. device node, and NAND partitions should be defined under the NAND node as
  42. described in Documentation/devicetree/bindings/mtd/partition.txt.
  43. * ECC engine (PMECC) bindings:
  44. Required properties:
  45. - compatible: should be one of the following
  46. "atmel,at91sam9g45-pmecc"
  47. "atmel,sama5d4-pmecc"
  48. "atmel,sama5d2-pmecc"
  49. - reg: should contain 2 register ranges. The first one is pointing to the PMECC
  50. block, and the second one to the PMECC_ERRLOC block.
  51. * SAMA5 NFC I/O bindings:
  52. SAMA5 SoCs embed an advanced NAND controller logic to automate READ/WRITE page
  53. operations. This interface to this logic is placed in a separate I/O range and
  54. should thus have its own DT node.
  55. - compatible: should be "atmel,sama5d3-nfc-io", "syscon".
  56. - reg: should contain the I/O range used to interact with the NFC logic.
  57. Example:
  58. nfc_io: nfc-io@70000000 {
  59. compatible = "atmel,sama5d3-nfc-io", "syscon";
  60. reg = <0x70000000 0x8000000>;
  61. };
  62. pmecc: ecc-engine@ffffc070 {
  63. compatible = "atmel,at91sam9g45-pmecc";
  64. reg = <0xffffc070 0x490>,
  65. <0xffffc500 0x100>;
  66. };
  67. ebi: ebi@10000000 {
  68. compatible = "atmel,sama5d3-ebi";
  69. #address-cells = <2>;
  70. #size-cells = <1>;
  71. atmel,smc = <&hsmc>;
  72. reg = <0x10000000 0x10000000
  73. 0x40000000 0x30000000>;
  74. ranges = <0x0 0x0 0x10000000 0x10000000
  75. 0x1 0x0 0x40000000 0x10000000
  76. 0x2 0x0 0x50000000 0x10000000
  77. 0x3 0x0 0x60000000 0x10000000>;
  78. clocks = <&mck>;
  79. nand_controller: nand-controller {
  80. compatible = "atmel,sama5d3-nand-controller";
  81. atmel,nfc-sram = <&nfc_sram>;
  82. atmel,nfc-io = <&nfc_io>;
  83. ecc-engine = <&pmecc>;
  84. #address-cells = <2>;
  85. #size-cells = <1>;
  86. ranges;
  87. nand@3 {
  88. reg = <0x3 0x0 0x800000>;
  89. atmel,rb = <0>;
  90. /*
  91. * Put generic NAND/MTD properties and
  92. * subnodes here.
  93. */
  94. };
  95. };
  96. };
  97. -----------------------------------------------------------------------
  98. Deprecated bindings (should not be used in new device trees):
  99. Required properties:
  100. - compatible: The possible values are:
  101. "atmel,at91rm9200-nand"
  102. "atmel,sama5d2-nand"
  103. "atmel,sama5d4-nand"
  104. - reg : should specify localbus address and size used for the chip,
  105. and hardware ECC controller if available.
  106. If the hardware ECC is PMECC, it should contain address and size for
  107. PMECC and PMECC Error Location controller.
  108. The PMECC lookup table address and size in ROM is optional. If not
  109. specified, driver will build it in runtime.
  110. - atmel,nand-addr-offset : offset for the address latch.
  111. - atmel,nand-cmd-offset : offset for the command latch.
  112. - #address-cells, #size-cells : Must be present if the device has sub-nodes
  113. representing partitions.
  114. - gpios : specifies the gpio pins to control the NAND device. detect is an
  115. optional gpio and may be set to 0 if not present.
  116. Optional properties:
  117. - atmel,nand-has-dma : boolean to support dma transfer for nand read/write.
  118. - nand-ecc-mode : String, operation mode of the NAND ecc mode, soft by default.
  119. Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first",
  120. "soft_bch".
  121. - atmel,has-pmecc : boolean to enable Programmable Multibit ECC hardware,
  122. capable of BCH encoding and decoding, on devices where it is present.
  123. - atmel,pmecc-cap : error correct capability for Programmable Multibit ECC
  124. Controller. Supported values are: 2, 4, 8, 12, 24. If the compatible string
  125. is "atmel,sama5d2-nand", 32 is also valid.
  126. - atmel,pmecc-sector-size : sector size for ECC computation. Supported values
  127. are: 512, 1024.
  128. - atmel,pmecc-lookup-table-offset : includes two offsets of lookup table in ROM
  129. for different sector size. First one is for sector size 512, the next is for
  130. sector size 1024. If not specified, driver will build the table in runtime.
  131. - nand-bus-width : 8 or 16 bus width if not present 8
  132. - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
  133. Nand Flash Controller(NFC) is an optional sub-node
  134. Required properties:
  135. - compatible : "atmel,sama5d3-nfc".
  136. - reg : should specify the address and size used for NFC command registers,
  137. NFC registers and NFC SRAM. NFC SRAM address and size can be absent
  138. if don't want to use it.
  139. - clocks: phandle to the peripheral clock
  140. Optional properties:
  141. - atmel,write-by-sram: boolean to enable NFC write by SRAM.
  142. Examples:
  143. nand0: nand@40000000,0 {
  144. compatible = "atmel,at91rm9200-nand";
  145. #address-cells = <1>;
  146. #size-cells = <1>;
  147. reg = <0x40000000 0x10000000
  148. 0xffffe800 0x200
  149. >;
  150. atmel,nand-addr-offset = <21>; /* ale */
  151. atmel,nand-cmd-offset = <22>; /* cle */
  152. nand-on-flash-bbt;
  153. nand-ecc-mode = "soft";
  154. gpios = <&pioC 13 0 /* rdy */
  155. &pioC 14 0 /* nce */
  156. 0 /* cd */
  157. >;
  158. partition@0 {
  159. ...
  160. };
  161. };
  162. /* for PMECC supported chips */
  163. nand0: nand@40000000 {
  164. compatible = "atmel,at91rm9200-nand";
  165. #address-cells = <1>;
  166. #size-cells = <1>;
  167. reg = < 0x40000000 0x10000000 /* bus addr & size */
  168. 0xffffe000 0x00000600 /* PMECC addr & size */
  169. 0xffffe600 0x00000200 /* PMECC ERRLOC addr & size */
  170. 0x00100000 0x00100000 /* ROM addr & size */
  171. >;
  172. atmel,nand-addr-offset = <21>; /* ale */
  173. atmel,nand-cmd-offset = <22>; /* cle */
  174. nand-on-flash-bbt;
  175. nand-ecc-mode = "hw";
  176. atmel,has-pmecc; /* enable PMECC */
  177. atmel,pmecc-cap = <2>;
  178. atmel,pmecc-sector-size = <512>;
  179. atmel,pmecc-lookup-table-offset = <0x8000 0x10000>;
  180. gpios = <&pioD 5 0 /* rdy */
  181. &pioD 4 0 /* nce */
  182. 0 /* cd */
  183. >;
  184. partition@0 {
  185. ...
  186. };
  187. };
  188. /* for NFC supported chips */
  189. nand0: nand@40000000 {
  190. compatible = "atmel,at91rm9200-nand";
  191. #address-cells = <1>;
  192. #size-cells = <1>;
  193. ranges;
  194. ...
  195. nfc@70000000 {
  196. compatible = "atmel,sama5d3-nfc";
  197. #address-cells = <1>;
  198. #size-cells = <1>;
  199. clocks = <&hsmc_clk>
  200. reg = <
  201. 0x70000000 0x10000000 /* NFC Command Registers */
  202. 0xffffc000 0x00000070 /* NFC HSMC regs */
  203. 0x00200000 0x00100000 /* NFC SRAM banks */
  204. >;
  205. };
  206. };