brcm,brcmnand.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. * Broadcom STB NAND Controller
  2. The Broadcom Set-Top Box NAND controller supports low-level access to raw NAND
  3. flash chips. It has a memory-mapped register interface for both control
  4. registers and for its data input/output buffer. On some SoCs, this controller is
  5. paired with a custom DMA engine (inventively named "Flash DMA") which supports
  6. basic PROGRAM and READ functions, among other features.
  7. This controller was originally designed for STB SoCs (BCM7xxx) but is now
  8. available on a variety of Broadcom SoCs, including some BCM3xxx, BCM63xx, and
  9. iProc/Cygnus. Its history includes several similar (but not fully register
  10. compatible) versions.
  11. Required properties:
  12. - compatible : May contain an SoC-specific compatibility string (see below)
  13. to account for any SoC-specific hardware bits that may be
  14. added on top of the base core controller.
  15. In addition, must contain compatibility information about
  16. the core NAND controller, of the following form:
  17. "brcm,brcmnand" and an appropriate version compatibility
  18. string, like "brcm,brcmnand-v7.0"
  19. Possible values:
  20. brcm,brcmnand-v4.0
  21. brcm,brcmnand-v5.0
  22. brcm,brcmnand-v6.0
  23. brcm,brcmnand-v6.1
  24. brcm,brcmnand-v6.2
  25. brcm,brcmnand-v7.0
  26. brcm,brcmnand-v7.1
  27. brcm,brcmnand-v7.2
  28. brcm,brcmnand
  29. - reg : the register start and length for NAND register region.
  30. (optional) Flash DMA register range (if present)
  31. (optional) NAND flash cache range (if at non-standard offset)
  32. - reg-names : a list of the names corresponding to the previous register
  33. ranges. Should contain "nand" and (optionally)
  34. "flash-dma" and/or "nand-cache".
  35. - interrupts : The NAND CTLRDY interrupt and (if Flash DMA is available)
  36. FLASH_DMA_DONE
  37. - interrupt-names : May be "nand_ctlrdy" or "flash_dma_done", if broken out as
  38. individual interrupts.
  39. May be "nand", if the SoC has the individual NAND
  40. interrupts multiplexed behind another custom piece of
  41. hardware
  42. - interrupt-parent : See standard interrupt bindings
  43. - #address-cells : <1> - subnodes give the chip-select number
  44. - #size-cells : <0>
  45. Optional properties:
  46. - clock : reference to the clock for the NAND controller
  47. - clock-names : "nand" (required for the above clock)
  48. - brcm,nand-has-wp : Some versions of this IP include a write-protect
  49. (WP) control bit. It is always available on >=
  50. v7.0. Use this property to describe the rare
  51. earlier versions of this core that include WP
  52. -- Additional SoC-specific NAND controller properties --
  53. The NAND controller is integrated differently on the variety of SoCs on which it
  54. is found. Part of this integration involves providing status and enable bits
  55. with which to control the 8 exposed NAND interrupts, as well as hardware for
  56. configuring the endianness of the data bus. On some SoCs, these features are
  57. handled via standard, modular components (e.g., their interrupts look like a
  58. normal IRQ chip), but on others, they are controlled in unique and interesting
  59. ways, sometimes with registers that lump multiple NAND-related functions
  60. together. The former case can be described simply by the standard interrupts
  61. properties in the main controller node. But for the latter exceptional cases,
  62. we define additional 'compatible' properties and associated register resources within the NAND controller node above.
  63. - compatible: Can be one of several SoC-specific strings. Each SoC may have
  64. different requirements for its additional properties, as described below each
  65. bullet point below.
  66. * "brcm,nand-bcm63138"
  67. - reg: (required) the 'NAND_INT_BASE' register range, with separate status
  68. and enable registers
  69. - reg-names: (required) "nand-int-base"
  70. * "brcm,nand-bcm6368"
  71. - compatible: should contain "brcm,nand-bcm<soc>", "brcm,nand-bcm6368"
  72. - reg: (required) the 'NAND_INTR_BASE' register range, with combined status
  73. and enable registers, and boot address registers
  74. - reg-names: (required) "nand-int-base"
  75. * "brcm,nand-iproc"
  76. - reg: (required) the "IDM" register range, for interrupt enable and APB
  77. bus access endianness configuration, and the "EXT" register range,
  78. for interrupt status/ack.
  79. - reg-names: (required) a list of the names corresponding to the previous
  80. register ranges. Should contain "iproc-idm" and "iproc-ext".
  81. * NAND chip-select
  82. Each controller (compatible: "brcm,brcmnand") may contain one or more subnodes
  83. to represent enabled chip-selects which (may) contain NAND flash chips. Their
  84. properties are as follows.
  85. Required properties:
  86. - compatible : should contain "brcm,nandcs"
  87. - reg : a single integer representing the chip-select
  88. number (e.g., 0, 1, 2, etc.)
  89. - #address-cells : see partition.txt
  90. - #size-cells : see partition.txt
  91. - nand-ecc-strength : see nand.txt
  92. - nand-ecc-step-size : must be 512 or 1024. See nand.txt
  93. Optional properties:
  94. - nand-on-flash-bbt : boolean, to enable the on-flash BBT for this
  95. chip-select. See nand.txt
  96. - brcm,nand-oob-sector-size : integer, to denote the spare area sector size
  97. expected for the ECC layout in use. This size, in
  98. addition to the strength and step-size,
  99. determines how the hardware BCH engine will lay
  100. out the parity bytes it stores on the flash.
  101. This property can be automatically determined by
  102. the flash geometry (particularly the NAND page
  103. and OOB size) in many cases, but when booting
  104. from NAND, the boot controller has only a limited
  105. number of available options for its default ECC
  106. layout.
  107. Each nandcs device node may optionally contain sub-nodes describing the flash
  108. partition mapping. See partition.txt for more detail.
  109. Example:
  110. nand@f0442800 {
  111. compatible = "brcm,brcmnand-v7.0", "brcm,brcmnand";
  112. reg = <0xF0442800 0x600>,
  113. <0xF0443000 0x100>;
  114. reg-names = "nand", "flash-dma";
  115. interrupt-parent = <&hif_intr2_intc>;
  116. interrupts = <24>, <4>;
  117. #address-cells = <1>;
  118. #size-cells = <0>;
  119. nandcs@1 {
  120. compatible = "brcm,nandcs";
  121. reg = <1>; // Chip select 1
  122. nand-on-flash-bbt;
  123. nand-ecc-strength = <12>;
  124. nand-ecc-step-size = <512>;
  125. // Partitions
  126. #address-cells = <1>; // <2>, for 64-bit offset
  127. #size-cells = <1>; // <2>, for 64-bit length
  128. flash0.rootfs@0 {
  129. reg = <0 0x10000000>;
  130. };
  131. flash0@0 {
  132. reg = <0 0>; // MTDPART_SIZ_FULL
  133. };
  134. flash0.kernel@10000000 {
  135. reg = <0x10000000 0x400000>;
  136. };
  137. };
  138. };
  139. nand@10000200 {
  140. compatible = "brcm,nand-bcm63168", "brcm,nand-bcm6368",
  141. "brcm,brcmnand-v4.0", "brcm,brcmnand";
  142. reg = <0x10000200 0x180>,
  143. <0x10000600 0x200>,
  144. <0x100000b0 0x10>;
  145. reg-names = "nand", "nand-cache", "nand-int-base";
  146. interrupt-parent = <&periph_intc>;
  147. interrupts = <50>;
  148. clocks = <&periph_clk 20>;
  149. clock-names = "nand";
  150. #address-cells = <1>;
  151. #size-cells = <0>;
  152. nand0: nandcs@0 {
  153. compatible = "brcm,nandcs";
  154. reg = <0>;
  155. nand-on-flash-bbt;
  156. nand-ecc-strength = <1>;
  157. nand-ecc-step-size = <512>;
  158. };
  159. };