mxs-bootlets.mk 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ################################################################################
  2. #
  3. # mxs-bootlets
  4. #
  5. ################################################################################
  6. ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL),y)
  7. MXS_BOOTLETS_TARBALL = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL))
  8. MXS_BOOTLETS_SITE = $(patsubst %/,%,$(dir $(MXS_BOOTLETS_TARBALL)))
  9. MXS_BOOTLETS_SOURCE = $(notdir $(MXS_BOOTLETS_TARBALL))
  10. BR_NO_CHECK_HASH_FOR += $(MXS_BOOTLETS_SOURCE)
  11. else ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT),y)
  12. MXS_BOOTLETS_SITE = $(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_URL)
  13. MXS_BOOTLETS_SITE_METHOD = git
  14. MXS_BOOTLETS_VERSION = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION))
  15. BR_NO_CHECK_HASH_FOR += $(MXS_BOOTLETS_SOURCE)
  16. else
  17. MXS_BOOTLETS_VERSION = 10.12.01
  18. MXS_BOOTLETS_SITE = http://download.ossystems.com.br/bsp/freescale/source
  19. MXS_BOOTLETS_SOURCE = imx-bootlets-src-$(MXS_BOOTLETS_VERSION).tar.gz
  20. endif
  21. ifeq ($(BR2_TARGET_MXS_BOOTLETS_STMP37xx),y)
  22. MXS_BOOTLETS_BOARD = stmp37xx_dev
  23. else ifeq ($(BR2_TARGET_MXS_BOOTLETS_STMP378x),y)
  24. MXS_BOOTLETS_BOARD = stmp378x_dev
  25. else ifeq ($(BR2_TARGET_MXS_BOOTLETS_IMX28EVK),y)
  26. MXS_BOOTLETS_BOARD = iMX28_EVK
  27. else ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD),y)
  28. MXS_BOOTLETS_BOARD = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME))
  29. endif
  30. ifeq ($(BR2_TARGET_MXS_BOOTLETS_HAS_IVT),y)
  31. MXS_BOOTLETS_IVT_SUFFIX = _ivt
  32. MXS_BOOTLETS_ELFTOSB_OPTIONS += -f imx28
  33. endif
  34. MXS_BOOTLETS_DEPENDENCIES = host-elftosb
  35. MXS_BOOTLETS_LICENSE = GPL-2.0+
  36. ifeq ($(BR2_TARGET_MXS_BOOTLETS_BAREBOX),y)
  37. MXS_BOOTLETS_DEPENDENCIES += barebox
  38. MXS_BOOTLETS_BOOTDESC = barebox$(MXS_BOOTLETS_IVT_SUFFIX).bd
  39. MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_barebox$(MXS_BOOTLETS_IVT_SUFFIX).sb
  40. else ifeq ($(BR2_TARGET_MXS_BOOTLETS_LINUX),y)
  41. MXS_BOOTLETS_DEPENDENCIES += linux
  42. MXS_BOOTLETS_BOOTDESC = linux$(MXS_BOOTLETS_IVT_SUFFIX).bd
  43. MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_linux$(MXS_BOOTLETS_IVT_SUFFIX).sb
  44. else ifeq ($(BR2_TARGET_MXS_BOOTLETS_UBOOT),y)
  45. MXS_BOOTLETS_DEPENDENCIES += uboot
  46. MXS_BOOTLETS_BOOTDESC = uboot$(MXS_BOOTLETS_IVT_SUFFIX).bd
  47. MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_uboot$(MXS_BOOTLETS_IVT_SUFFIX).sb
  48. endif
  49. ifeq ($(BR2_TARGET_MXS_BOOTLETS_BAREBOX),y)
  50. define MXS_BOOTLETS_SED_BAREBOX
  51. sed -i 's,[^ *]barebox.*;,\tbarebox="$(BAREBOX_DIR)/barebox";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
  52. endef
  53. endif
  54. ifeq ($(BR2_TARGET_MXS_BOOTLETS_LINUX),y)
  55. define MXS_BOOTLETS_BUILD_LINUX_PREP
  56. BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
  57. $(MAKE1) -C $(@D) linux_prep
  58. endef
  59. define MXS_BOOTLETS_SED_LINUX
  60. sed -i 's,[^ *]linux_prep.*;,\tlinux_prep="$(@D)/linux_prep/output-target/linux_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
  61. sed -i 's,[^ *]zImage.*;,\tzImage="$(LINUX_DIR)/arch/arm/boot/zImage";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
  62. endef
  63. endif
  64. ifeq ($(BR2_TARGET_MXS_BOOTLETS_UBOOT),y)
  65. define MXS_BOOTLETS_SED_UBOOT
  66. sed -i 's,[^ *]u_boot.*;,\tu_boot="$(UBOOT_DIR)/u-boot";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
  67. endef
  68. endif
  69. define MXS_BOOTLETS_INSTALL_BAREBOX_BOOTDESC
  70. cp boot/mxs-bootlets/barebox_ivt.bd $(@D)/
  71. endef
  72. MXS_BOOTLETS_POST_EXTRACT_HOOKS += MXS_BOOTLETS_INSTALL_BAREBOX_BOOTDESC
  73. define MXS_BOOTLETS_BUILD_CMDS
  74. BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
  75. $(MAKE1) -C $(@D) power_prep
  76. BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
  77. $(MAKE1) -C $(@D) boot_prep
  78. $(MXS_BOOTLETS_BUILD_LINUX_PREP)
  79. sed -i 's,[^ *]power_prep.*;,\tpower_prep="$(@D)/power_prep/power_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
  80. sed -i 's,[^ *]sdram_prep.*;,\tsdram_prep="$(@D)/boot_prep/boot_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
  81. $(MXS_BOOTLETS_SED_BAREBOX)
  82. $(MXS_BOOTLETS_SED_LINUX)
  83. $(MXS_BOOTLETS_SED_UBOOT)
  84. $(HOST_DIR)/bin/elftosb $(MXS_BOOTLETS_ELFTOSB_OPTIONS) \
  85. -z -c $(@D)/$(MXS_BOOTLETS_BOOTDESC) \
  86. -o $(@D)/$(MXS_BOOTLETS_BOOTSTREAM)
  87. endef
  88. define MXS_BOOTLETS_INSTALL_TARGET_CMDS
  89. cp $(@D)/$(MXS_BOOTLETS_BOOTSTREAM) $(BINARIES_DIR)/
  90. endef
  91. $(eval $(generic-package))