blob: ccb662bb2ce0cd415937cc9521f240773fca74f6 [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
Konstantin Porotchkinf51f2512018-11-06 12:25:38 +020016MARVELL_SVC_TEST := 0
17$(eval $(call add_define,MARVELL_SVC_TEST))
18
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030019ERRATA_A72_859971 := 1
20
21# Enable MSS support for a8k family
22MSS_SUPPORT := 1
23
24# Disable EL3 cache for power management
25BL31_CACHE_DISABLE := 1
26$(eval $(call add_define,BL31_CACHE_DISABLE))
27
28$(eval $(call add_define,PCI_EP_SUPPORT))
29$(eval $(call assert_boolean,PCI_EP_SUPPORT))
30
Grzegorz Jaszczyk2ed16f52018-06-29 18:00:33 +020031AP_NUM := 1
32$(eval $(call add_define,AP_NUM))
33
Konstantin Porotchkin6ff50d52018-10-07 17:54:20 +030034DOIMAGEPATH ?= tools/marvell/doimage
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030035DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
36
37ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
38DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
39
40# This define specifies DDR type for BLE
41$(eval $(call add_define,CONFIG_DDR4))
42
43MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
44 drivers/arm/gic/v2/gicv2_main.c \
45 drivers/arm/gic/v2/gicv2_helpers.c \
46 plat/common/plat_gicv2.c
47
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030048PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
49 -I$(PLAT_COMMON_BASE)/include \
Antonio Nino Diaz50a4d1a2019-02-01 12:22:22 +000050 -I$(PLAT_INCLUDE_BASE)/common
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030051
52PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030053 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
Christine Gharzuzi9a772df2018-06-25 13:39:37 +030060BLE_SOURCES := drivers/mentor/i2c/mi2cv.c \
61 $(PLAT_COMMON_BASE)/plat_ble_setup.c \
62 $(MARVELL_MOCHI_DRV) \
63 $(PLAT_COMMON_BASE)/plat_pm.c \
64 $(MARVELL_DRV_BASE)/ap807_clocks_init.c \
65 $(MARVELL_DRV_BASE)/thermal.c \
66 $(PLAT_COMMON_BASE)/plat_thermal.c \
67 $(BLE_PORTING_SOURCES) \
68 $(MARVELL_DRV_BASE)/ccu.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030069 $(MARVELL_DRV_BASE)/io_win.c
70
71BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
72 lib/cpus/aarch64/cortex_a72.S
73
74MARVELL_DRV := $(MARVELL_DRV_BASE)/io_win.c \
75 $(MARVELL_DRV_BASE)/iob.c \
76 $(MARVELL_DRV_BASE)/mci.c \
77 $(MARVELL_DRV_BASE)/amb_adec.c \
78 $(MARVELL_DRV_BASE)/ccu.c \
79 $(MARVELL_DRV_BASE)/cache_llc.c \
Grzegorz Jaszczykf47d8552018-06-13 16:00:48 +020080 $(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
81 $(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030082
83BL31_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
84
85BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \
86 $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \
87 $(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
88 $(PLAT_COMMON_BASE)/plat_pm.c \
89 $(PLAT_COMMON_BASE)/plat_bl31_setup.c \
90 $(MARVELL_COMMON_BASE)/marvell_gicv2.c \
91 $(MARVELL_COMMON_BASE)/mrvl_sip_svc.c \
92 $(MARVELL_COMMON_BASE)/marvell_ddr_info.c \
93 $(BL31_PORTING_SOURCES) \
94 $(MARVELL_DRV) \
95 $(MARVELL_MOCHI_DRV) \
96 $(MARVELL_GIC_SOURCES)
97
98# Add trace functionality for PM
99BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c
100
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300101# Force builds with BL2 image on a80x0 platforms
102ifndef SCP_BL2
103 $(error "Error: SCP_BL2 image is mandatory for a8k family")
104endif
105
106# MSS (SCP) build
107include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk
108
109# BLE (ROM context execution code, AKA binary extension)
Konstantin Porotchkin01851db2018-10-03 14:21:42 +0300110BLE_PATH ?= $(PLAT_COMMON_BASE)/ble
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300111
112include ${BLE_PATH}/ble.mk
113$(eval $(call MAKE_BL,e))
114
115mrvl_flash: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin
116 $(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin)
117 $(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE})
118 ${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE}
119