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 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 9 | SEPARATE_CODE_AND_RODATA := 1 |
| 10 | |
| 11 | # flag to switch from PLL to ARO |
| 12 | ARO_ENABLE := 0 |
| 13 | $(eval $(call add_define,ARO_ENABLE)) |
Konstantin Porotchkin | 2ef36a3 | 2019-03-31 16:58:11 +0300 | [diff] [blame] | 14 | |
| 15 | # Convert LLC to secure SRAM |
| 16 | LLC_SRAM := 0 |
| 17 | $(eval $(call add_define,LLC_SRAM)) |
| 18 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 19 | # Enable/Disable LLC |
| 20 | LLC_ENABLE := 1 |
| 21 | $(eval $(call add_define,LLC_ENABLE)) |
| 22 | |
Remi Pommarel | 7459e74 | 2019-07-14 20:34:28 +0200 | [diff] [blame] | 23 | include lib/xlat_tables_v2/xlat_tables.mk |
| 24 | |
Antonio Nino Diaz | 50a4d1a | 2019-02-01 12:22:22 +0000 | [diff] [blame] | 25 | PLAT_INCLUDES += -I$(MARVELL_PLAT_INCLUDE_BASE)/common \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 26 | -I$(MARVELL_PLAT_INCLUDE_BASE)/common/aarch64 |
| 27 | |
| 28 | |
Remi Pommarel | 7459e74 | 2019-07-14 20:34:28 +0200 | [diff] [blame] | 29 | PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 30 | $(MARVELL_PLAT_BASE)/common/aarch64/marvell_common.c \ |
Konstantin Porotchkin | d8e3957 | 2018-11-14 17:15:08 +0200 | [diff] [blame] | 31 | $(MARVELL_PLAT_BASE)/common/aarch64/marvell_helpers.S \ |
| 32 | $(MARVELL_COMMON_BASE)/marvell_console.c |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 33 | |
| 34 | BL1_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 | |
| 42 | ifdef EL3_PAYLOAD_BASE |
| 43 | # Need the arm_program_trusted_mailbox() function to release secondary CPUs from |
| 44 | # their holding pen |
| 45 | endif |
| 46 | |
| 47 | BL2_SOURCES += drivers/io/io_fip.c \ |
| 48 | drivers/io/io_memmap.c \ |
| 49 | drivers/io/io_storage.c \ |
Konstantin Porotchkin | d973c03 | 2018-10-02 17:45:15 +0300 | [diff] [blame] | 50 | common/desc_image_load.c \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 51 | $(MARVELL_PLAT_BASE)/common/marvell_bl2_setup.c \ |
Konstantin Porotchkin | d973c03 | 2018-10-02 17:45:15 +0300 | [diff] [blame] | 52 | $(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 Wojtas | 35b75f0 | 2019-11-13 13:31:48 +0100 | [diff] [blame] | 56 | ifeq (${SPD},opteed) |
| 57 | PLAT_INCLUDES += -Iinclude/lib |
| 58 | BL2_SOURCES += lib/optee/optee_utils.c |
| 59 | endif |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 60 | |
| 61 | BL31_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 Wojtas | 35b75f0 | 2019-11-13 13:31:48 +0100 | [diff] [blame] | 71 | # Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images |
| 72 | # in the FIP if the platform requires. |
| 73 | ifneq ($(BL32_EXTRA1),) |
| 74 | $(eval $(call TOOL_ADD_IMG,bl32_extra1,--tos-fw-extra1)) |
| 75 | endif |
| 76 | ifneq ($(BL32_EXTRA2),) |
| 77 | $(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2)) |
| 78 | endif |
| 79 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 80 | # MSS (SCP) build |
| 81 | ifeq (${MSS_SUPPORT}, 1) |
| 82 | include $(MARVELL_PLAT_BASE)/common/mss/mss_common.mk |
| 83 | endif |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 84 | |
| 85 | $(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] | 86 | $(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] | 87 | @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ár | 7cf48c8 | 2021-01-26 10:44:07 +0100 | [diff] [blame] | 91 | @$(ECHO_BLANK_LINE) |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 92 | @echo "Built $@ successfully" |
Pali Rohár | 7cf48c8 | 2021-01-26 10:44:07 +0100 | [diff] [blame] | 93 | @$(ECHO_BLANK_LINE) |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 94 | |
Pali Rohár | 06a38e2 | 2020-11-23 19:45:28 +0100 | [diff] [blame] | 95 | .PHONY: mrvl_bootimage |
Pali Rohár | 3666d48 | 2020-10-29 16:50:19 +0100 | [diff] [blame] | 96 | mrvl_bootimage: $(BUILD_PLAT)/$(BOOT_IMAGE) |
Pali Rohár | 4bce4d5 | 2021-01-26 10:44:07 +0100 | [diff] [blame] | 97 | |
| 98 | .PHONY: mrvl_flash |
| 99 | mrvl_flash: $(BUILD_PLAT)/$(FLASH_IMAGE) |