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