partitions.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. .. _partitions:
  3. Partitions
  4. ==========
  5. Synopsis
  6. --------
  7. ::
  8. <command> <interface> [devnum][.hwpartnum][:partnum|#partname]
  9. Description
  10. -----------
  11. Many U-Boot commands allow specifying partitions (or whole disks) using a
  12. generic syntax.
  13. interface
  14. The interface used to access the partition's device, like ``mmc`` or
  15. ``scsi``. For a full list of supported interfaces, consult the
  16. ``if_typename_str`` array in ``drivers/block/blk-uclass.c``
  17. devnum
  18. The device number. This defaults to 0.
  19. hwpartnum
  20. The hardware partition number. All devices have at least one hardware
  21. partition. On most devices, hardware partition 0 specifies the whole
  22. device. On eMMC devices, hardware partition 0 is the user partition,
  23. hardware partitions 1 and 2 are the boot partitions, hardware partition
  24. 3 is the RPMB partition, and further partitions are general-purpose
  25. user-created partitions. The default hardware partition number is 0.
  26. partnum
  27. The partition number, starting from 1. The partition number 0 specifies
  28. that the whole device is to be used as one "partition."
  29. partname
  30. The partition name. This is the partition label for GPT partitions. For
  31. MBR partitions, the following syntax is used::
  32. <devtype><devletter><partnum>
  33. devtype
  34. A device type like ``mmcsd`` or ``hd``. See the
  35. ``part_set_generic_name`` function in ``disk/part.c`` for a
  36. complete list.
  37. devletter
  38. The device number as an offset from ``a``. For example, device
  39. number 2 would have a device letter of ``c``.
  40. partnum
  41. The partition number. This is the same as above.
  42. If neither ``partname`` nor ``partnum`` is specified and there is a partition
  43. table, then partition 1 is used. If there is no partition table, then the whole
  44. device is used as one "partition." If none of ``devnum``, ``hwpartnum``,
  45. ``partnum``, or ``partname`` is specified, or only ``-`` is specified, then
  46. ``devnum`` defaults to the value of the ``bootdevice`` environmental variable.
  47. Examples
  48. --------
  49. List the root directory contents on MMC device 2, hardware partition 1,
  50. and partition number 3::
  51. ls mmc 2.1:3 /
  52. Load ``/kernel.itb`` to address ``0x80000000`` from SCSI device 0, hardware partition
  53. 0, and the partition labeled ``boot``::
  54. load scsi #boot 0x80000000 /kernel.itb
  55. Print the partition UUID of the SATA device ``$bootdevice``, hardware partition
  56. 0, and partition number 0::
  57. part uuid sata -