xref: /rk3399_ARM-atf/plat/marvell/armada/a8k/common/a8k_common.mk (revision 0aa9f3c0f2f2ff675c3c12ae5ac6ceb475d6a16f)
1#
2# Copyright (C) 2016 - 2020 Marvell International Ltd.
3#
4# SPDX-License-Identifier:     BSD-3-Clause
5# https://spdx.org/licenses
6
7include tools/marvell/doimage/doimage.mk
8
9PLAT_FAMILY		:= a8k
10PLAT_INCLUDE_BASE	:= include/plat/marvell/armada/$(PLAT_FAMILY)
11PLAT_COMMON_BASE	:= plat/marvell/armada/a8k/common
12MARVELL_DRV_BASE	:= drivers/marvell
13MARVELL_COMMON_BASE	:= plat/marvell/armada/common
14
15MARVELL_SVC_TEST		:= 0
16$(eval $(call add_define,MARVELL_SVC_TEST))
17
18ERRATA_A72_859971	:= 1
19
20# Enable MSS support for a8k family
21MSS_SUPPORT		:= 1
22
23# Disable EL3 cache for power management
24BL31_CACHE_DISABLE	:= 0
25$(eval $(call add_define,BL31_CACHE_DISABLE))
26
27$(eval $(call add_define,PCI_EP_SUPPORT))
28$(eval $(call assert_boolean,PCI_EP_SUPPORT))
29
30AP_NUM			:= 1
31$(eval $(call add_define,AP_NUM))
32
33DOIMAGEPATH		?=	tools/marvell/doimage
34DOIMAGETOOL		?=	${DOIMAGEPATH}/doimage
35
36ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
37DOIMAGE_FLAGS	+= -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
38
39# Check whether to build system_power.c for the platform
40ifneq ("$(wildcard $(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c)","")
41SYSTEM_POWER_SUPPORT = 1
42else
43SYSTEM_POWER_SUPPORT = 0
44endif
45
46# This define specifies DDR type for BLE
47$(eval $(call add_define,CONFIG_DDR4))
48
49MARVELL_GIC_SOURCES	:=	drivers/arm/gic/common/gic_common.c	\
50				drivers/arm/gic/v2/gicv2_main.c		\
51				drivers/arm/gic/v2/gicv2_helpers.c	\
52				plat/common/plat_gicv2.c
53
54PLAT_INCLUDES		:=	-I$(BOARD_DIR)				\
55				-I$(BOARD_DIR)/board			\
56				-I$(PLAT_COMMON_BASE)/include		\
57				-I$(PLAT_INCLUDE_BASE)/common
58
59PLAT_BL_COMMON_SOURCES	:=	$(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
60				drivers/ti/uart/aarch64/16550_console.S
61
62BLE_PORTING_SOURCES	:=	$(BOARD_DIR)/board/dram_port.c \
63				$(BOARD_DIR)/board/marvell_plat_config.c
64
65MARVELL_MOCHI_DRV	+=	$(MARVELL_DRV_BASE)/mochi/cp110_setup.c
66
67BLE_SOURCES		:=	drivers/mentor/i2c/mi2cv.c		\
68				$(PLAT_COMMON_BASE)/plat_ble_setup.c	\
69				$(MARVELL_MOCHI_DRV)			\
70				$(PLAT_COMMON_BASE)/plat_pm.c		\
71				$(MARVELL_DRV_BASE)/ap807_clocks_init.c	\
72				$(MARVELL_DRV_BASE)/thermal.c		\
73				$(PLAT_COMMON_BASE)/plat_thermal.c	\
74				$(BLE_PORTING_SOURCES)			\
75				$(MARVELL_DRV_BASE)/ccu.c		\
76				$(MARVELL_DRV_BASE)/io_win.c
77
78BL1_SOURCES		+=	$(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
79				lib/cpus/aarch64/cortex_a72.S
80
81MARVELL_DRV		:= 	$(MARVELL_DRV_BASE)/io_win.c	\
82				$(MARVELL_DRV_BASE)/iob.c	\
83				$(MARVELL_DRV_BASE)/mci.c	\
84				$(MARVELL_DRV_BASE)/amb_adec.c	\
85				$(MARVELL_DRV_BASE)/ccu.c	\
86				$(MARVELL_DRV_BASE)/cache_llc.c	\
87				$(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
88				$(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c \
89				$(MARVELL_DRV_BASE)/mg_conf_cm3/mg_conf_cm3.c
90
91BL31_PORTING_SOURCES	:=	$(BOARD_DIR)/board/marvell_plat_config.c
92
93ifeq ($(SYSTEM_POWER_SUPPORT),1)
94BL31_PORTING_SOURCES	+=	$(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c
95endif
96
97BL31_SOURCES		+=	lib/cpus/aarch64/cortex_a72.S		       \
98				$(PLAT_COMMON_BASE)/aarch64/plat_helpers.S     \
99				$(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
100				$(PLAT_COMMON_BASE)/plat_pm.c		       \
101				$(PLAT_COMMON_BASE)/plat_bl31_setup.c	       \
102				$(MARVELL_COMMON_BASE)/marvell_gicv2.c	       \
103				$(MARVELL_COMMON_BASE)/mrvl_sip_svc.c	       \
104				$(MARVELL_COMMON_BASE)/marvell_ddr_info.c      \
105				$(BL31_PORTING_SOURCES)			       \
106				$(MARVELL_DRV)				       \
107				$(MARVELL_MOCHI_DRV)			       \
108				$(MARVELL_GIC_SOURCES)
109
110# Add trace functionality for PM
111BL31_SOURCES		+=	$(PLAT_COMMON_BASE)/plat_pm_trace.c
112
113# Force builds with BL2 image on a80x0 platforms
114ifndef SCP_BL2
115 $(error "Error: SCP_BL2 image is mandatory for a8k family")
116endif
117
118# MSS (SCP) build
119include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk
120
121# BLE (ROM context execution code, AKA binary extension)
122BLE_PATH	?=  $(PLAT_COMMON_BASE)/ble
123
124include ${BLE_PATH}/ble.mk
125$(eval $(call MAKE_BL,e))
126
127mrvl_flash: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin
128	$(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin)
129	$(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE})
130	${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE}
131
132