a8k_common.mk 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. #
  2. # Copyright (C) 2016 - 2020 Marvell International Ltd.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. # https://spdx.org/licenses
  6. PLAT_FAMILY := a8k
  7. PLAT_INCLUDE_BASE := include/plat/marvell/armada/$(PLAT_FAMILY)
  8. PLAT_COMMON_BASE := plat/marvell/armada/a8k/common
  9. MARVELL_DRV_BASE := drivers/marvell
  10. MARVELL_COMMON_BASE := plat/marvell/armada/common
  11. MARVELL_SVC_TEST := 0
  12. $(eval $(call add_define,MARVELL_SVC_TEST))
  13. ERRATA_A72_859971 := 1
  14. # Enable MSS support for a8k family
  15. MSS_SUPPORT := 1
  16. $(eval $(call add_define,MSS_SUPPORT))
  17. # Disable EL3 cache for power management
  18. BL31_CACHE_DISABLE := 0
  19. $(eval $(call add_define,BL31_CACHE_DISABLE))
  20. $(eval $(call add_define,PCI_EP_SUPPORT))
  21. $(eval $(call assert_boolean,PCI_EP_SUPPORT))
  22. AP_NUM := 1
  23. $(eval $(call add_define,AP_NUM))
  24. DOIMAGEPATH ?= tools/marvell/doimage
  25. DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
  26. include plat/marvell/marvell.mk
  27. include tools/marvell/doimage/doimage.mk
  28. ifeq (${MARVELL_SECURE_BOOT},1)
  29. DOIMAGE_SEC_FLAGS := -c $(DOIMAGE_SEC)
  30. DOIMAGE_LIBS_CHECK = \
  31. if ! [ -d "/usr/include/mbedtls" ]; then \
  32. echo "****************************************" >&2; \
  33. echo "Missing mbedTLS installation! " >&2; \
  34. echo "Please download it from \"tls.mbed.org\"" >&2; \
  35. echo "Alternatively on Debian/Ubuntu system install" >&2; \
  36. echo "\"libmbedtls-dev\" package" >&2; \
  37. echo "Make sure to use version 2.1.0 or later" >&2; \
  38. echo "****************************************" >&2; \
  39. exit 1; \
  40. else if ! [ -f "/usr/include/libconfig.h" ]; then \
  41. echo "********************************************************" >&2; \
  42. echo "Missing Libconfig installation!" >&2; \
  43. echo "Please download it from \"www.hyperrealm.com/libconfig/\"" >&2; \
  44. echo "Alternatively on Debian/Ubuntu system install packages" >&2; \
  45. echo "\"libconfig8\" and \"libconfig8-dev\"" >&2; \
  46. echo "********************************************************" >&2; \
  47. exit 1; \
  48. fi \
  49. fi
  50. else #MARVELL_SECURE_BOOT
  51. DOIMAGE_LIBS_CHECK =
  52. DOIMAGE_SEC_FLAGS =
  53. endif #MARVELL_SECURE_BOOT
  54. ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
  55. DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
  56. # Check whether to build system_power.c for the platform
  57. ifneq ("$(wildcard $(BOARD_DIR)/board/system_power.c)","")
  58. SYSTEM_POWER_SUPPORT = 1
  59. else
  60. SYSTEM_POWER_SUPPORT = 0
  61. endif
  62. # This define specifies DDR type for BLE
  63. $(eval $(call add_define,CONFIG_DDR4))
  64. # This define specifies DDR topology for BLE
  65. DDR_TOPOLOGY ?= 0
  66. $(eval $(call add_define,DDR_TOPOLOGY))
  67. MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
  68. drivers/arm/gic/v2/gicv2_main.c \
  69. drivers/arm/gic/v2/gicv2_helpers.c \
  70. plat/common/plat_gicv2.c
  71. PLAT_INCLUDES += -I$(BOARD_DIR) \
  72. -I$(BOARD_DIR)/board \
  73. -I$(CURDIR)/drivers/marvell \
  74. -I$(PLAT_COMMON_BASE)/include \
  75. -I$(PLAT_INCLUDE_BASE)/common
  76. PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
  77. drivers/ti/uart/aarch64/16550_console.S
  78. ifndef BLE_PORTING_SOURCES
  79. BLE_PORTING_SOURCES := $(BOARD_DIR)/board/dram_port.c \
  80. $(BOARD_DIR)/board/marvell_plat_config.c
  81. endif
  82. MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c
  83. BLE_SOURCES := drivers/mentor/i2c/mi2cv.c \
  84. $(PLAT_COMMON_BASE)/plat_ble_setup.c \
  85. $(MARVELL_MOCHI_DRV) \
  86. $(PLAT_COMMON_BASE)/plat_pm.c \
  87. $(MARVELL_DRV_BASE)/ap807_clocks_init.c \
  88. $(MARVELL_DRV_BASE)/thermal.c \
  89. $(PLAT_COMMON_BASE)/plat_thermal.c \
  90. $(BLE_PORTING_SOURCES) \
  91. $(MARVELL_DRV_BASE)/ccu.c \
  92. $(MARVELL_DRV_BASE)/io_win.c
  93. BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
  94. lib/cpus/aarch64/cortex_a72.S
  95. MARVELL_DRV := $(MARVELL_DRV_BASE)/io_win.c \
  96. $(MARVELL_DRV_BASE)/iob.c \
  97. $(MARVELL_DRV_BASE)/mci.c \
  98. $(MARVELL_DRV_BASE)/amb_adec.c \
  99. $(MARVELL_DRV_BASE)/ccu.c \
  100. $(MARVELL_DRV_BASE)/cache_llc.c \
  101. $(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
  102. $(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c \
  103. $(MARVELL_DRV_BASE)/secure_dfx_access/armada_thermal.c \
  104. $(MARVELL_DRV_BASE)/secure_dfx_access/misc_dfx.c \
  105. $(MARVELL_DRV_BASE)/ddr_phy_access.c \
  106. drivers/rambus/trng_ip_76.c
  107. ifeq (${MSS_SUPPORT}, 1)
  108. MARVELL_DRV += $(MARVELL_DRV_BASE)/mg_conf_cm3/mg_conf_cm3.c
  109. endif
  110. ifndef BL31_PORTING_SOURCES
  111. BL31_PORTING_SOURCES := $(BOARD_DIR)/board/marvell_plat_config.c
  112. endif
  113. ifeq ($(SYSTEM_POWER_SUPPORT),1)
  114. BL31_PORTING_SOURCES += $(BOARD_DIR)/board/system_power.c
  115. endif
  116. BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
  117. $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
  118. $(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
  119. $(PLAT_COMMON_BASE)/plat_pm.c \
  120. $(PLAT_COMMON_BASE)/plat_bl31_setup.c \
  121. $(MARVELL_COMMON_BASE)/marvell_gicv2.c \
  122. $(MARVELL_COMMON_BASE)/mrvl_sip_svc.c \
  123. $(MARVELL_COMMON_BASE)/marvell_ddr_info.c \
  124. $(BL31_PORTING_SOURCES) \
  125. $(MARVELL_DRV) \
  126. $(MARVELL_MOCHI_DRV) \
  127. $(MARVELL_GIC_SOURCES)
  128. # Add trace functionality for PM
  129. BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c
  130. ifeq (${MSS_SUPPORT}, 1)
  131. # Force builds with BL2 image on a80x0 platforms
  132. ifndef SCP_BL2
  133. $(error "Error: SCP_BL2 image is mandatory for a8k family")
  134. endif
  135. # MSS (SCP) build
  136. include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk
  137. endif
  138. # BLE (ROM context execution code, AKA binary extension)
  139. BLE_PATH ?= $(PLAT_COMMON_BASE)/ble
  140. include ${BLE_PATH}/ble.mk
  141. $(eval $(call MAKE_BL,ble))
  142. clean realclean distclean: mrvl_clean
  143. .PHONY: mrvl_clean
  144. mrvl_clean:
  145. $(s)echo " Doimage CLEAN"
  146. $(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${DOIMAGEPATH} clean
  147. ${DOIMAGETOOL}: FORCE
  148. $(q)$(DOIMAGE_LIBS_CHECK)
  149. $(q)${MAKE} --no-print-directory -C ${DOIMAGEPATH}
  150. ${BUILD_PLAT}/${FLASH_IMAGE}: ${ROM_BIN_EXT} ${BUILD_PLAT}/${BOOT_IMAGE} ${DOIMAGETOOL}
  151. $(s)echo
  152. $(s)echo "Building flash image"
  153. $(q)${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE}
  154. $(s)echo
  155. $(s)echo "Built $@ successfully"
  156. $(s)echo