blob: 5956737db1ba94b9f6604e0a52b28a2d8d50eb59 [file] [log] [blame]
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03001#
2# Copyright (C) 2016 - 2018 Marvell International Ltd.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5# https://spdx.org/licenses
6
7include tools/doimage/doimage.mk
8
9PLAT_FAMILY := a8k
10PLAT_FAMILY_BASE := plat/marvell/$(PLAT_FAMILY)
11PLAT_INCLUDE_BASE := include/plat/marvell/$(PLAT_FAMILY)
12PLAT_COMMON_BASE := $(PLAT_FAMILY_BASE)/common
13MARVELL_DRV_BASE := drivers/marvell
14MARVELL_COMMON_BASE := plat/marvell/common
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 := 1
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
28DOIMAGEPATH ?= tools/doimage
29DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
30
31ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
32DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
33
34# This define specifies DDR type for BLE
35$(eval $(call add_define,CONFIG_DDR4))
36
37MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
38 drivers/arm/gic/v2/gicv2_main.c \
39 drivers/arm/gic/v2/gicv2_helpers.c \
40 plat/common/plat_gicv2.c
41
42ATF_INCLUDES := -Iinclude/common/tbbr
43
44PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
45 -I$(PLAT_COMMON_BASE)/include \
46 -I$(PLAT_INCLUDE_BASE)/common \
47 -Iinclude/drivers/marvell \
48 -Iinclude/drivers/marvell/mochi \
49 $(ATF_INCLUDES)
50
51PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
52 drivers/console/aarch64/console.S \
53 drivers/ti/uart/aarch64/16550_console.S
54
55BLE_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/dram_port.c \
56 $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
57
58MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c
59
60BLE_SOURCES := $(PLAT_COMMON_BASE)/plat_ble_setup.c \
61 $(MARVELL_MOCHI_DRV) \
62 $(MARVELL_DRV_BASE)/i2c/a8k_i2c.c \
63 $(PLAT_COMMON_BASE)/plat_pm.c \
64 $(MARVELL_DRV_BASE)/thermal.c \
65 $(PLAT_COMMON_BASE)/plat_thermal.c \
66 $(BLE_PORTING_SOURCES) \
67 $(MARVELL_DRV_BASE)/ccu.c \
68 $(MARVELL_DRV_BASE)/io_win.c
69
70BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
71 lib/cpus/aarch64/cortex_a72.S
72
73MARVELL_DRV := $(MARVELL_DRV_BASE)/io_win.c \
74 $(MARVELL_DRV_BASE)/iob.c \
75 $(MARVELL_DRV_BASE)/mci.c \
76 $(MARVELL_DRV_BASE)/amb_adec.c \
77 $(MARVELL_DRV_BASE)/ccu.c \
78 $(MARVELL_DRV_BASE)/cache_llc.c \
Grzegorz Jaszczykf47d8552018-06-13 16:00:48 +020079 $(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
80 $(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030081
82BL31_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
83
84BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
85 $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
86 $(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
87 $(PLAT_COMMON_BASE)/plat_pm.c \
88 $(PLAT_COMMON_BASE)/plat_bl31_setup.c \
89 $(MARVELL_COMMON_BASE)/marvell_gicv2.c \
90 $(MARVELL_COMMON_BASE)/mrvl_sip_svc.c \
91 $(MARVELL_COMMON_BASE)/marvell_ddr_info.c \
92 $(BL31_PORTING_SOURCES) \
93 $(MARVELL_DRV) \
94 $(MARVELL_MOCHI_DRV) \
95 $(MARVELL_GIC_SOURCES)
96
97# Add trace functionality for PM
98BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c
99
100# Disable the PSCI platform compatibility layer (allows porting
101# from Old Platform APIs to the new APIs).
102# It is not needed since Marvell platform already used the new platform APIs.
103ENABLE_PLAT_COMPAT := 0
104
105# Force builds with BL2 image on a80x0 platforms
106ifndef SCP_BL2
107 $(error "Error: SCP_BL2 image is mandatory for a8k family")
108endif
109
110# MSS (SCP) build
111include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk
112
113# BLE (ROM context execution code, AKA binary extension)
114BLE_PATH ?= ble
115
116include ${BLE_PATH}/ble.mk
117$(eval $(call MAKE_BL,e))
118
119mrvl_flash: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin
120 $(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin)
121 $(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE})
122 ${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE}
123