u-boot.mk 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # SPDX-License-Identifier: GPL-2.0
  2. UBOOT_NAME=u-boot
  3. UBOOT_BUILD_DEPENDENT_PACKAGES=dtc
  4. UBOOT_REPO_DIR=$(CONFIG_UBOOT_REPO_PATH)
  5. ifeq ($(CONFIG_UBOOT_BUILD_IN_TMPFS),y)
  6. UBOOT_BUILD_IN_TMPFS=/tempfs
  7. endif
  8. UBOOT_SRC_DIR=$(SDK_BUILD_DIR)$(UBOOT_BUILD_IN_TMPFS)/firmware/$(UBOOT_NAME)
  9. UBOOT_INSTALL_DIR=$(SDK_OUTPUT_DIR)/firmware/$(UBOOT_NAME)
  10. uboot_update:
  11. @$(call fetch_remote, $(UBOOT_REPO_DIR), $(CONFIG_UBOOT_GIT_REMOTE))
  12. #==============================================================================
  13. # Build the U-Boot for some board.
  14. #==============================================================================
  15. _BOARD_UBOOT_SRC_DIR=$(join $(UBOOT_SRC_DIR), $(CONFIG_BOARD_SUBFIX))
  16. _BOARD_UBOOT_INSTALL_DIR=$(join $(UBOOT_INSTALL_DIR), $(CONFIG_BOARD_SUBFIX))
  17. _BOARD_UBOOT_BIN_PATH=$(_BOARD_UBOOT_INSTALL_DIR)/u-boot.bin
  18. _BOARD_UBOOT_DTB_PATH=$(_BOARD_UBOOT_INSTALL_DIR)/u-boot.dtb
  19. #_board_uboot_update:
  20. # @$(call fetch_remote, $(UBOOT_REPO_DIR), $(CONFIG_UBOOT_GIT_REMOTE))
  21. _board_uboot_checkout_with_check:
  22. OVERWRITED_CHK=Y;\
  23. $(call checkout_src_full, $(UBOOT_REPO_DIR),\
  24. $(CONFIG_UBOOT_GIT_REMOTE) \
  25. $(CONFIG_UBOOT_GIT_RBRANCH), \
  26. $(CONFIG_UBOOT_GIT_LBRANCH), \
  27. $(_BOARD_UBOOT_SRC_DIR),)
  28. _board_uboot_checkout:
  29. $(call checkout_src_full, $(UBOOT_REPO_DIR),\
  30. $(CONFIG_UBOOT_GIT_REMOTE) \
  31. $(CONFIG_UBOOT_GIT_RBRANCH), \
  32. $(CONFIG_UBOOT_GIT_LBRANCH), \
  33. $(_BOARD_UBOOT_SRC_DIR),)
  34. _board_uboot_devel:
  35. $(call devel_init, $(_BOARD_UBOOT_SRC_DIR))
  36. _board_uboot_defconfig:
  37. $(call build_target, $(_BOARD_UBOOT_SRC_DIR), \
  38. $(CROSS_COMPILE_RV64_ENV), \
  39. $(CONFIG_UBOOT_BUILD_TARGET)_defconfig)
  40. _board_uboot_menuconfig:
  41. $(call build_target, $(_BOARD_UBOOT_SRC_DIR), \
  42. $(CROSS_COMPILE_RV64_ENV), \
  43. menuconfig)
  44. _board_uboot_mkdefconfig:
  45. $(call build_target, $(_BOARD_UBOOT_SRC_DIR), \
  46. $(CROSS_COMPILE_RV64_ENV), \
  47. savedefconfig)
  48. # cd $(_BOARD_UBOOT_SRC_DIR); \
  49. # mv defconfig arch/riscv/configs/starfive_jh7100_starlight_fedora_defconfig
  50. _board_uboot_build_dtb:
  51. $(call build_target, $(_BOARD_UBOOT_SRC_DIR), \
  52. $(CROSS_COMPILE_RV64_ENV), \
  53. u-boot.dtb)
  54. _board_uboot_install_dtb:
  55. $(call install_bin, \
  56. $(_BOARD_UBOOT_SRC_DIR)/u-boot.dtb, \
  57. $(_BOARD_UBOOT_INSTALL_DIR))
  58. _board_uboot_build_silent:
  59. SILENT_BUILD=Y; \
  60. $(call build_target_log, $(_BOARD_UBOOT_SRC_DIR), \
  61. $(CROSS_COMPILE_RV64_ENV), \
  62. tools u-boot.bin u-boot.dtb)
  63. _board_uboot_build:
  64. $(call build_target_log, $(_BOARD_UBOOT_SRC_DIR), \
  65. $(CROSS_COMPILE_RV64_ENV), \
  66. u-boot.bin u-boot.dtb)
  67. _board_uboot_build_tools:
  68. $(call build_target_log, $(_BOARD_UBOOT_SRC_DIR), \
  69. $(CROSS_COMPILE_RV64_ENV), \
  70. tools)
  71. _board_uboot_clean:
  72. $(call build_target, $(_BOARD_UBOOT_SRC_DIR), \
  73. $(CROSS_COMPILE_RV64_ENV), \
  74. clean)
  75. _board_uboot_install:
  76. $(call install_bin, \
  77. $(_BOARD_UBOOT_SRC_DIR)/u-boot*, \
  78. $(_BOARD_UBOOT_INSTALL_DIR))
  79. _board_uboot_all: _board_uboot_checkout _board_uboot_defconfig _board_uboot_menuconfig _board_uboot_build _board_uboot_install
  80. # _board_opensbi_checkout _board_opensbi_build _board_opensbi_install