Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 1 | # |
Alexei Fedorov | 2f13d6c | 2020-02-21 10:17:26 +0000 | [diff] [blame] | 2 | # Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved. |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | PLAT_INCLUDES := -Iplat/imx/common/include \ |
| 8 | -Iplat/imx/imx8m/include \ |
Ying-Chun Liu (PaulLiu) | 234c271 | 2020-12-22 02:56:00 +0800 | [diff] [blame] | 9 | -Iplat/imx/imx8m/imx8mm/include \ |
| 10 | -Idrivers/imx/usdhc \ |
Ying-Chun Liu (PaulLiu) | ac6d862 | 2021-10-06 09:27:00 +0800 | [diff] [blame] | 11 | -Iinclude/common/tbbr \ |
| 12 | -Iinclude/lib/libfdt |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 13 | |
Alexei Fedorov | 84f1b5d | 2020-03-23 18:45:17 +0000 | [diff] [blame] | 14 | # Include GICv3 driver files |
| 15 | include drivers/arm/gic/v3/gicv3.mk |
| 16 | |
Ying-Chun Liu (PaulLiu) | ac6d862 | 2021-10-06 09:27:00 +0800 | [diff] [blame] | 17 | include lib/libfdt/libfdt.mk |
| 18 | |
Alexei Fedorov | 84f1b5d | 2020-03-23 18:45:17 +0000 | [diff] [blame] | 19 | IMX_GIC_SOURCES := ${GICV3_SOURCES} \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 20 | plat/common/plat_gicv3.c \ |
| 21 | plat/common/plat_psci_common.c \ |
| 22 | plat/imx/common/plat_imx8_gic.c |
| 23 | |
| 24 | BL31_SOURCES += plat/imx/common/imx8_helpers.S \ |
| 25 | plat/imx/imx8m/gpc_common.c \ |
Jacky Bai | 91c6d32 | 2019-05-21 20:24:52 +0800 | [diff] [blame] | 26 | plat/imx/imx8m/imx_aipstz.c \ |
Jacky Bai | 64130a3 | 2019-07-18 13:43:17 +0800 | [diff] [blame] | 27 | plat/imx/imx8m/imx_rdc.c \ |
Jacky Bai | 3bf04a5 | 2019-06-12 17:41:47 +0800 | [diff] [blame] | 28 | plat/imx/imx8m/imx8m_caam.c \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 29 | plat/imx/imx8m/imx8m_psci_common.c \ |
| 30 | plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c \ |
| 31 | plat/imx/imx8m/imx8mm/imx8mm_psci.c \ |
| 32 | plat/imx/imx8m/imx8mm/gpc.c \ |
| 33 | plat/imx/common/imx8_topology.c \ |
Leonard Crestez | 402bd52 | 2019-05-08 22:29:21 +0300 | [diff] [blame] | 34 | plat/imx/common/imx_sip_handler.c \ |
| 35 | plat/imx/common/imx_sip_svc.c \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 36 | plat/imx/common/imx_uart_console.S \ |
Peng Fan | 57e982c | 2020-07-27 21:22:14 +0800 | [diff] [blame] | 37 | plat/imx/common/imx_ehf.c \ |
| 38 | plat/imx/common/imx_sdei.c \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 39 | lib/xlat_tables/aarch64/xlat_tables.c \ |
| 40 | lib/xlat_tables/xlat_tables_common.c \ |
| 41 | lib/cpus/aarch64/cortex_a53.S \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 42 | drivers/arm/tzc/tzc380.c \ |
| 43 | drivers/delay_timer/delay_timer.c \ |
| 44 | drivers/delay_timer/generic_delay_timer.c \ |
| 45 | ${IMX_GIC_SOURCES} |
| 46 | |
Ying-Chun Liu (PaulLiu) | 234c271 | 2020-12-22 02:56:00 +0800 | [diff] [blame] | 47 | ifeq (${NEED_BL2},yes) |
| 48 | BL2_SOURCES += common/desc_image_load.c \ |
Ying-Chun Liu (PaulLiu) | ac6d862 | 2021-10-06 09:27:00 +0800 | [diff] [blame] | 49 | common/fdt_wrappers.c \ |
Ying-Chun Liu (PaulLiu) | 234c271 | 2020-12-22 02:56:00 +0800 | [diff] [blame] | 50 | plat/imx/common/imx8_helpers.S \ |
| 51 | plat/imx/common/imx_uart_console.S \ |
| 52 | plat/imx/imx8m/imx8mm/imx8mm_bl2_el3_setup.c \ |
| 53 | plat/imx/imx8m/imx8mm/gpc.c \ |
| 54 | plat/imx/imx8m/imx_aipstz.c \ |
| 55 | plat/common/plat_psci_common.c \ |
| 56 | lib/xlat_tables/aarch64/xlat_tables.c \ |
| 57 | lib/xlat_tables/xlat_tables_common.c \ |
| 58 | lib/cpus/aarch64/cortex_a53.S \ |
| 59 | drivers/delay_timer/delay_timer.c \ |
| 60 | drivers/delay_timer/generic_delay_timer.c \ |
| 61 | ${PLAT_GIC_SOURCES} \ |
| 62 | ${PLAT_DRAM_SOURCES} \ |
| 63 | drivers/mmc/mmc.c \ |
| 64 | drivers/io/io_block.c \ |
| 65 | drivers/io/io_fip.c \ |
| 66 | drivers/io/io_memmap.c \ |
| 67 | drivers/io/io_storage.c \ |
| 68 | drivers/imx/usdhc/imx_usdhc.c \ |
| 69 | plat/imx/imx8m/imx8mm/imx8mm_bl2_mem_params_desc.c \ |
Ying-Chun Liu (PaulLiu) | 54cabc4 | 2021-04-07 06:10:32 +0800 | [diff] [blame] | 70 | plat/imx/common/imx_io_storage.c \ |
Ying-Chun Liu (PaulLiu) | e6a7f88 | 2021-04-07 06:12:37 +0800 | [diff] [blame] | 71 | plat/imx/imx8m/imx8m_image_load.c \ |
Ying-Chun Liu (PaulLiu) | 234c271 | 2020-12-22 02:56:00 +0800 | [diff] [blame] | 72 | lib/optee/optee_utils.c |
| 73 | endif |
| 74 | |
| 75 | # Add the build options to pack BLx images and kernel device tree |
| 76 | # in the FIP if the platform requires. |
| 77 | ifneq ($(BL2),) |
| 78 | RESET_TO_BL31 := 0 |
| 79 | $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert)) |
| 80 | endif |
| 81 | ifneq ($(BL32_EXTRA1),) |
| 82 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1)) |
| 83 | endif |
| 84 | ifneq ($(BL32_EXTRA2),) |
| 85 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2)) |
| 86 | endif |
| 87 | ifneq ($(HW_CONFIG),) |
| 88 | $(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config)) |
| 89 | endif |
| 90 | |
| 91 | ifeq (${NEED_BL2},yes) |
| 92 | $(eval $(call add_define,NEED_BL2)) |
| 93 | LOAD_IMAGE_V2 := 1 |
| 94 | # Non-TF Boot ROM |
| 95 | BL2_AT_EL3 := 1 |
| 96 | endif |
| 97 | |
| 98 | ifneq (${TRUSTED_BOARD_BOOT},0) |
| 99 | |
| 100 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 101 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 102 | |
| 103 | AUTH_SOURCES := drivers/auth/auth_mod.c \ |
| 104 | drivers/auth/crypto_mod.c \ |
| 105 | drivers/auth/img_parser_mod.c \ |
| 106 | drivers/auth/tbbr/tbbr_cot_common.c \ |
| 107 | drivers/auth/tbbr/tbbr_cot_bl2.c |
| 108 | |
| 109 | BL2_SOURCES += ${AUTH_SOURCES} \ |
| 110 | plat/common/tbbr/plat_tbbr.c \ |
| 111 | plat/imx/imx8m/imx8mm/imx8mm_trusted_boot.c \ |
| 112 | plat/imx/imx8m/imx8mm/imx8mm_rotpk.S |
| 113 | |
| 114 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 115 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 116 | |
| 117 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
| 118 | $(eval $(call MAKE_LIB_DIRS)) |
| 119 | |
| 120 | $(BUILD_PLAT)/bl2/imx8mm_rotpk.o: $(ROTPK_HASH) |
| 121 | |
| 122 | certificates: $(ROT_KEY) |
| 123 | |
| 124 | $(ROT_KEY): | $(BUILD_PLAT) |
| 125 | @echo " OPENSSL $@" |
| 126 | @if [ ! -f $(ROT_KEY) ]; then \ |
| 127 | openssl genrsa 2048 > $@ 2>/dev/null; \ |
| 128 | fi |
| 129 | |
| 130 | $(ROTPK_HASH): $(ROT_KEY) |
| 131 | @echo " OPENSSL $@" |
| 132 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 133 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 134 | endif |
| 135 | |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 136 | USE_COHERENT_MEM := 1 |
| 137 | RESET_TO_BL31 := 1 |
| 138 | A53_DISABLE_NON_TEMPORAL_HINT := 0 |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 139 | |
| 140 | ERRATA_A53_835769 := 1 |
| 141 | ERRATA_A53_843419 := 1 |
| 142 | ERRATA_A53_855873 := 1 |
Jacky Bai | 2a763ba | 2019-07-18 13:34:09 +0800 | [diff] [blame] | 143 | |
| 144 | BL32_BASE ?= 0xbe000000 |
| 145 | $(eval $(call add_define,BL32_BASE)) |
| 146 | |
| 147 | BL32_SIZE ?= 0x2000000 |
| 148 | $(eval $(call add_define,BL32_SIZE)) |
Igor Opaniuk | 9fc5cb6 | 2020-03-05 22:10:41 +0200 | [diff] [blame] | 149 | |
| 150 | IMX_BOOT_UART_BASE ?= 0x30890000 |
| 151 | $(eval $(call add_define,IMX_BOOT_UART_BASE)) |
Peng Fan | 57e982c | 2020-07-27 21:22:14 +0800 | [diff] [blame] | 152 | |
| 153 | EL3_EXCEPTION_HANDLING := 1 |
| 154 | SDEI_SUPPORT := 1 |
Ying-Chun Liu (PaulLiu) | ac6d862 | 2021-10-06 09:27:00 +0800 | [diff] [blame] | 155 | |
| 156 | ifeq (${MEASURED_BOOT},1) |
| 157 | MEASURED_BOOT_MK := drivers/measured_boot/event_log/event_log.mk |
| 158 | $(info Including ${MEASURED_BOOT_MK}) |
| 159 | include ${MEASURED_BOOT_MK} |
| 160 | |
| 161 | BL2_SOURCES += plat/imx/imx8m/imx8m_measured_boot.c \ |
| 162 | plat/imx/imx8m/imx8m_dyn_cfg_helpers.c \ |
| 163 | ${EVENT_LOG_SOURCES} |
| 164 | |
| 165 | endif |