partition.txt 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. Representing flash partitions in devicetree
  2. Partitions can be represented by sub-nodes of an mtd device. This can be used
  3. on platforms which have strong conventions about which portions of a flash are
  4. used for what purposes, but which don't use an on-flash partition table such
  5. as RedBoot.
  6. The partition table should be a subnode of the mtd node and should be named
  7. 'partitions'. This node should have the following property:
  8. - compatible : (required) must be "fixed-partitions"
  9. Partitions are then defined in subnodes of the partitions node.
  10. For backwards compatibility partitions as direct subnodes of the mtd device are
  11. supported. This use is discouraged.
  12. NOTE: also for backwards compatibility, direct subnodes that have a compatible
  13. string are not considered partitions, as they may be used for other bindings.
  14. #address-cells & #size-cells must both be present in the partitions subnode of the
  15. mtd device. There are two valid values for both:
  16. <1>: for partitions that require a single 32-bit cell to represent their
  17. size/address (aka the value is below 4 GiB)
  18. <2>: for partitions that require two 32-bit cells to represent their
  19. size/address (aka the value is 4 GiB or greater).
  20. Required properties:
  21. - reg : The partition's offset and size within the mtd bank.
  22. Optional properties:
  23. - label : The label / name for this partition. If omitted, the label is taken
  24. from the node name (excluding the unit address).
  25. - read-only : This parameter, if present, is a hint to Linux that this
  26. partition should only be mounted read-only. This is usually used for flash
  27. partitions containing early-boot firmware images or data which should not be
  28. clobbered.
  29. Examples:
  30. flash@0 {
  31. partitions {
  32. compatible = "fixed-partitions";
  33. #address-cells = <1>;
  34. #size-cells = <1>;
  35. partition@0 {
  36. label = "u-boot";
  37. reg = <0x0000000 0x100000>;
  38. read-only;
  39. };
  40. uimage@100000 {
  41. reg = <0x0100000 0x200000>;
  42. };
  43. };
  44. };
  45. flash@1 {
  46. partitions {
  47. compatible = "fixed-partitions";
  48. #address-cells = <1>;
  49. #size-cells = <2>;
  50. /* a 4 GiB partition */
  51. partition@0 {
  52. label = "filesystem";
  53. reg = <0x00000000 0x1 0x00000000>;
  54. };
  55. };
  56. };
  57. flash@2 {
  58. partitions {
  59. compatible = "fixed-partitions";
  60. #address-cells = <2>;
  61. #size-cells = <2>;
  62. /* an 8 GiB partition */
  63. partition@0 {
  64. label = "filesystem #1";
  65. reg = <0x0 0x00000000 0x2 0x00000000>;
  66. };
  67. /* a 4 GiB partition */
  68. partition@200000000 {
  69. label = "filesystem #2";
  70. reg = <0x2 0x00000000 0x1 0x00000000>;
  71. };
  72. };
  73. };