Yann Gautier | a3f4638 | 2023-06-14 10:40:59 +0200 | [diff] [blame] | 1 | # |
Yann Gautier | a585d76 | 2024-01-03 14:28:23 +0100 | [diff] [blame] | 2 | # Copyright (c) 2023-2024, STMicroelectronics - All Rights Reserved |
Yann Gautier | a3f4638 | 2023-06-14 10:40:59 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | include plat/st/common/common.mk |
| 8 | |
| 9 | CRASH_REPORTING := 1 |
| 10 | ENABLE_PIE := 1 |
| 11 | PROGRAMMABLE_RESET_ADDRESS := 1 |
| 12 | |
| 13 | # Default Device tree |
| 14 | DTB_FILE_NAME ?= stm32mp257f-ev1.dtb |
| 15 | |
| 16 | STM32MP25 := 1 |
| 17 | |
| 18 | # STM32 image header version v2.2 |
| 19 | STM32_HEADER_VERSION_MAJOR := 2 |
| 20 | STM32_HEADER_VERSION_MINOR := 2 |
| 21 | |
| 22 | # Number of TF-A copies in the device |
| 23 | STM32_TF_A_COPIES := 2 |
| 24 | |
| 25 | # PLAT_PARTITION_MAX_ENTRIES must take care of STM32_TF-A_COPIES and other partitions |
| 26 | # such as metadata (2) and fsbl-m (2) to find all the FIP partitions (default is 2). |
| 27 | PLAT_PARTITION_MAX_ENTRIES := $(shell echo $$(($(STM32_TF_A_COPIES) + 6))) |
| 28 | |
Yann Gautier | 7d13b4e | 2024-02-02 17:07:20 +0100 | [diff] [blame] | 29 | # Set load address for serial boot devices |
| 30 | DWL_BUFFER_BASE ?= 0x87000000 |
| 31 | |
Yann Gautier | 626ec9d | 2023-06-14 18:44:41 +0200 | [diff] [blame] | 32 | # Device tree |
| 33 | BL2_DTSI := stm32mp25-bl2.dtsi |
| 34 | FDT_SOURCES := $(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl2.dts,$(DTB_FILE_NAME))) |
| 35 | |
| 36 | # Macros and rules to build TF binary |
| 37 | STM32_TF_STM32 := $(addprefix ${BUILD_PLAT}/tf-a-, $(patsubst %.dtb,%.stm32,$(DTB_FILE_NAME))) |
| 38 | STM32_LD_FILE := plat/st/stm32mp2/${ARCH}/stm32mp2.ld.S |
| 39 | STM32_BINARY_MAPPING := plat/st/stm32mp2/${ARCH}/stm32mp2.S |
| 40 | |
Yann Gautier | 7d13b4e | 2024-02-02 17:07:20 +0100 | [diff] [blame] | 41 | $(eval $(call add_defines,\ |
| 42 | $(sort \ |
| 43 | DWL_BUFFER_BASE \ |
| 44 | ))) |
| 45 | |
Yann Gautier | a3f4638 | 2023-06-14 10:40:59 +0200 | [diff] [blame] | 46 | # STM32MP2x is based on Cortex-A35, which is Armv8.0, and does not support BTI |
| 47 | # Disable mbranch-protection to avoid adding useless code |
| 48 | TF_CFLAGS += -mbranch-protection=none |
| 49 | |
| 50 | # Include paths and source files |
| 51 | PLAT_INCLUDES += -Iplat/st/stm32mp2/include/ |
| 52 | |
| 53 | PLAT_BL_COMMON_SOURCES += lib/cpus/${ARCH}/cortex_a35.S |
Yann Gautier | eb91af5 | 2023-06-14 18:05:47 +0200 | [diff] [blame] | 54 | PLAT_BL_COMMON_SOURCES += drivers/st/uart/${ARCH}/stm32_console.S |
Yann Gautier | a3f4638 | 2023-06-14 10:40:59 +0200 | [diff] [blame] | 55 | PLAT_BL_COMMON_SOURCES += plat/st/stm32mp2/${ARCH}/stm32mp2_helper.S |
| 56 | |
Yann Gautier | a585d76 | 2024-01-03 14:28:23 +0100 | [diff] [blame] | 57 | PLAT_BL_COMMON_SOURCES += drivers/st/bsec/bsec3.c |
| 58 | |
Yann Gautier | a3f4638 | 2023-06-14 10:40:59 +0200 | [diff] [blame] | 59 | BL2_SOURCES += plat/st/stm32mp2/plat_bl2_mem_params_desc.c |
| 60 | BL2_SOURCES += plat/st/stm32mp2/bl2_plat_setup.c |
| 61 | |
Yann Gautier | 7d13b4e | 2024-02-02 17:07:20 +0100 | [diff] [blame] | 62 | ifeq (${STM32MP_USB_PROGRAMMER},1) |
| 63 | BL2_SOURCES += plat/st/stm32mp2/stm32mp2_usb_dfu.c |
| 64 | endif |
| 65 | |
Yann Gautier | a3f4638 | 2023-06-14 10:40:59 +0200 | [diff] [blame] | 66 | include plat/st/common/common_rules.mk |