blob: f0e6edf2e8781a13d085f9678d36b0b422dcc3b7 [file] [log] [blame]
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03001# Copyright (C) 2018 Marvell International Ltd.
2#
3# SPDX-License-Identifier: BSD-3-Clause
4# https://spdx.org/licenses
5
Grzegorz Jaszczyk3039bce2019-11-05 13:14:59 +01006MARVELL_PLAT_BASE := plat/marvell/armada
7MARVELL_PLAT_INCLUDE_BASE := include/plat/marvell/armada
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03008
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03009SEPARATE_CODE_AND_RODATA := 1
10
11# flag to switch from PLL to ARO
12ARO_ENABLE := 0
13$(eval $(call add_define,ARO_ENABLE))
Konstantin Porotchkin2ef36a32019-03-31 16:58:11 +030014
15# Convert LLC to secure SRAM
16LLC_SRAM := 0
17$(eval $(call add_define,LLC_SRAM))
18
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030019# Enable/Disable LLC
20LLC_ENABLE := 1
21$(eval $(call add_define,LLC_ENABLE))
22
Remi Pommarel7459e742019-07-14 20:34:28 +020023include lib/xlat_tables_v2/xlat_tables.mk
24
Antonio Nino Diaz50a4d1a2019-02-01 12:22:22 +000025PLAT_INCLUDES += -I$(MARVELL_PLAT_INCLUDE_BASE)/common \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030026 -I$(MARVELL_PLAT_INCLUDE_BASE)/common/aarch64
27
28
Remi Pommarel7459e742019-07-14 20:34:28 +020029PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030030 $(MARVELL_PLAT_BASE)/common/aarch64/marvell_common.c \
Konstantin Porotchkind8e39572018-11-14 17:15:08 +020031 $(MARVELL_PLAT_BASE)/common/aarch64/marvell_helpers.S \
32 $(MARVELL_COMMON_BASE)/marvell_console.c
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030033
34BL1_SOURCES += drivers/delay_timer/delay_timer.c \
35 drivers/io/io_fip.c \
36 drivers/io/io_memmap.c \
37 drivers/io/io_storage.c \
38 $(MARVELL_PLAT_BASE)/common/marvell_bl1_setup.c \
39 $(MARVELL_PLAT_BASE)/common/marvell_io_storage.c \
40 $(MARVELL_PLAT_BASE)/common/plat_delay_timer.c
41
42ifdef EL3_PAYLOAD_BASE
43# Need the arm_program_trusted_mailbox() function to release secondary CPUs from
44# their holding pen
45endif
46
47BL2_SOURCES += drivers/io/io_fip.c \
48 drivers/io/io_memmap.c \
49 drivers/io/io_storage.c \
Konstantin Porotchkind973c032018-10-02 17:45:15 +030050 common/desc_image_load.c \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030051 $(MARVELL_PLAT_BASE)/common/marvell_bl2_setup.c \
Konstantin Porotchkind973c032018-10-02 17:45:15 +030052 $(MARVELL_PLAT_BASE)/common/marvell_io_storage.c \
53 $(MARVELL_PLAT_BASE)/common/aarch64/marvell_bl2_mem_params_desc.c \
54 $(MARVELL_PLAT_BASE)/common/marvell_image_load.c
55
Marcin Wojtas35b75f02019-11-13 13:31:48 +010056ifeq (${SPD},opteed)
57PLAT_INCLUDES += -Iinclude/lib
58BL2_SOURCES += lib/optee/optee_utils.c
59endif
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030060
61BL31_SOURCES += $(MARVELL_PLAT_BASE)/common/marvell_bl31_setup.c \
62 $(MARVELL_PLAT_BASE)/common/marvell_pm.c \
63 $(MARVELL_PLAT_BASE)/common/marvell_topology.c \
64 plat/common/plat_psci_common.c \
65 $(MARVELL_PLAT_BASE)/common/plat_delay_timer.c \
66 drivers/delay_timer/delay_timer.c
67
68# PSCI functionality
69$(eval $(call add_define,CONFIG_ARM64))
70
Marcin Wojtas35b75f02019-11-13 13:31:48 +010071# Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images
72# in the FIP if the platform requires.
73ifneq ($(BL32_EXTRA1),)
74$(eval $(call TOOL_ADD_IMG,bl32_extra1,--tos-fw-extra1))
75endif
76ifneq ($(BL32_EXTRA2),)
77$(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2))
78endif
79
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030080# MSS (SCP) build
81ifeq (${MSS_SUPPORT}, 1)
82include $(MARVELL_PLAT_BASE)/common/mss/mss_common.mk
83endif
Pali Rohár3666d482020-10-29 16:50:19 +010084
85$(BUILD_PLAT)/$(BOOT_IMAGE): $(BUILD_PLAT)/bl1.bin $(BUILD_PLAT)/$(FIP_NAME)
Pali Rohár5cd386f2020-12-03 11:59:53 +010086 $(if $(shell find $(BUILD_PLAT)/bl1.bin -type f -size +128k),$(error "Image '$(BUILD_PLAT)/bl1.bin' is bigger than 128kB"))
Pali Rohár3666d482020-10-29 16:50:19 +010087 @cp $(BUILD_PLAT)/bl1.bin $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; }
88 @truncate -s %128K $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; }
89 @cat $(BUILD_PLAT)/$(FIP_NAME) >> $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; }
90 @truncate -s %4 $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; }
Pali Rohár7cf48c82021-01-26 10:44:07 +010091 @$(ECHO_BLANK_LINE)
Pali Rohár3666d482020-10-29 16:50:19 +010092 @echo "Built $@ successfully"
Pali Rohár7cf48c82021-01-26 10:44:07 +010093 @$(ECHO_BLANK_LINE)
Pali Rohár3666d482020-10-29 16:50:19 +010094
Pali Rohár06a38e22020-11-23 19:45:28 +010095.PHONY: mrvl_bootimage
Pali Rohár3666d482020-10-29 16:50:19 +010096mrvl_bootimage: $(BUILD_PLAT)/$(BOOT_IMAGE)
Pali Rohár4bce4d52021-01-26 10:44:07 +010097
98.PHONY: mrvl_flash
99mrvl_flash: $(BUILD_PLAT)/$(FLASH_IMAGE)