README.multi-dtb-fit 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. MULTI DTB FIT and SPL_MULTI_DTB_FIT
  2. The purpose of this feature is to enable U-Boot or the SPL to select its DTB
  3. from a FIT appended at the end of the binary.
  4. It comes in two flavors: U-Boot (CONFIG_MULTI_DTB_FIT) and SPL
  5. (CONFIG_SPL_MULTI_DTB_FIT).
  6. U-Boot flavor:
  7. Usually the DTB is selected by the SPL and passed down to U-Boot. But some
  8. platforms don't use the SPL. In this case MULTI_DTB_FIT can used to provide
  9. U-Boot with a choice of DTBs.
  10. The relevant DTBs are packed into a FIT (list provided by CONFIG__OF_LIST). The
  11. FIT is automatically generated at the end of the compilation and appended to
  12. u-boot.bin so that U-Boot can locate it and select the correct DTB from inside
  13. the FIT.
  14. The selection is done using board_fit_config_name_match() (same as what the SPL
  15. uses to select the DTB for U-Boot). The selection happens during fdtdec_setup()
  16. which is called during before relocation by board_init_f().
  17. SPL flavor:
  18. the SPL uses only a small subset of the DTB and it usually depends more
  19. on the SOC than on the board. So it's usually fine to include a DTB in the
  20. SPL that doesn't exactly match the board. There are howerver some cases
  21. where it's not possible. In the later case, in order to support multiple
  22. boards (or board revisions) with the same SPL binary, SPL_MULTI_DTB_FIT
  23. can be used.
  24. The relevant DTBs are packed into a FIT. This FIT is automatically generated
  25. at the end of the compilation, compressed and appended to u-boot-spl.bin, so
  26. that SPL can locate it and select the correct DTB from inside the FIT.
  27. CONFIG_SPL__OF_LIST is used to list the relevant DTBs.
  28. The compression stage is optional but reduces the impact on the size of the
  29. SPL. LZO and GZIP compressions are supported. By default, the area where the
  30. FIT is uncompressed is dynamicaly allocated but this behaviour can be changed
  31. for platforms that don't provide a HEAP big enough to contain the uncompressed
  32. FIT.
  33. The SPL uses board_fit_config_name_match() to find the correct DTB within the
  34. FIT (same as what the SPL uses to select the DTB for U-Boot).
  35. Uncompression and selection stages happen in fdtdec_setup() which is called
  36. during the early initialization stage of the SPL (spl_early_init() or
  37. spl_init())
  38. Impacts and performances (SPL flavor):
  39. The impact of this option is relatively small. Here are some numbers measured
  40. for a TI DRA72 platform:
  41. +----------+------------+-----------+------------+
  42. | size | size delta | SPL boot | boot time |
  43. | (bytes) | (bytes) | time (s) | delta (s) |
  44. +---------------------------+----------+------------+-----------+------------+
  45. | 1 DTB | | | | |
  46. +---------------------------+----------+------------+-----------+------------+
  47. | reference | 125305 | 0 | 1.389 | 0 |
  48. | LZO (dynamic allocation) | 125391 | 86 | 1.381 | -0.008 |
  49. +---------------------------+----------+------------+-----------+------------+
  50. | 4 DTBs (DRA7, DRA71, | | | | |
  51. | DRA72, DRA72 revC) | | | | |
  52. +---------------------------+----------+------------+-----------+------------+
  53. | LZO (dynamic allocation) | 125991 | 686 | 1.39 | 0.001 |
  54. | LZO (user defined area) | 125927 | 622 | 1.403 | 0.014 |
  55. | GZIP (user defined area) | 133880 | 8575 | 1.421 | 0.032 |
  56. | No compression (in place) | 137472 | 12167 | 1.412 | 0.023 |
  57. +---------------------------+----------+------------+-----------+------------+
  58. Note: SPL boot time is the time elapsed between the 'reset' command is entered
  59. and the time when the first U-Boot (not SPL) version string is displayed.