README.TPL 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Generic TPL framework
  2. =====================
  3. Overview
  4. --------
  5. TPL---Third Program Loader.
  6. Due to the SPL on some boards(powerpc mpc85xx) has a size limit and cannot
  7. be compatible with all the external device(e.g. DDR). So add a tertiary
  8. program loader (TPL) to enable a loader stub loaded by the code from the
  9. SPL. It loads the final uboot image into DDR, then jump to it to begin
  10. execution. Now, only the powerpc mpc85xx has this requirement and will
  11. implemente it.
  12. Keep consistent with SPL, with this framework almost all source files for a
  13. board can be reused. No code duplication or symlinking is necessary anymore.
  14. How it works
  15. ------------
  16. There has been a directory $(srctree)/spl which contains only a Makefile. The
  17. Makefile is shared by SPL and TPL.
  18. The object files are built separately for SPL/TPL and placed in the
  19. directory spl/tpl. The final binaries which are generated are
  20. u-boot-{spl|tpl}, u-boot-{spl|tpl}.bin and u-boot-{spl|tpl}.map.
  21. During the TPL build a variable named CONFIG_TPL_BUILD is exported in the
  22. make environment and also appended to CPPFLAGS with -DCONFIG_TPL_BUILD.
  23. The SPL options are shared by SPL and TPL, the board config file should
  24. determine which SPL options to choose based on whether CONFIG_TPL_BUILD
  25. is set. Source files can be compiled for TPL with options chosen in the
  26. board config file.
  27. TPL use a small device tree (u-boot-tpl.dtb), containing only the nodes with
  28. the pre-relocation properties: 'u-boot,dm-pre-reloc' and 'u-boot,dm-tpl'
  29. (see README.SPL for details).
  30. For example:
  31. spl/Makefile:
  32. LIBS-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/libcommon.o
  33. CONFIG_SPL_LIBCOMMON_SUPPORT is defined in board config file:
  34. #ifdef CONFIG_TPL_BUILD
  35. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  36. #endif