blob: 186323393f4e6273996db798c01886643b1c60f3 [file] [log] [blame]
Jacky Baia6177002019-03-06 17:15:06 +08001#
Alexei Fedorov2f13d6c2020-02-21 10:17:26 +00002# Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved.
Jacky Baia6177002019-03-06 17:15:06 +08003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7PLAT_INCLUDES := -Iplat/imx/common/include \
8 -Iplat/imx/imx8m/include \
Ying-Chun Liu (PaulLiu)234c2712020-12-22 02:56:00 +08009 -Iplat/imx/imx8m/imx8mm/include \
10 -Idrivers/imx/usdhc \
11 -Iinclude/common/tbbr
Jacky Baia6177002019-03-06 17:15:06 +080012
Alexei Fedorov84f1b5d2020-03-23 18:45:17 +000013# Include GICv3 driver files
14include drivers/arm/gic/v3/gicv3.mk
15
16IMX_GIC_SOURCES := ${GICV3_SOURCES} \
Jacky Baia6177002019-03-06 17:15:06 +080017 plat/common/plat_gicv3.c \
18 plat/common/plat_psci_common.c \
19 plat/imx/common/plat_imx8_gic.c
20
21BL31_SOURCES += plat/imx/common/imx8_helpers.S \
22 plat/imx/imx8m/gpc_common.c \
Jacky Bai91c6d322019-05-21 20:24:52 +080023 plat/imx/imx8m/imx_aipstz.c \
Jacky Bai64130a32019-07-18 13:43:17 +080024 plat/imx/imx8m/imx_rdc.c \
Jacky Bai3bf04a52019-06-12 17:41:47 +080025 plat/imx/imx8m/imx8m_caam.c \
Jacky Baia6177002019-03-06 17:15:06 +080026 plat/imx/imx8m/imx8m_psci_common.c \
27 plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c \
28 plat/imx/imx8m/imx8mm/imx8mm_psci.c \
29 plat/imx/imx8m/imx8mm/gpc.c \
30 plat/imx/common/imx8_topology.c \
Leonard Crestez402bd522019-05-08 22:29:21 +030031 plat/imx/common/imx_sip_handler.c \
32 plat/imx/common/imx_sip_svc.c \
Jacky Baia6177002019-03-06 17:15:06 +080033 plat/imx/common/imx_uart_console.S \
Peng Fan57e982c2020-07-27 21:22:14 +080034 plat/imx/common/imx_ehf.c \
35 plat/imx/common/imx_sdei.c \
Jacky Baia6177002019-03-06 17:15:06 +080036 lib/xlat_tables/aarch64/xlat_tables.c \
37 lib/xlat_tables/xlat_tables_common.c \
38 lib/cpus/aarch64/cortex_a53.S \
Jacky Baia6177002019-03-06 17:15:06 +080039 drivers/arm/tzc/tzc380.c \
40 drivers/delay_timer/delay_timer.c \
41 drivers/delay_timer/generic_delay_timer.c \
42 ${IMX_GIC_SOURCES}
43
Ying-Chun Liu (PaulLiu)234c2712020-12-22 02:56:00 +080044ifeq (${NEED_BL2},yes)
45BL2_SOURCES += common/desc_image_load.c \
46 plat/imx/common/imx8_helpers.S \
47 plat/imx/common/imx_uart_console.S \
48 plat/imx/imx8m/imx8mm/imx8mm_bl2_el3_setup.c \
49 plat/imx/imx8m/imx8mm/gpc.c \
50 plat/imx/imx8m/imx_aipstz.c \
51 plat/common/plat_psci_common.c \
52 lib/xlat_tables/aarch64/xlat_tables.c \
53 lib/xlat_tables/xlat_tables_common.c \
54 lib/cpus/aarch64/cortex_a53.S \
55 drivers/delay_timer/delay_timer.c \
56 drivers/delay_timer/generic_delay_timer.c \
57 ${PLAT_GIC_SOURCES} \
58 ${PLAT_DRAM_SOURCES} \
59 drivers/mmc/mmc.c \
60 drivers/io/io_block.c \
61 drivers/io/io_fip.c \
62 drivers/io/io_memmap.c \
63 drivers/io/io_storage.c \
64 drivers/imx/usdhc/imx_usdhc.c \
65 plat/imx/imx8m/imx8mm/imx8mm_bl2_mem_params_desc.c \
66 plat/imx/imx8m/imx8mm/imx8mm_io_storage.c \
67 plat/imx/imx8m/imx8mm/imx8mm_image_load.c \
68 lib/optee/optee_utils.c
69endif
70
71# Add the build options to pack BLx images and kernel device tree
72# in the FIP if the platform requires.
73ifneq ($(BL2),)
74RESET_TO_BL31 := 0
75$(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert))
76endif
77ifneq ($(BL32_EXTRA1),)
78$(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1))
79endif
80ifneq ($(BL32_EXTRA2),)
81$(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2))
82endif
83ifneq ($(HW_CONFIG),)
84$(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config))
85endif
86
87ifeq (${NEED_BL2},yes)
88$(eval $(call add_define,NEED_BL2))
89LOAD_IMAGE_V2 := 1
90# Non-TF Boot ROM
91BL2_AT_EL3 := 1
92endif
93
94ifneq (${TRUSTED_BOARD_BOOT},0)
95
96include drivers/auth/mbedtls/mbedtls_crypto.mk
97include drivers/auth/mbedtls/mbedtls_x509.mk
98
99AUTH_SOURCES := drivers/auth/auth_mod.c \
100 drivers/auth/crypto_mod.c \
101 drivers/auth/img_parser_mod.c \
102 drivers/auth/tbbr/tbbr_cot_common.c \
103 drivers/auth/tbbr/tbbr_cot_bl2.c
104
105BL2_SOURCES += ${AUTH_SOURCES} \
106 plat/common/tbbr/plat_tbbr.c \
107 plat/imx/imx8m/imx8mm/imx8mm_trusted_boot.c \
108 plat/imx/imx8m/imx8mm/imx8mm_rotpk.S
109
110ROT_KEY = $(BUILD_PLAT)/rot_key.pem
111ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin
112
113$(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"'))
114$(eval $(call MAKE_LIB_DIRS))
115
116$(BUILD_PLAT)/bl2/imx8mm_rotpk.o: $(ROTPK_HASH)
117
118certificates: $(ROT_KEY)
119
120$(ROT_KEY): | $(BUILD_PLAT)
121 @echo " OPENSSL $@"
122 @if [ ! -f $(ROT_KEY) ]; then \
123 openssl genrsa 2048 > $@ 2>/dev/null; \
124 fi
125
126$(ROTPK_HASH): $(ROT_KEY)
127 @echo " OPENSSL $@"
128 $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\
129 openssl dgst -sha256 -binary > $@ 2>/dev/null
130endif
131
Jacky Baia6177002019-03-06 17:15:06 +0800132USE_COHERENT_MEM := 1
133RESET_TO_BL31 := 1
134A53_DISABLE_NON_TEMPORAL_HINT := 0
Jacky Baia6177002019-03-06 17:15:06 +0800135
136ERRATA_A53_835769 := 1
137ERRATA_A53_843419 := 1
138ERRATA_A53_855873 := 1
Jacky Bai2a763ba2019-07-18 13:34:09 +0800139
140BL32_BASE ?= 0xbe000000
141$(eval $(call add_define,BL32_BASE))
142
143BL32_SIZE ?= 0x2000000
144$(eval $(call add_define,BL32_SIZE))
Igor Opaniuk9fc5cb62020-03-05 22:10:41 +0200145
146IMX_BOOT_UART_BASE ?= 0x30890000
147$(eval $(call add_define,IMX_BOOT_UART_BASE))
Peng Fan57e982c2020-07-27 21:22:14 +0800148
149EL3_EXCEPTION_HANDLING := 1
150SDEI_SUPPORT := 1