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 \ |
| 11 | -Iinclude/common/tbbr |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 12 | |
Alexei Fedorov | 84f1b5d | 2020-03-23 18:45:17 +0000 | [diff] [blame] | 13 | # Include GICv3 driver files |
| 14 | include drivers/arm/gic/v3/gicv3.mk |
| 15 | |
| 16 | IMX_GIC_SOURCES := ${GICV3_SOURCES} \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 17 | plat/common/plat_gicv3.c \ |
| 18 | plat/common/plat_psci_common.c \ |
| 19 | plat/imx/common/plat_imx8_gic.c |
| 20 | |
| 21 | BL31_SOURCES += plat/imx/common/imx8_helpers.S \ |
| 22 | plat/imx/imx8m/gpc_common.c \ |
Jacky Bai | 91c6d32 | 2019-05-21 20:24:52 +0800 | [diff] [blame] | 23 | plat/imx/imx8m/imx_aipstz.c \ |
Jacky Bai | 64130a3 | 2019-07-18 13:43:17 +0800 | [diff] [blame] | 24 | plat/imx/imx8m/imx_rdc.c \ |
Jacky Bai | 3bf04a5 | 2019-06-12 17:41:47 +0800 | [diff] [blame] | 25 | plat/imx/imx8m/imx8m_caam.c \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 26 | 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 Crestez | 402bd52 | 2019-05-08 22:29:21 +0300 | [diff] [blame] | 31 | plat/imx/common/imx_sip_handler.c \ |
| 32 | plat/imx/common/imx_sip_svc.c \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 33 | plat/imx/common/imx_uart_console.S \ |
Peng Fan | 57e982c | 2020-07-27 21:22:14 +0800 | [diff] [blame] | 34 | plat/imx/common/imx_ehf.c \ |
| 35 | plat/imx/common/imx_sdei.c \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 36 | lib/xlat_tables/aarch64/xlat_tables.c \ |
| 37 | lib/xlat_tables/xlat_tables_common.c \ |
| 38 | lib/cpus/aarch64/cortex_a53.S \ |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 39 | 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) | 234c271 | 2020-12-22 02:56:00 +0800 | [diff] [blame] | 44 | ifeq (${NEED_BL2},yes) |
| 45 | BL2_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 |
| 69 | endif |
| 70 | |
| 71 | # Add the build options to pack BLx images and kernel device tree |
| 72 | # in the FIP if the platform requires. |
| 73 | ifneq ($(BL2),) |
| 74 | RESET_TO_BL31 := 0 |
| 75 | $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert)) |
| 76 | endif |
| 77 | ifneq ($(BL32_EXTRA1),) |
| 78 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1)) |
| 79 | endif |
| 80 | ifneq ($(BL32_EXTRA2),) |
| 81 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2)) |
| 82 | endif |
| 83 | ifneq ($(HW_CONFIG),) |
| 84 | $(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config)) |
| 85 | endif |
| 86 | |
| 87 | ifeq (${NEED_BL2},yes) |
| 88 | $(eval $(call add_define,NEED_BL2)) |
| 89 | LOAD_IMAGE_V2 := 1 |
| 90 | # Non-TF Boot ROM |
| 91 | BL2_AT_EL3 := 1 |
| 92 | endif |
| 93 | |
| 94 | ifneq (${TRUSTED_BOARD_BOOT},0) |
| 95 | |
| 96 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 97 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 98 | |
| 99 | AUTH_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 | |
| 105 | BL2_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 | |
| 110 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 111 | ROTPK_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 | |
| 118 | certificates: $(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 |
| 130 | endif |
| 131 | |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 132 | USE_COHERENT_MEM := 1 |
| 133 | RESET_TO_BL31 := 1 |
| 134 | A53_DISABLE_NON_TEMPORAL_HINT := 0 |
Jacky Bai | a617700 | 2019-03-06 17:15:06 +0800 | [diff] [blame] | 135 | |
| 136 | ERRATA_A53_835769 := 1 |
| 137 | ERRATA_A53_843419 := 1 |
| 138 | ERRATA_A53_855873 := 1 |
Jacky Bai | 2a763ba | 2019-07-18 13:34:09 +0800 | [diff] [blame] | 139 | |
| 140 | BL32_BASE ?= 0xbe000000 |
| 141 | $(eval $(call add_define,BL32_BASE)) |
| 142 | |
| 143 | BL32_SIZE ?= 0x2000000 |
| 144 | $(eval $(call add_define,BL32_SIZE)) |
Igor Opaniuk | 9fc5cb6 | 2020-03-05 22:10:41 +0200 | [diff] [blame] | 145 | |
| 146 | IMX_BOOT_UART_BASE ?= 0x30890000 |
| 147 | $(eval $(call add_define,IMX_BOOT_UART_BASE)) |
Peng Fan | 57e982c | 2020-07-27 21:22:14 +0800 | [diff] [blame] | 148 | |
| 149 | EL3_EXCEPTION_HANDLING := 1 |
| 150 | SDEI_SUPPORT := 1 |