blob: 7f01e13b2dfa234f11b2f5709503958c356fdda8 [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
Konstantin Porotchkin6ff50d52018-10-07 17:54:20 +03007include tools/marvell/doimage/doimage.mk
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03008
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
Grzegorz Jaszczyk2ed16f52018-06-29 18:00:33 +020028AP_NUM := 1
29$(eval $(call add_define,AP_NUM))
30
Konstantin Porotchkin6ff50d52018-10-07 17:54:20 +030031DOIMAGEPATH ?= tools/marvell/doimage
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030032DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
33
34ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
35DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
36
37# This define specifies DDR type for BLE
38$(eval $(call add_define,CONFIG_DDR4))
39
40MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
41 drivers/arm/gic/v2/gicv2_main.c \
42 drivers/arm/gic/v2/gicv2_helpers.c \
43 plat/common/plat_gicv2.c
44
45ATF_INCLUDES := -Iinclude/common/tbbr
46
47PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
48 -I$(PLAT_COMMON_BASE)/include \
49 -I$(PLAT_INCLUDE_BASE)/common \
50 -Iinclude/drivers/marvell \
51 -Iinclude/drivers/marvell/mochi \
52 $(ATF_INCLUDES)
53
54PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030055 drivers/ti/uart/aarch64/16550_console.S
56
57BLE_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/dram_port.c \
58 $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
59
60MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c
61
Andre Przywaraeeeba252018-09-09 01:39:57 +010062BLE_SOURCES := drivers/mentor/i2c/mi2cv.c \
63 $(PLAT_COMMON_BASE)/plat_ble_setup.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030064 $(MARVELL_MOCHI_DRV) \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030065 $(PLAT_COMMON_BASE)/plat_pm.c \
66 $(MARVELL_DRV_BASE)/thermal.c \
67 $(PLAT_COMMON_BASE)/plat_thermal.c \
68 $(BLE_PORTING_SOURCES) \
69 $(MARVELL_DRV_BASE)/ccu.c \
70 $(MARVELL_DRV_BASE)/io_win.c
71
72BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
73 lib/cpus/aarch64/cortex_a72.S
74
75MARVELL_DRV := $(MARVELL_DRV_BASE)/io_win.c \
76 $(MARVELL_DRV_BASE)/iob.c \
77 $(MARVELL_DRV_BASE)/mci.c \
78 $(MARVELL_DRV_BASE)/amb_adec.c \
79 $(MARVELL_DRV_BASE)/ccu.c \
80 $(MARVELL_DRV_BASE)/cache_llc.c \
Grzegorz Jaszczykf47d8552018-06-13 16:00:48 +020081 $(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
82 $(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030083
84BL31_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
85
86BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
87 $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
88 $(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
89 $(PLAT_COMMON_BASE)/plat_pm.c \
90 $(PLAT_COMMON_BASE)/plat_bl31_setup.c \
91 $(MARVELL_COMMON_BASE)/marvell_gicv2.c \
92 $(MARVELL_COMMON_BASE)/mrvl_sip_svc.c \
93 $(MARVELL_COMMON_BASE)/marvell_ddr_info.c \
94 $(BL31_PORTING_SOURCES) \
95 $(MARVELL_DRV) \
96 $(MARVELL_MOCHI_DRV) \
97 $(MARVELL_GIC_SOURCES)
98
99# Add trace functionality for PM
100BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c
101
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300102# Force builds with BL2 image on a80x0 platforms
103ifndef SCP_BL2
104 $(error "Error: SCP_BL2 image is mandatory for a8k family")
105endif
106
107# MSS (SCP) build
108include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk
109
110# BLE (ROM context execution code, AKA binary extension)
Konstantin Porotchkin01851db2018-10-03 14:21:42 +0300111BLE_PATH ?= $(PLAT_COMMON_BASE)/ble
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300112
113include ${BLE_PATH}/ble.mk
114$(eval $(call MAKE_BL,e))
115
116mrvl_flash: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin
117 $(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin)
118 $(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE})
119 ${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE}
120