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