brcm,brcmnand.txt 6.7 KB

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