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