Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 1 | # Copyright (C) 2018 Marvell International Ltd. |
| 2 | # |
| 3 | # SPDX-License-Identifier: BSD-3-Clause |
| 4 | # https://spdx.org/licenses |
| 5 | |
Grzegorz Jaszczyk | 3039bce | 2019-11-05 13:14:59 +0100 | [diff] [blame] | 6 | MARVELL_PLAT_BASE := plat/marvell/armada |
| 7 | MARVELL_PLAT_INCLUDE_BASE := include/plat/marvell/armada |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 8 | |
Grzegorz Jaszczyk | 3039bce | 2019-11-05 13:14:59 +0100 | [diff] [blame] | 9 | include plat/marvell/version.mk |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 10 | |
| 11 | VERSION_STRING +=(Marvell-${SUBVERSION}) |
| 12 | |
| 13 | SEPARATE_CODE_AND_RODATA := 1 |
| 14 | |
| 15 | # flag to switch from PLL to ARO |
| 16 | ARO_ENABLE := 0 |
| 17 | $(eval $(call add_define,ARO_ENABLE)) |
Konstantin Porotchkin | 2ef36a3 | 2019-03-31 16:58:11 +0300 | [diff] [blame] | 18 | |
| 19 | # Convert LLC to secure SRAM |
| 20 | LLC_SRAM := 0 |
| 21 | $(eval $(call add_define,LLC_SRAM)) |
| 22 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 23 | # Enable/Disable LLC |
| 24 | LLC_ENABLE := 1 |
| 25 | $(eval $(call add_define,LLC_ENABLE)) |
| 26 | |
Remi Pommarel | 7459e74 | 2019-07-14 20:34:28 +0200 | [diff] [blame] | 27 | include lib/xlat_tables_v2/xlat_tables.mk |
| 28 | |
Antonio Nino Diaz | 50a4d1a | 2019-02-01 12:22:22 +0000 | [diff] [blame] | 29 | PLAT_INCLUDES += -I$(MARVELL_PLAT_INCLUDE_BASE)/common \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 30 | -I$(MARVELL_PLAT_INCLUDE_BASE)/common/aarch64 |
| 31 | |
| 32 | |
Remi Pommarel | 7459e74 | 2019-07-14 20:34:28 +0200 | [diff] [blame] | 33 | PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 34 | $(MARVELL_PLAT_BASE)/common/aarch64/marvell_common.c \ |
Konstantin Porotchkin | d8e3957 | 2018-11-14 17:15:08 +0200 | [diff] [blame] | 35 | $(MARVELL_PLAT_BASE)/common/aarch64/marvell_helpers.S \ |
| 36 | $(MARVELL_COMMON_BASE)/marvell_console.c |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 37 | |
| 38 | BL1_SOURCES += drivers/delay_timer/delay_timer.c \ |
| 39 | drivers/io/io_fip.c \ |
| 40 | drivers/io/io_memmap.c \ |
| 41 | drivers/io/io_storage.c \ |
| 42 | $(MARVELL_PLAT_BASE)/common/marvell_bl1_setup.c \ |
| 43 | $(MARVELL_PLAT_BASE)/common/marvell_io_storage.c \ |
| 44 | $(MARVELL_PLAT_BASE)/common/plat_delay_timer.c |
| 45 | |
| 46 | ifdef EL3_PAYLOAD_BASE |
| 47 | # Need the arm_program_trusted_mailbox() function to release secondary CPUs from |
| 48 | # their holding pen |
| 49 | endif |
| 50 | |
| 51 | BL2_SOURCES += drivers/io/io_fip.c \ |
| 52 | drivers/io/io_memmap.c \ |
| 53 | drivers/io/io_storage.c \ |
Konstantin Porotchkin | d973c03 | 2018-10-02 17:45:15 +0300 | [diff] [blame] | 54 | common/desc_image_load.c \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 55 | $(MARVELL_PLAT_BASE)/common/marvell_bl2_setup.c \ |
Konstantin Porotchkin | d973c03 | 2018-10-02 17:45:15 +0300 | [diff] [blame] | 56 | $(MARVELL_PLAT_BASE)/common/marvell_io_storage.c \ |
| 57 | $(MARVELL_PLAT_BASE)/common/aarch64/marvell_bl2_mem_params_desc.c \ |
| 58 | $(MARVELL_PLAT_BASE)/common/marvell_image_load.c |
| 59 | |
Marcin Wojtas | 35b75f0 | 2019-11-13 13:31:48 +0100 | [diff] [blame] | 60 | ifeq (${SPD},opteed) |
| 61 | PLAT_INCLUDES += -Iinclude/lib |
| 62 | BL2_SOURCES += lib/optee/optee_utils.c |
| 63 | endif |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 64 | |
| 65 | BL31_SOURCES += $(MARVELL_PLAT_BASE)/common/marvell_bl31_setup.c \ |
| 66 | $(MARVELL_PLAT_BASE)/common/marvell_pm.c \ |
| 67 | $(MARVELL_PLAT_BASE)/common/marvell_topology.c \ |
| 68 | plat/common/plat_psci_common.c \ |
| 69 | $(MARVELL_PLAT_BASE)/common/plat_delay_timer.c \ |
| 70 | drivers/delay_timer/delay_timer.c |
| 71 | |
| 72 | # PSCI functionality |
| 73 | $(eval $(call add_define,CONFIG_ARM64)) |
| 74 | |
Marcin Wojtas | 35b75f0 | 2019-11-13 13:31:48 +0100 | [diff] [blame] | 75 | # Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images |
| 76 | # in the FIP if the platform requires. |
| 77 | ifneq ($(BL32_EXTRA1),) |
| 78 | $(eval $(call TOOL_ADD_IMG,bl32_extra1,--tos-fw-extra1)) |
| 79 | endif |
| 80 | ifneq ($(BL32_EXTRA2),) |
| 81 | $(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2)) |
| 82 | endif |
| 83 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 84 | # MSS (SCP) build |
| 85 | ifeq (${MSS_SUPPORT}, 1) |
| 86 | include $(MARVELL_PLAT_BASE)/common/mss/mss_common.mk |
| 87 | endif |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 88 | |
| 89 | $(BUILD_PLAT)/$(BOOT_IMAGE): $(BUILD_PLAT)/bl1.bin $(BUILD_PLAT)/$(FIP_NAME) |
Pali Rohár | 5cd386f | 2020-12-03 11:59:53 +0100 | [diff] [blame] | 90 | $(if $(shell find $(BUILD_PLAT)/bl1.bin -type f -size +128k),$(error "Image '$(BUILD_PLAT)/bl1.bin' is bigger than 128kB")) |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 91 | @cp $(BUILD_PLAT)/bl1.bin $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; } |
| 92 | @truncate -s %128K $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; } |
| 93 | @cat $(BUILD_PLAT)/$(FIP_NAME) >> $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; } |
| 94 | @truncate -s %4 $(BUILD_PLAT)/$(BOOT_IMAGE) || { rm -f $(BUILD_PLAT)/$(BOOT_IMAGE); false; } |
| 95 | @echo "Built $@ successfully" |
| 96 | |
Pali Rohár | 06a38e2 | 2020-11-23 19:45:28 +0100 | [diff] [blame] | 97 | .PHONY: mrvl_bootimage |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 98 | mrvl_bootimage: $(BUILD_PLAT)/$(BOOT_IMAGE) |