blob: 73fbd872b1e4110ad6433545a78f902928b32657 [file] [log] [blame]
Jacky Bai07ed02c2020-06-03 14:28:45 +08001#
Jacky Bai210ec7d2022-03-28 16:11:23 +08002# Copyright 2019-2022 NXP
Jacky Bai07ed02c2020-06-03 14:28:45 +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)a61a5c22021-04-07 06:52:57 +08009 -Iplat/imx/imx8m/imx8mp/include \
10 -Idrivers/imx/usdhc \
11 -Iinclude/common/tbbr
Jacky Bai07ed02c2020-06-03 14:28:45 +080012# Translation tables library
13include lib/xlat_tables_v2/xlat_tables.mk
14
15# Include GICv3 driver files
16include drivers/arm/gic/v3/gicv3.mk
17
18IMX_GIC_SOURCES := ${GICV3_SOURCES} \
19 plat/common/plat_gicv3.c \
20 plat/common/plat_psci_common.c \
21 plat/imx/common/plat_imx8_gic.c
22
23BL31_SOURCES += plat/imx/common/imx8_helpers.S \
24 plat/imx/imx8m/gpc_common.c \
25 plat/imx/imx8m/imx_aipstz.c \
26 plat/imx/imx8m/imx_rdc.c \
27 plat/imx/imx8m/imx8m_caam.c \
Jacky Bai3c3c2682020-01-07 14:53:54 +080028 plat/imx/imx8m/imx8m_csu.c \
Jacky Bai07ed02c2020-06-03 14:28:45 +080029 plat/imx/imx8m/imx8m_psci_common.c \
30 plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c \
31 plat/imx/imx8m/imx8mp/imx8mp_psci.c \
32 plat/imx/imx8m/imx8mp/gpc.c \
33 plat/imx/common/imx8_topology.c \
34 plat/imx/common/imx_sip_handler.c \
35 plat/imx/common/imx_sip_svc.c \
36 plat/imx/common/imx_uart_console.S \
37 lib/cpus/aarch64/cortex_a53.S \
38 drivers/arm/tzc/tzc380.c \
39 drivers/delay_timer/delay_timer.c \
40 drivers/delay_timer/generic_delay_timer.c \
41 ${IMX_GIC_SOURCES} \
42 ${XLAT_TABLES_LIB_SRCS}
43
Ying-Chun Liu (PaulLiu)a61a5c22021-04-07 06:52:57 +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/imx8mp/imx8mp_bl2_el3_setup.c \
49 plat/imx/imx8m/imx8mp/gpc.c \
50 plat/imx/imx8m/imx_aipstz.c \
51 plat/imx/imx8m/imx_rdc.c \
52 plat/imx/imx8m/imx8m_caam.c \
53 plat/common/plat_psci_common.c \
54 lib/cpus/aarch64/cortex_a53.S \
55 drivers/arm/tzc/tzc380.c \
56 drivers/delay_timer/delay_timer.c \
57 drivers/delay_timer/generic_delay_timer.c \
58 ${PLAT_GIC_SOURCES} \
59 ${PLAT_DRAM_SOURCES} \
60 ${XLAT_TABLES_LIB_SRCS} \
61 drivers/mmc/mmc.c \
62 drivers/io/io_block.c \
63 drivers/io/io_fip.c \
64 drivers/io/io_memmap.c \
65 drivers/io/io_storage.c \
66 drivers/imx/usdhc/imx_usdhc.c \
67 plat/imx/imx8m/imx8mp/imx8mp_bl2_mem_params_desc.c \
68 plat/imx/common/imx_io_storage.c \
69 plat/imx/imx8m/imx8m_image_load.c \
70 lib/optee/optee_utils.c
71endif
72
73# Add the build options to pack BLx images and kernel device tree
74# in the FIP if the platform requires.
75ifneq ($(BL2),)
76RESET_TO_BL31 := 0
77$(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert))
78endif
79ifneq ($(BL32_EXTRA1),)
80$(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1))
81endif
82ifneq ($(BL32_EXTRA2),)
83$(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2))
84endif
85ifneq ($(HW_CONFIG),)
86$(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config))
87endif
88
89ifeq (${NEED_BL2},yes)
90$(eval $(call add_define,NEED_BL2))
91LOAD_IMAGE_V2 := 1
92# Non-TF Boot ROM
93BL2_AT_EL3 := 1
94endif
95
Ying-Chun Liu (PaulLiu)f70e2892021-04-07 07:18:52 +080096ifneq (${TRUSTED_BOARD_BOOT},0)
97
98include drivers/auth/mbedtls/mbedtls_crypto.mk
99include drivers/auth/mbedtls/mbedtls_x509.mk
100
101AUTH_SOURCES := drivers/auth/auth_mod.c \
102 drivers/auth/crypto_mod.c \
103 drivers/auth/img_parser_mod.c \
104 drivers/auth/tbbr/tbbr_cot_common.c \
105 drivers/auth/tbbr/tbbr_cot_bl2.c
106
107BL2_SOURCES += ${AUTH_SOURCES} \
108 plat/common/tbbr/plat_tbbr.c \
109 plat/imx/imx8m/imx8mp/imx8mp_trusted_boot.c \
110 plat/imx/imx8m/imx8mp/imx8mp_rotpk.S
111
112ROT_KEY = $(BUILD_PLAT)/rot_key.pem
113ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin
114
115$(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"'))
116$(eval $(call MAKE_LIB_DIRS))
117
118$(BUILD_PLAT)/bl2/imx8mp_rotpk.o: $(ROTPK_HASH)
119
120certificates: $(ROT_KEY)
121
122$(ROT_KEY): | $(BUILD_PLAT)
123 @echo " OPENSSL $@"
124 @if [ ! -f $(ROT_KEY) ]; then \
125 openssl genrsa 2048 > $@ 2>/dev/null; \
126 fi
127
128$(ROTPK_HASH): $(ROT_KEY)
129 @echo " OPENSSL $@"
130 $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\
131 openssl dgst -sha256 -binary > $@ 2>/dev/null
132endif
133
Jacky Bai07ed02c2020-06-03 14:28:45 +0800134USE_COHERENT_MEM := 1
135RESET_TO_BL31 := 1
136A53_DISABLE_NON_TEMPORAL_HINT := 0
137
138ERRATA_A53_835769 := 1
139ERRATA_A53_843419 := 1
140ERRATA_A53_855873 := 1
141
142BL32_BASE ?= 0x56000000
143$(eval $(call add_define,BL32_BASE))
144
145BL32_SIZE ?= 0x2000000
146$(eval $(call add_define,BL32_SIZE))
147
148IMX_BOOT_UART_BASE ?= 0x30890000
149$(eval $(call add_define,IMX_BOOT_UART_BASE))
Peng Fan5cbabbc2021-03-25 18:46:58 +0800150
Jacky Bai210ec7d2022-03-28 16:11:23 +0800151EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT)
152ifeq (${SDEI_SUPPORT}, 1)
153BL31_SOURCES += plat/imx/common/imx_ehf.c \
154 plat/imx/common/imx_sdei.c
155endif
Ji Luoe329b3d2020-02-20 23:47:21 +0800156
157ifeq (${SPD},trusty)
158 BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
159endif