xref: /arm-trusted-firmware/plat/st/stm32mp2/platform.mk (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu#
2*91f16700Schasinglulu# Copyright (c) 2023, STMicroelectronics - All Rights Reserved
3*91f16700Schasinglulu#
4*91f16700Schasinglulu# SPDX-License-Identifier: BSD-3-Clause
5*91f16700Schasinglulu#
6*91f16700Schasinglulu
7*91f16700Schasingluluinclude plat/st/common/common.mk
8*91f16700Schasinglulu
9*91f16700SchasingluluCRASH_REPORTING			:=	1
10*91f16700SchasingluluENABLE_PIE			:=	1
11*91f16700SchasingluluPROGRAMMABLE_RESET_ADDRESS	:=	1
12*91f16700Schasinglulu
13*91f16700Schasinglulu# Default Device tree
14*91f16700SchasingluluDTB_FILE_NAME			?=	stm32mp257f-ev1.dtb
15*91f16700Schasinglulu
16*91f16700SchasingluluSTM32MP25			:=	1
17*91f16700Schasinglulu
18*91f16700Schasinglulu# STM32 image header version v2.2
19*91f16700SchasingluluSTM32_HEADER_VERSION_MAJOR	:=	2
20*91f16700SchasingluluSTM32_HEADER_VERSION_MINOR	:=	2
21*91f16700Schasinglulu
22*91f16700Schasinglulu# Number of TF-A copies in the device
23*91f16700SchasingluluSTM32_TF_A_COPIES		:=	2
24*91f16700Schasinglulu
25*91f16700Schasinglulu# PLAT_PARTITION_MAX_ENTRIES must take care of STM32_TF-A_COPIES and other partitions
26*91f16700Schasinglulu# such as metadata (2) and fsbl-m (2) to find all the FIP partitions (default is 2).
27*91f16700SchasingluluPLAT_PARTITION_MAX_ENTRIES	:=	$(shell echo $$(($(STM32_TF_A_COPIES) + 6)))
28*91f16700Schasinglulu
29*91f16700Schasinglulu# Device tree
30*91f16700SchasingluluBL2_DTSI			:=	stm32mp25-bl2.dtsi
31*91f16700SchasingluluFDT_SOURCES			:=	$(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl2.dts,$(DTB_FILE_NAME)))
32*91f16700Schasinglulu
33*91f16700Schasinglulu# Macros and rules to build TF binary
34*91f16700SchasingluluSTM32_TF_STM32			:=	$(addprefix ${BUILD_PLAT}/tf-a-, $(patsubst %.dtb,%.stm32,$(DTB_FILE_NAME)))
35*91f16700SchasingluluSTM32_LD_FILE			:=	plat/st/stm32mp2/${ARCH}/stm32mp2.ld.S
36*91f16700SchasingluluSTM32_BINARY_MAPPING		:=	plat/st/stm32mp2/${ARCH}/stm32mp2.S
37*91f16700Schasinglulu
38*91f16700Schasinglulu# STM32MP2x is based on Cortex-A35, which is Armv8.0, and does not support BTI
39*91f16700Schasinglulu# Disable mbranch-protection to avoid adding useless code
40*91f16700SchasingluluTF_CFLAGS			+=	-mbranch-protection=none
41*91f16700Schasinglulu
42*91f16700Schasinglulu# Include paths and source files
43*91f16700SchasingluluPLAT_INCLUDES			+=	-Iplat/st/stm32mp2/include/
44*91f16700Schasinglulu
45*91f16700SchasingluluPLAT_BL_COMMON_SOURCES		+=	lib/cpus/${ARCH}/cortex_a35.S
46*91f16700SchasingluluPLAT_BL_COMMON_SOURCES		+=	drivers/st/uart/${ARCH}/stm32_console.S
47*91f16700SchasingluluPLAT_BL_COMMON_SOURCES		+=	plat/st/stm32mp2/${ARCH}/stm32mp2_helper.S
48*91f16700Schasinglulu
49*91f16700SchasingluluBL2_SOURCES			+=	plat/st/stm32mp2/plat_bl2_mem_params_desc.c
50*91f16700SchasingluluBL2_SOURCES			+=	plat/st/stm32mp2/bl2_plat_setup.c
51*91f16700Schasinglulu
52*91f16700Schasingluluinclude plat/st/common/common_rules.mk
53