Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 1 | # |
Govindraj Raja | 3191ac4 | 2023-01-23 13:11:12 +0000 | [diff] [blame] | 2 | # Copyright (c) 2015-2023, ARM Limited and Contributors. All rights reserved. |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 7 | include plat/st/common/common.mk |
| 8 | |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 9 | ARM_CORTEX_A7 := yes |
| 10 | ARM_WITH_NEON := yes |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 11 | USE_COHERENT_MEM := 0 |
| 12 | |
Yann Gautier | 0c0e103 | 2021-04-01 19:31:46 +0200 | [diff] [blame] | 13 | # Default Device tree |
| 14 | DTB_FILE_NAME ?= stm32mp157c-ev1.dtb |
| 15 | |
| 16 | STM32MP13 ?= 0 |
| 17 | STM32MP15 ?= 0 |
| 18 | |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 19 | ifeq ($(STM32MP13),1) |
Yann Gautier | 0c0e103 | 2021-04-01 19:31:46 +0200 | [diff] [blame] | 20 | ifeq ($(STM32MP15),1) |
| 21 | $(error Cannot enable both flags STM32MP13 and STM32MP15) |
| 22 | endif |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 23 | STM32MP13 := 1 |
| 24 | STM32MP15 := 0 |
Yann Gautier | 0c0e103 | 2021-04-01 19:31:46 +0200 | [diff] [blame] | 25 | else ifeq ($(STM32MP15),1) |
| 26 | STM32MP13 := 0 |
| 27 | STM32MP15 := 1 |
| 28 | else ifneq ($(findstring stm32mp13,$(DTB_FILE_NAME)),) |
| 29 | STM32MP13 := 1 |
| 30 | STM32MP15 := 0 |
| 31 | else ifneq ($(findstring stm32mp15,$(DTB_FILE_NAME)),) |
| 32 | STM32MP13 := 0 |
| 33 | STM32MP15 := 1 |
| 34 | endif |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 35 | |
Yann Gautier | 0c0e103 | 2021-04-01 19:31:46 +0200 | [diff] [blame] | 36 | ifeq ($(STM32MP13),1) |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 37 | # Will use SRAM2 as mbedtls heap |
| 38 | STM32MP_USE_EXTERNAL_HEAP := 1 |
| 39 | |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 40 | # DDR controller with single AXI port and 16-bit interface |
| 41 | STM32MP_DDR_DUAL_AXI_PORT:= 0 |
| 42 | STM32MP_DDR_32BIT_INTERFACE:= 0 |
| 43 | |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 44 | ifeq (${TRUSTED_BOARD_BOOT},1) |
| 45 | # PKA algo to include |
| 46 | PKA_USE_NIST_P256 := 1 |
| 47 | PKA_USE_BRAINPOOL_P256T1:= 1 |
| 48 | endif |
| 49 | |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 50 | # STM32 image header version v2.0 |
| 51 | STM32_HEADER_VERSION_MAJOR:= 2 |
| 52 | STM32_HEADER_VERSION_MINOR:= 0 |
Yann Gautier | 0c0e103 | 2021-04-01 19:31:46 +0200 | [diff] [blame] | 53 | endif |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 54 | |
Yann Gautier | 0c0e103 | 2021-04-01 19:31:46 +0200 | [diff] [blame] | 55 | ifeq ($(STM32MP15),1) |
Yann Gautier | 6d8c244 | 2020-09-17 12:42:46 +0200 | [diff] [blame] | 56 | # DDR controller with dual AXI port and 32-bit interface |
| 57 | STM32MP_DDR_DUAL_AXI_PORT:= 1 |
| 58 | STM32MP_DDR_32BIT_INTERFACE:= 1 |
| 59 | |
Nicolas Le Bayon | dfa46cc | 2019-11-18 17:13:42 +0100 | [diff] [blame] | 60 | # STM32 image header version v1.0 |
| 61 | STM32_HEADER_VERSION_MAJOR:= 1 |
| 62 | STM32_HEADER_VERSION_MINOR:= 0 |
Yann Gautier | bc9f0fd | 2022-06-30 11:33:27 +0200 | [diff] [blame] | 63 | |
| 64 | # Add OP-TEE reserved shared memory area in mapping |
| 65 | STM32MP15_OPTEE_RSV_SHM := 1 |
| 66 | $(eval $(call add_defines,STM32MP15_OPTEE_RSV_SHM)) |
Lionel Debieve | fd02b80 | 2022-10-05 16:16:50 +0200 | [diff] [blame] | 67 | |
| 68 | STM32MP_CRYPTO_ROM_LIB := 1 |
Lionel Debieve | 5adcd50 | 2022-10-05 16:51:12 +0200 | [diff] [blame] | 69 | |
| 70 | # Decryption support |
| 71 | ifneq ($(DECRYPTION_SUPPORT),none) |
| 72 | $(error "DECRYPTION_SUPPORT not supported on STM32MP15") |
| 73 | endif |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 74 | endif |
Nicolas Le Bayon | dfa46cc | 2019-11-18 17:13:42 +0100 | [diff] [blame] | 75 | |
Etienne Carriere | ca651fb | 2020-04-10 18:51:54 +0200 | [diff] [blame] | 76 | ifeq ($(AARCH32_SP),sp_min) |
| 77 | # Disable Neon support: sp_min runtime may conflict with non-secure world |
Yann Gautier | 46f8e67 | 2020-09-18 10:32:37 +0200 | [diff] [blame] | 78 | TF_CFLAGS += -mfloat-abi=soft |
Etienne Carriere | ca651fb | 2020-04-10 18:51:54 +0200 | [diff] [blame] | 79 | endif |
| 80 | |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 81 | # Not needed for Cortex-A7 |
| 82 | WORKAROUND_CVE_2017_5715:= 0 |
Bipin Ravi | caa2e05 | 2022-02-23 23:45:50 -0600 | [diff] [blame] | 83 | WORKAROUND_CVE_2022_23960:= 0 |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 84 | |
Yann Gautier | c746591 | 2022-06-30 15:21:19 +0200 | [diff] [blame] | 85 | # Number of TF-A copies in the device |
| 86 | STM32_TF_A_COPIES := 2 |
| 87 | |
| 88 | # PLAT_PARTITION_MAX_ENTRIES must take care of STM32_TF-A_COPIES and other partitions |
| 89 | # such as metadata (2) to find all the FIP partitions (default is 2). |
| 90 | PLAT_PARTITION_MAX_ENTRIES := $(shell echo $$(($(STM32_TF_A_COPIES) + 4))) |
| 91 | |
Sughosh Ganu | a197684 | 2021-11-10 17:47:16 +0530 | [diff] [blame] | 92 | ifeq (${PSA_FWU_SUPPORT},1) |
Sughosh Ganu | a197684 | 2021-11-10 17:47:16 +0530 | [diff] [blame] | 93 | # Number of banks of updatable firmware |
| 94 | NR_OF_FW_BANKS := 2 |
| 95 | NR_OF_IMAGES_IN_FW_BANK := 1 |
| 96 | |
Yann Gautier | c746591 | 2022-06-30 15:21:19 +0200 | [diff] [blame] | 97 | FWU_MAX_PART = $(shell echo $$(($(STM32_TF_A_COPIES) + 2 + $(NR_OF_FW_BANKS)))) |
| 98 | ifeq ($(shell test $(FWU_MAX_PART) -gt $(PLAT_PARTITION_MAX_ENTRIES); echo $$?),0) |
| 99 | $(error "Required partition number is $(FWU_MAX_PART) where PLAT_PARTITION_MAX_ENTRIES is only \ |
| 100 | $(PLAT_PARTITION_MAX_ENTRIES)") |
Sughosh Ganu | a197684 | 2021-11-10 17:47:16 +0530 | [diff] [blame] | 101 | endif |
Sughosh Ganu | a197684 | 2021-11-10 17:47:16 +0530 | [diff] [blame] | 102 | endif |
Yann Gautier | 8244e1d | 2018-10-15 09:36:58 +0200 | [diff] [blame] | 103 | |
Nicolas Toromanoff | 5d3ade0 | 2020-12-22 13:54:51 +0100 | [diff] [blame] | 104 | ifeq ($(STM32MP13),1) |
| 105 | STM32_HASH_VER := 4 |
Nicolas Le Bayon | 5c66fab | 2020-12-02 16:23:49 +0100 | [diff] [blame] | 106 | STM32_RNG_VER := 4 |
Nicolas Toromanoff | 5d3ade0 | 2020-12-22 13:54:51 +0100 | [diff] [blame] | 107 | else # Assuming STM32MP15 |
| 108 | STM32_HASH_VER := 2 |
Nicolas Le Bayon | 5c66fab | 2020-12-02 16:23:49 +0100 | [diff] [blame] | 109 | STM32_RNG_VER := 2 |
Nicolas Toromanoff | 5d3ade0 | 2020-12-22 13:54:51 +0100 | [diff] [blame] | 110 | endif |
| 111 | |
Patrick Delaunay | 4c66e0a | 2022-03-15 11:20:56 +0100 | [diff] [blame] | 112 | # Download load address for serial boot devices |
| 113 | DWL_BUFFER_BASE ?= 0xC7000000 |
| 114 | |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 115 | # Device tree |
Yann Gautier | f03dee5 | 2020-02-25 17:08:10 +0100 | [diff] [blame] | 116 | ifeq ($(STM32MP13),1) |
Yann Gautier | f03dee5 | 2020-02-25 17:08:10 +0100 | [diff] [blame] | 117 | BL2_DTSI := stm32mp13-bl2.dtsi |
| 118 | FDT_SOURCES := $(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl2.dts,$(DTB_FILE_NAME))) |
| 119 | else |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 120 | BL2_DTSI := stm32mp15-bl2.dtsi |
| 121 | FDT_SOURCES := $(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl2.dts,$(DTB_FILE_NAME))) |
| 122 | ifeq ($(AARCH32_SP),sp_min) |
| 123 | BL32_DTSI := stm32mp15-bl32.dtsi |
| 124 | FDT_SOURCES += $(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl32.dts,$(DTB_FILE_NAME))) |
| 125 | endif |
Yann Gautier | d82fca4 | 2021-03-09 10:42:02 +0100 | [diff] [blame] | 126 | endif |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 127 | |
| 128 | # Macros and rules to build TF binary |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 129 | STM32_TF_STM32 := $(addprefix ${BUILD_PLAT}/tf-a-, $(patsubst %.dtb,%.stm32,$(DTB_FILE_NAME))) |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 130 | STM32_LD_FILE := plat/st/stm32mp1/stm32mp1.ld.S |
| 131 | STM32_BINARY_MAPPING := plat/st/stm32mp1/stm32mp1.S |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 132 | |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 133 | ifeq ($(AARCH32_SP),sp_min) |
| 134 | # BL32 is built only if using SP_MIN |
| 135 | BL32_DEP := bl32 |
| 136 | ASFLAGS += -DBL32_BIN_PATH=\"${BUILD_PLAT}/bl32.bin\" |
| 137 | endif |
| 138 | |
Yann Gautier | 658775c | 2021-07-06 10:00:44 +0200 | [diff] [blame] | 139 | STM32MP_FW_CONFIG_NAME := $(patsubst %.dtb,%-fw-config.dtb,$(DTB_FILE_NAME)) |
| 140 | STM32MP_FW_CONFIG := ${BUILD_PLAT}/fdts/$(STM32MP_FW_CONFIG_NAME) |
| 141 | ifneq (${AARCH32_SP},none) |
| 142 | FDT_SOURCES += $(addprefix fdts/, $(patsubst %.dtb,%.dts,$(STM32MP_FW_CONFIG_NAME))) |
| 143 | endif |
| 144 | # Add the FW_CONFIG to FIP and specify the same to certtool |
| 145 | $(eval $(call TOOL_ADD_PAYLOAD,${STM32MP_FW_CONFIG},--fw-config)) |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 146 | ifeq ($(GENERATE_COT),1) |
| 147 | STM32MP_CFG_CERT := $(BUILD_PLAT)/stm32mp_cfg_cert.crt |
| 148 | # Add the STM32MP_CFG_CERT to FIP and specify the same to certtool |
| 149 | $(eval $(call TOOL_ADD_PAYLOAD,${STM32MP_CFG_CERT},--stm32mp-cfg-cert)) |
| 150 | endif |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 151 | ifeq ($(AARCH32_SP),sp_min) |
| 152 | STM32MP_TOS_FW_CONFIG := $(addprefix ${BUILD_PLAT}/fdts/, $(patsubst %.dtb,%-bl32.dtb,$(DTB_FILE_NAME))) |
| 153 | $(eval $(call TOOL_ADD_PAYLOAD,${STM32MP_TOS_FW_CONFIG},--tos-fw-config)) |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 154 | endif |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 155 | |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 156 | # Enable flags for C files |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 157 | $(eval $(call assert_booleans,\ |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 158 | $(sort \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 159 | PKA_USE_BRAINPOOL_P256T1 \ |
| 160 | PKA_USE_NIST_P256 \ |
| 161 | PLAT_TBBR_IMG_DEF \ |
Lionel Debieve | fd02b80 | 2022-10-05 16:16:50 +0200 | [diff] [blame] | 162 | STM32MP_CRYPTO_ROM_LIB \ |
Yann Gautier | 6d8c244 | 2020-09-17 12:42:46 +0200 | [diff] [blame] | 163 | STM32MP_DDR_32BIT_INTERFACE \ |
| 164 | STM32MP_DDR_DUAL_AXI_PORT \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 165 | STM32MP_USE_EXTERNAL_HEAP \ |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 166 | STM32MP13 \ |
| 167 | STM32MP15 \ |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 168 | ))) |
| 169 | |
| 170 | $(eval $(call assert_numerics,\ |
| 171 | $(sort \ |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 172 | PLAT_PARTITION_MAX_ENTRIES \ |
Nicolas Toromanoff | 5d3ade0 | 2020-12-22 13:54:51 +0100 | [diff] [blame] | 173 | STM32_HASH_VER \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 174 | STM32_HEADER_VERSION_MAJOR \ |
Nicolas Le Bayon | 5c66fab | 2020-12-02 16:23:49 +0100 | [diff] [blame] | 175 | STM32_RNG_VER \ |
Yann Gautier | 27f589d | 2021-10-15 17:59:38 +0200 | [diff] [blame] | 176 | STM32_TF_A_COPIES \ |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 177 | ))) |
| 178 | |
| 179 | $(eval $(call add_defines,\ |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 180 | $(sort \ |
Patrick Delaunay | 4c66e0a | 2022-03-15 11:20:56 +0100 | [diff] [blame] | 181 | DWL_BUFFER_BASE \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 182 | PKA_USE_BRAINPOOL_P256T1 \ |
| 183 | PKA_USE_NIST_P256 \ |
Yann Gautier | 27f589d | 2021-10-15 17:59:38 +0200 | [diff] [blame] | 184 | PLAT_PARTITION_MAX_ENTRIES \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 185 | PLAT_TBBR_IMG_DEF \ |
Nicolas Toromanoff | 5d3ade0 | 2020-12-22 13:54:51 +0100 | [diff] [blame] | 186 | STM32_HASH_VER \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 187 | STM32_HEADER_VERSION_MAJOR \ |
Nicolas Le Bayon | 5c66fab | 2020-12-02 16:23:49 +0100 | [diff] [blame] | 188 | STM32_RNG_VER \ |
Yann Gautier | 27f589d | 2021-10-15 17:59:38 +0200 | [diff] [blame] | 189 | STM32_TF_A_COPIES \ |
Lionel Debieve | fd02b80 | 2022-10-05 16:16:50 +0200 | [diff] [blame] | 190 | STM32MP_CRYPTO_ROM_LIB \ |
Yann Gautier | 6d8c244 | 2020-09-17 12:42:46 +0200 | [diff] [blame] | 191 | STM32MP_DDR_32BIT_INTERFACE \ |
| 192 | STM32MP_DDR_DUAL_AXI_PORT \ |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 193 | STM32MP_USE_EXTERNAL_HEAP \ |
Sebastien Pasdeloup | 94389ef | 2020-12-18 11:50:40 +0100 | [diff] [blame] | 194 | STM32MP13 \ |
| 195 | STM32MP15 \ |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 196 | ))) |
Nicolas Le Bayon | 3f42cad | 2019-09-03 09:52:05 +0200 | [diff] [blame] | 197 | |
Yann Gautier | 5f40063 | 2020-02-12 09:30:49 +0100 | [diff] [blame] | 198 | # Include paths and source files |
Yann Gautier | ee8f542 | 2019-02-14 11:13:25 +0100 | [diff] [blame] | 199 | PLAT_INCLUDES += -Iplat/st/stm32mp1/include/ |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 200 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 201 | PLAT_BL_COMMON_SOURCES += plat/st/stm32mp1/stm32mp1_private.c |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 202 | |
Julius Werner | 6b88b65 | 2018-11-27 17:50:28 -0800 | [diff] [blame] | 203 | PLAT_BL_COMMON_SOURCES += drivers/st/uart/aarch32/stm32_console.S |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 204 | |
| 205 | ifneq (${ENABLE_STACK_PROTECTOR},0) |
| 206 | PLAT_BL_COMMON_SOURCES += plat/st/stm32mp1/stm32mp1_stack_protector.c |
| 207 | endif |
| 208 | |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 209 | PLAT_BL_COMMON_SOURCES += lib/cpus/aarch32/cortex_a7.S |
| 210 | |
Yann Gautier | 2c1fa28 | 2019-05-09 11:56:30 +0200 | [diff] [blame] | 211 | PLAT_BL_COMMON_SOURCES += drivers/arm/tzc/tzc400.c \ |
Nicolas Le Bayon | 97287cd | 2019-05-20 18:35:02 +0200 | [diff] [blame] | 212 | drivers/st/bsec/bsec2.c \ |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 213 | drivers/st/ddr/stm32mp1_ddr_helpers.c \ |
Yann Gautier | 113f31e | 2019-01-17 09:34:18 +0100 | [diff] [blame] | 214 | drivers/st/i2c/stm32_i2c.c \ |
Yann Gautier | 091eab5 | 2019-06-04 18:06:34 +0200 | [diff] [blame] | 215 | drivers/st/iwdg/stm32_iwdg.c \ |
Yann Gautier | a45433b | 2019-01-16 18:31:00 +0100 | [diff] [blame] | 216 | drivers/st/pmic/stm32mp_pmic.c \ |
| 217 | drivers/st/pmic/stpmic1.c \ |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 218 | drivers/st/reset/stm32mp1_reset.c \ |
Yann Gautier | 091eab5 | 2019-06-04 18:06:34 +0200 | [diff] [blame] | 219 | plat/st/stm32mp1/stm32mp1_dbgmcu.c \ |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 220 | plat/st/stm32mp1/stm32mp1_helper.S \ |
Yann Gautier | 3edc7c3 | 2019-05-20 19:17:08 +0200 | [diff] [blame] | 221 | plat/st/stm32mp1/stm32mp1_syscfg.c |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 222 | |
Gabriel Fernandez | 1308d75 | 2020-03-11 11:30:34 +0100 | [diff] [blame] | 223 | ifeq ($(STM32MP13),1) |
| 224 | PLAT_BL_COMMON_SOURCES += drivers/st/clk/clk-stm32-core.c \ |
Nicolas Le Bayon | 5c66fab | 2020-12-02 16:23:49 +0100 | [diff] [blame] | 225 | drivers/st/clk/clk-stm32mp13.c \ |
| 226 | drivers/st/crypto/stm32_rng.c |
Gabriel Fernandez | 1308d75 | 2020-03-11 11:30:34 +0100 | [diff] [blame] | 227 | else |
| 228 | PLAT_BL_COMMON_SOURCES += drivers/st/clk/stm32mp1_clk.c |
| 229 | endif |
| 230 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 231 | BL2_SOURCES += plat/st/stm32mp1/plat_bl2_mem_params_desc.c \ |
Lionel Debieve | 1dc5e2e | 2020-09-27 21:13:53 +0200 | [diff] [blame] | 232 | plat/st/stm32mp1/stm32mp1_fconf_firewall.c |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 233 | |
Rohit Ner | f9f72d9 | 2022-05-18 00:55:02 -0700 | [diff] [blame] | 234 | ifeq (${PSA_FWU_SUPPORT},1) |
Sughosh Ganu | a197684 | 2021-11-10 17:47:16 +0530 | [diff] [blame] | 235 | include drivers/fwu/fwu.mk |
Rohit Ner | f9f72d9 | 2022-05-18 00:55:02 -0700 | [diff] [blame] | 236 | endif |
| 237 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 238 | BL2_SOURCES += drivers/st/crypto/stm32_hash.c \ |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 239 | plat/st/stm32mp1/bl2_plat_setup.c |
| 240 | |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 241 | ifeq (${TRUSTED_BOARD_BOOT},1) |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 242 | ifeq ($(STM32MP13),1) |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 243 | BL2_SOURCES += drivers/st/crypto/stm32_pka.c |
| 244 | BL2_SOURCES += drivers/st/crypto/stm32_saes.c |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 245 | endif |
Lionel Debieve | 13a668d | 2022-10-05 16:47:03 +0200 | [diff] [blame] | 246 | endif |
| 247 | |
Nicolas Le Bayon | 3f42cad | 2019-09-03 09:52:05 +0200 | [diff] [blame] | 248 | ifneq ($(filter 1,${STM32MP_EMMC} ${STM32MP_SDMMC}),) |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 249 | BL2_SOURCES += drivers/st/mmc/stm32_sdmmc2.c |
Nicolas Le Bayon | 3f42cad | 2019-09-03 09:52:05 +0200 | [diff] [blame] | 250 | endif |
Yann Gautier | 8244e1d | 2018-10-15 09:36:58 +0200 | [diff] [blame] | 251 | |
Lionel Debieve | 402a46b | 2019-11-04 12:28:15 +0100 | [diff] [blame] | 252 | ifeq (${STM32MP_RAW_NAND},1) |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 253 | BL2_SOURCES += drivers/st/fmc/stm32_fmc2_nand.c |
Lionel Debieve | 186b046 | 2019-09-24 18:30:12 +0200 | [diff] [blame] | 254 | endif |
| 255 | |
Lionel Debieve | cb0dbc4 | 2019-09-25 09:11:31 +0200 | [diff] [blame] | 256 | ifneq ($(filter 1,${STM32MP_SPI_NAND} ${STM32MP_SPI_NOR}),) |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 257 | BL2_SOURCES += drivers/st/spi/stm32_qspi.c |
Lionel Debieve | cb0dbc4 | 2019-09-25 09:11:31 +0200 | [diff] [blame] | 258 | endif |
| 259 | |
| 260 | ifneq ($(filter 1,${STM32MP_RAW_NAND} ${STM32MP_SPI_NAND} ${STM32MP_SPI_NOR}),) |
| 261 | BL2_SOURCES += plat/st/stm32mp1/stm32mp1_boot_device.c |
Lionel Debieve | 402a46b | 2019-11-04 12:28:15 +0100 | [diff] [blame] | 262 | endif |
| 263 | |
Patrick Delaunay | e50571b | 2021-10-28 13:48:52 +0200 | [diff] [blame] | 264 | ifeq (${STM32MP_UART_PROGRAMMER},1) |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 265 | BL2_SOURCES += drivers/st/uart/stm32_uart.c |
Patrick Delaunay | e50571b | 2021-10-28 13:48:52 +0200 | [diff] [blame] | 266 | endif |
| 267 | |
Patrick Delaunay | 9c5ee78 | 2021-07-06 14:07:56 +0200 | [diff] [blame] | 268 | ifeq (${STM32MP_USB_PROGRAMMER},1) |
| 269 | #The DFU stack uses only one end point, reduce the USB stack footprint |
| 270 | $(eval $(call add_define_val,CONFIG_USBD_EP_NB,1U)) |
Patrick Delaunay | e50571b | 2021-10-28 13:48:52 +0200 | [diff] [blame] | 271 | BL2_SOURCES += drivers/st/usb/stm32mp1_usb.c \ |
Patrick Delaunay | 9c5ee78 | 2021-07-06 14:07:56 +0200 | [diff] [blame] | 272 | plat/st/stm32mp1/stm32mp1_usb_dfu.c |
| 273 | endif |
| 274 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 275 | BL2_SOURCES += drivers/st/ddr/stm32mp1_ddr.c \ |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 276 | drivers/st/ddr/stm32mp1_ram.c |
| 277 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 278 | BL2_SOURCES += plat/st/stm32mp1/plat_image_load.c |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 279 | |
| 280 | ifeq ($(AARCH32_SP),sp_min) |
| 281 | # Create DTB file for BL32 |
| 282 | ${BUILD_PLAT}/fdts/%-bl32.dts: fdts/%.dts fdts/${BL32_DTSI} | ${BUILD_PLAT} fdt_dirs |
| 283 | @echo '#include "$(patsubst fdts/%,%,$<)"' > $@ |
| 284 | @echo '#include "${BL32_DTSI}"' >> $@ |
| 285 | |
| 286 | ${BUILD_PLAT}/fdts/%-bl32.dtb: ${BUILD_PLAT}/fdts/%-bl32.dts |
| 287 | endif |
| 288 | |
Yann Gautier | dbe63ac | 2022-03-16 19:03:20 +0100 | [diff] [blame] | 289 | include plat/st/common/common_rules.mk |