partition.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. Flash partitions in device tree
  2. ===============================
  3. Flash devices can be partitioned into one or more functional ranges (e.g. "boot
  4. code", "nvram", "kernel").
  5. Different devices may be partitioned in a different ways. Some may use a fixed
  6. flash layout set at production time. Some may use on-flash table that describes
  7. the geometry and naming/purpose of each functional region. It is also possible
  8. to see these methods mixed.
  9. To assist system software in locating partitions, we allow describing which
  10. method is used for a given flash device. To describe the method there should be
  11. a subnode of the flash device that is named 'partitions'. It must have a
  12. 'compatible' property, which is used to identify the method to use.
  13. When a single partition is represented with a DT node (it depends on a used
  14. format) it may also be described using above rules ('compatible' and optionally
  15. some extra properties / subnodes). It allows describing more complex,
  16. hierarchical (multi-level) layouts and should be used if there is some
  17. significant relation between partitions or some partition internally uses
  18. another partitioning method.
  19. Available bindings are listed in the "partitions" subdirectory.
  20. Fixed Partitions
  21. ================
  22. Partitions can be represented by sub-nodes of a flash device. This can be used
  23. on platforms which have strong conventions about which portions of a flash are
  24. used for what purposes, but which don't use an on-flash partition table such
  25. as RedBoot.
  26. The partition table should be a subnode of the flash node and should be named
  27. 'partitions'. This node should have the following property:
  28. - compatible : (required) must be "fixed-partitions"
  29. Partitions are then defined in subnodes of the partitions node.
  30. For backwards compatibility partitions as direct subnodes of the flash device are
  31. supported. This use is discouraged.
  32. NOTE: also for backwards compatibility, direct subnodes that have a compatible
  33. string are not considered partitions, as they may be used for other bindings.
  34. #address-cells & #size-cells must both be present in the partitions subnode of the
  35. flash device. There are two valid values for both:
  36. <1>: for partitions that require a single 32-bit cell to represent their
  37. size/address (aka the value is below 4 GiB)
  38. <2>: for partitions that require two 32-bit cells to represent their
  39. size/address (aka the value is 4 GiB or greater).
  40. Required properties:
  41. - reg : The partition's offset and size within the flash
  42. Optional properties:
  43. - label : The label / name for this partition. If omitted, the label is taken
  44. from the node name (excluding the unit address).
  45. - read-only : This parameter, if present, is a hint to Linux that this
  46. partition should only be mounted read-only. This is usually used for flash
  47. partitions containing early-boot firmware images or data which should not be
  48. clobbered.
  49. - lock : Do not unlock the partition at initialization time (not supported on
  50. all devices)
  51. Examples:
  52. flash@0 {
  53. partitions {
  54. compatible = "fixed-partitions";
  55. #address-cells = <1>;
  56. #size-cells = <1>;
  57. partition@0 {
  58. label = "u-boot";
  59. reg = <0x0000000 0x100000>;
  60. read-only;
  61. };
  62. uimage@100000 {
  63. reg = <0x0100000 0x200000>;
  64. };
  65. };
  66. };
  67. flash@1 {
  68. partitions {
  69. compatible = "fixed-partitions";
  70. #address-cells = <1>;
  71. #size-cells = <2>;
  72. /* a 4 GiB partition */
  73. partition@0 {
  74. label = "filesystem";
  75. reg = <0x00000000 0x1 0x00000000>;
  76. };
  77. };
  78. };
  79. flash@2 {
  80. partitions {
  81. compatible = "fixed-partitions";
  82. #address-cells = <2>;
  83. #size-cells = <2>;
  84. /* an 8 GiB partition */
  85. partition@0 {
  86. label = "filesystem #1";
  87. reg = <0x0 0x00000000 0x2 0x00000000>;
  88. };
  89. /* a 4 GiB partition */
  90. partition@200000000 {
  91. label = "filesystem #2";
  92. reg = <0x2 0x00000000 0x1 0x00000000>;
  93. };
  94. };
  95. };
  96. flash@3 {
  97. partitions {
  98. compatible = "fixed-partitions";
  99. #address-cells = <1>;
  100. #size-cells = <1>;
  101. partition@0 {
  102. label = "bootloader";
  103. reg = <0x000000 0x100000>;
  104. read-only;
  105. };
  106. firmware@100000 {
  107. label = "firmware";
  108. reg = <0x100000 0xe00000>;
  109. compatible = "brcm,trx";
  110. };
  111. calibration@f00000 {
  112. label = "calibration";
  113. reg = <0xf00000 0x100000>;
  114. compatible = "fixed-partitions";
  115. ranges = <0 0xf00000 0x100000>;
  116. #address-cells = <1>;
  117. #size-cells = <1>;
  118. partition@0 {
  119. label = "wifi0";
  120. reg = <0x000000 0x080000>;
  121. };
  122. partition@80000 {
  123. label = "wifi1";
  124. reg = <0x080000 0x080000>;
  125. };
  126. };
  127. };
  128. };