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