blob: 11b11384925b3707ce7ed4f55ce7dc47dda8d891 [file] [log] [blame]
Yann Gautiera3f46382023-06-14 10:40:59 +02001#
Yann Gautiera585d762024-01-03 14:28:23 +01002# Copyright (c) 2023-2024, STMicroelectronics - All Rights Reserved
Yann Gautiera3f46382023-06-14 10:40:59 +02003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Yann Gautier605facb2023-01-05 14:34:37 +01007# Extra partitions used to find FIP, contains:
8# metadata (2) and fsbl-m (2) and the FIP partitions (default is 2).
9STM32_EXTRA_PARTS := 6
10
Yann Gautiera3f46382023-06-14 10:40:59 +020011include plat/st/common/common.mk
12
13CRASH_REPORTING := 1
14ENABLE_PIE := 1
15PROGRAMMABLE_RESET_ADDRESS := 1
16
17# Default Device tree
18DTB_FILE_NAME ?= stm32mp257f-ev1.dtb
19
20STM32MP25 := 1
21
22# STM32 image header version v2.2
23STM32_HEADER_VERSION_MAJOR := 2
24STM32_HEADER_VERSION_MINOR := 2
25
Yann Gautier7d13b4e2024-02-02 17:07:20 +010026# Set load address for serial boot devices
27DWL_BUFFER_BASE ?= 0x87000000
28
Yann Gautier626ec9d2023-06-14 18:44:41 +020029# Device tree
30BL2_DTSI := stm32mp25-bl2.dtsi
31FDT_SOURCES := $(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl2.dts,$(DTB_FILE_NAME)))
32
33# Macros and rules to build TF binary
34STM32_TF_STM32 := $(addprefix ${BUILD_PLAT}/tf-a-, $(patsubst %.dtb,%.stm32,$(DTB_FILE_NAME)))
35STM32_LD_FILE := plat/st/stm32mp2/${ARCH}/stm32mp2.ld.S
36STM32_BINARY_MAPPING := plat/st/stm32mp2/${ARCH}/stm32mp2.S
37
Yann Gautier7d13b4e2024-02-02 17:07:20 +010038$(eval $(call add_defines,\
39 $(sort \
40 DWL_BUFFER_BASE \
41)))
42
Yann Gautiera3f46382023-06-14 10:40:59 +020043# STM32MP2x is based on Cortex-A35, which is Armv8.0, and does not support BTI
44# Disable mbranch-protection to avoid adding useless code
45TF_CFLAGS += -mbranch-protection=none
46
47# Include paths and source files
48PLAT_INCLUDES += -Iplat/st/stm32mp2/include/
49
50PLAT_BL_COMMON_SOURCES += lib/cpus/${ARCH}/cortex_a35.S
Yann Gautiereb91af52023-06-14 18:05:47 +020051PLAT_BL_COMMON_SOURCES += drivers/st/uart/${ARCH}/stm32_console.S
Yann Gautiera3f46382023-06-14 10:40:59 +020052PLAT_BL_COMMON_SOURCES += plat/st/stm32mp2/${ARCH}/stm32mp2_helper.S
53
Yann Gautiera585d762024-01-03 14:28:23 +010054PLAT_BL_COMMON_SOURCES += drivers/st/bsec/bsec3.c
55
Yann Gautiera3f46382023-06-14 10:40:59 +020056BL2_SOURCES += plat/st/stm32mp2/plat_bl2_mem_params_desc.c
57BL2_SOURCES += plat/st/stm32mp2/bl2_plat_setup.c
58
Yann Gautier7d13b4e2024-02-02 17:07:20 +010059ifeq (${STM32MP_USB_PROGRAMMER},1)
60BL2_SOURCES += plat/st/stm32mp2/stm32mp2_usb_dfu.c
61endif
62
Yann Gautiera3f46382023-06-14 10:40:59 +020063include plat/st/common/common_rules.mk