blob: 8731aa64b826d8e6ada1598d10623674074d7bb9 [file] [log] [blame]
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03001#
Marcin Wojtasa86fe0c2020-06-02 15:12:06 +02002# Copyright (C) 2016 - 2020 Marvell International Ltd.
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03003#
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
Grzegorz Jaszczyk3039bce2019-11-05 13:14:59 +010010PLAT_INCLUDE_BASE := include/plat/marvell/armada/$(PLAT_FAMILY)
Grzegorz Jaszczyk2d3d86a2018-12-09 23:11:20 +010011PLAT_COMMON_BASE := plat/marvell/armada/a8k/common
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030012MARVELL_DRV_BASE := drivers/marvell
Grzegorz Jaszczyk3039bce2019-11-05 13:14:59 +010013MARVELL_COMMON_BASE := plat/marvell/armada/common
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030014
Konstantin Porotchkinf51f2512018-11-06 12:25:38 +020015MARVELL_SVC_TEST := 0
16$(eval $(call add_define,MARVELL_SVC_TEST))
17
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030018ERRATA_A72_859971 := 1
19
20# Enable MSS support for a8k family
21MSS_SUPPORT := 1
22
23# Disable EL3 cache for power management
Marcin Wojtasa86fe0c2020-06-02 15:12:06 +020024BL31_CACHE_DISABLE := 0
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030025$(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
Grzegorz Jaszczyk2ed16f52018-06-29 18:00:33 +020030AP_NUM := 1
31$(eval $(call add_define,AP_NUM))
32
Konstantin Porotchkin6ff50d52018-10-07 17:54:20 +030033DOIMAGEPATH ?= tools/marvell/doimage
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030034DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
35
36ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
37DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
38
Luka Kovacic49358fb2020-01-13 20:37:35 +010039# 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
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030046# 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
Grzegorz Jaszczyk2d3d86a2018-12-09 23:11:20 +010054PLAT_INCLUDES := -I$(BOARD_DIR) \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030055 -I$(PLAT_COMMON_BASE)/include \
Antonio Nino Diaz50a4d1a2019-02-01 12:22:22 +000056 -I$(PLAT_INCLUDE_BASE)/common
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030057
58PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030059 drivers/ti/uart/aarch64/16550_console.S
60
Grzegorz Jaszczyk2d3d86a2018-12-09 23:11:20 +010061BLE_PORTING_SOURCES := $(BOARD_DIR)/board/dram_port.c \
62 $(BOARD_DIR)/board/marvell_plat_config.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030063
64MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c
65
Christine Gharzuzi9a772df2018-06-25 13:39:37 +030066BLE_SOURCES := drivers/mentor/i2c/mi2cv.c \
67 $(PLAT_COMMON_BASE)/plat_ble_setup.c \
68 $(MARVELL_MOCHI_DRV) \
69 $(PLAT_COMMON_BASE)/plat_pm.c \
70 $(MARVELL_DRV_BASE)/ap807_clocks_init.c \
71 $(MARVELL_DRV_BASE)/thermal.c \
72 $(PLAT_COMMON_BASE)/plat_thermal.c \
73 $(BLE_PORTING_SOURCES) \
74 $(MARVELL_DRV_BASE)/ccu.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030075 $(MARVELL_DRV_BASE)/io_win.c
76
77BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
78 lib/cpus/aarch64/cortex_a72.S
79
80MARVELL_DRV := $(MARVELL_DRV_BASE)/io_win.c \
81 $(MARVELL_DRV_BASE)/iob.c \
82 $(MARVELL_DRV_BASE)/mci.c \
83 $(MARVELL_DRV_BASE)/amb_adec.c \
84 $(MARVELL_DRV_BASE)/ccu.c \
85 $(MARVELL_DRV_BASE)/cache_llc.c \
Grzegorz Jaszczykf47d8552018-06-13 16:00:48 +020086 $(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
87 $(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030088
Grzegorz Jaszczyk2d3d86a2018-12-09 23:11:20 +010089BL31_PORTING_SOURCES := $(BOARD_DIR)/board/marvell_plat_config.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030090
Luka Kovacic49358fb2020-01-13 20:37:35 +010091ifeq ($(SYSTEM_POWER_SUPPORT),1)
92BL31_PORTING_SOURCES += $(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c
93endif
94
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030095BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
96 $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
97 $(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
98 $(PLAT_COMMON_BASE)/plat_pm.c \
99 $(PLAT_COMMON_BASE)/plat_bl31_setup.c \
100 $(MARVELL_COMMON_BASE)/marvell_gicv2.c \
101 $(MARVELL_COMMON_BASE)/mrvl_sip_svc.c \
102 $(MARVELL_COMMON_BASE)/marvell_ddr_info.c \
103 $(BL31_PORTING_SOURCES) \
104 $(MARVELL_DRV) \
105 $(MARVELL_MOCHI_DRV) \
106 $(MARVELL_GIC_SOURCES)
107
108# Add trace functionality for PM
109BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c
110
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300111# Force builds with BL2 image on a80x0 platforms
112ifndef SCP_BL2
113 $(error "Error: SCP_BL2 image is mandatory for a8k family")
114endif
115
116# MSS (SCP) build
117include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk
118
119# BLE (ROM context execution code, AKA binary extension)
Konstantin Porotchkin01851db2018-10-03 14:21:42 +0300120BLE_PATH ?= $(PLAT_COMMON_BASE)/ble
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300121
122include ${BLE_PATH}/ble.mk
123$(eval $(call MAKE_BL,e))
124
125mrvl_flash: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin
126 $(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin)
127 $(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE})
128 ${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE}
129