brcm,brcmnand.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. - #address-cells : <1> - subnodes give the chip-select number
  43. - #size-cells : <0>
  44. Optional properties:
  45. - clock : reference to the clock for the NAND controller
  46. - clock-names : "nand" (required for the above clock)
  47. - brcm,nand-has-wp : Some versions of this IP include a write-protect
  48. (WP) control bit. It is always available on >=
  49. v7.0. Use this property to describe the rare
  50. earlier versions of this core that include WP
  51. -- Additional SoC-specific NAND controller properties --
  52. The NAND controller is integrated differently on the variety of SoCs on which it
  53. is found. Part of this integration involves providing status and enable bits
  54. with which to control the 8 exposed NAND interrupts, as well as hardware for
  55. configuring the endianness of the data bus. On some SoCs, these features are
  56. handled via standard, modular components (e.g., their interrupts look like a
  57. normal IRQ chip), but on others, they are controlled in unique and interesting
  58. ways, sometimes with registers that lump multiple NAND-related functions
  59. together. The former case can be described simply by the standard interrupts
  60. properties in the main controller node. But for the latter exceptional cases,
  61. we define additional 'compatible' properties and associated register resources within the NAND controller node above.
  62. - compatible: Can be one of several SoC-specific strings. Each SoC may have
  63. different requirements for its additional properties, as described below each
  64. bullet point below.
  65. * "brcm,nand-bcm63138"
  66. - reg: (required) the 'NAND_INT_BASE' register range, with separate status
  67. and enable registers
  68. - reg-names: (required) "nand-int-base"
  69. * "brcm,nand-bcm6368"
  70. - compatible: should contain "brcm,nand-bcm<soc>", "brcm,nand-bcm6368"
  71. - reg: (required) the 'NAND_INTR_BASE' register range, with combined status
  72. and enable registers, and boot address registers
  73. - reg-names: (required) "nand-int-base"
  74. * "brcm,nand-iproc"
  75. - reg: (required) the "IDM" register range, for interrupt enable and APB
  76. bus access endianness configuration, and the "EXT" register range,
  77. for interrupt status/ack.
  78. - reg-names: (required) a list of the names corresponding to the previous
  79. register ranges. Should contain "iproc-idm" and "iproc-ext".
  80. * NAND chip-select
  81. Each controller (compatible: "brcm,brcmnand") may contain one or more subnodes
  82. to represent enabled chip-selects which (may) contain NAND flash chips. Their
  83. properties are as follows.
  84. Required properties:
  85. - compatible : should contain "brcm,nandcs"
  86. - reg : a single integer representing the chip-select
  87. number (e.g., 0, 1, 2, etc.)
  88. - #address-cells : see partition.txt
  89. - #size-cells : see partition.txt
  90. - nand-ecc-strength : see nand.txt
  91. - nand-ecc-step-size : must be 512 or 1024. See nand.txt
  92. Optional properties:
  93. - nand-on-flash-bbt : boolean, to enable the on-flash BBT for this
  94. chip-select. See nand.txt
  95. - brcm,nand-oob-sector-size : integer, to denote the spare area sector size
  96. expected for the ECC layout in use. This size, in
  97. addition to the strength and step-size,
  98. determines how the hardware BCH engine will lay
  99. out the parity bytes it stores on the flash.
  100. This property can be automatically determined by
  101. the flash geometry (particularly the NAND page
  102. and OOB size) in many cases, but when booting
  103. from NAND, the boot controller has only a limited
  104. number of available options for its default ECC
  105. layout.
  106. Each nandcs device node may optionally contain sub-nodes describing the flash
  107. partition mapping. See partition.txt for more detail.
  108. Example:
  109. nand@f0442800 {
  110. compatible = "brcm,brcmnand-v7.0", "brcm,brcmnand";
  111. reg = <0xF0442800 0x600>,
  112. <0xF0443000 0x100>;
  113. reg-names = "nand", "flash-dma";
  114. interrupt-parent = <&hif_intr2_intc>;
  115. interrupts = <24>, <4>;
  116. #address-cells = <1>;
  117. #size-cells = <0>;
  118. nandcs@1 {
  119. compatible = "brcm,nandcs";
  120. reg = <1>; // Chip select 1
  121. nand-on-flash-bbt;
  122. nand-ecc-strength = <12>;
  123. nand-ecc-step-size = <512>;
  124. // Partitions
  125. #address-cells = <1>; // <2>, for 64-bit offset
  126. #size-cells = <1>; // <2>, for 64-bit length
  127. flash0.rootfs@0 {
  128. reg = <0 0x10000000>;
  129. };
  130. flash0@0 {
  131. reg = <0 0>; // MTDPART_SIZ_FULL
  132. };
  133. flash0.kernel@10000000 {
  134. reg = <0x10000000 0x400000>;
  135. };
  136. };
  137. };
  138. nand@10000200 {
  139. compatible = "brcm,nand-bcm63168", "brcm,nand-bcm6368",
  140. "brcm,brcmnand-v4.0", "brcm,brcmnand";
  141. reg = <0x10000200 0x180>,
  142. <0x10000600 0x200>,
  143. <0x100000b0 0x10>;
  144. reg-names = "nand", "nand-cache", "nand-int-base";
  145. interrupt-parent = <&periph_intc>;
  146. interrupts = <50>;
  147. clocks = <&periph_clk 20>;
  148. clock-names = "nand";
  149. #address-cells = <1>;
  150. #size-cells = <0>;
  151. nand0: nandcs@0 {
  152. compatible = "brcm,nandcs";
  153. reg = <0>;
  154. nand-on-flash-bbt;
  155. nand-ecc-strength = <1>;
  156. nand-ecc-step-size = <512>;
  157. };
  158. };