Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 1 | # |
Ambroise Vincent | 41ef3ed | 2019-05-29 14:14:03 +0100 | [diff] [blame] | 2 | # Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | # Architecture |
| 8 | $(eval $(call add_define,ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)) |
| 9 | |
| 10 | # Tune compiler for Cortex-A7 |
| 11 | ifeq ($(notdir $(CC)),armclang) |
| 12 | TF_CFLAGS += -mfpu=neon |
| 13 | ASFLAGS += -mfpu=neon |
| 14 | else ifneq ($(findstring clang,$(notdir $(CC))),) |
| 15 | TF_CFLAGS += -mfpu=neon |
| 16 | ASFLAGS += -mfpu=neon |
| 17 | else |
| 18 | TF_CFLAGS += -mfpu=neon |
| 19 | ASFLAGS += -mfpu=neon |
| 20 | endif |
| 21 | |
| 22 | # Platform |
| 23 | PLAT_INCLUDES := -Idrivers/imx/uart \ |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 24 | -Iplat/imx/common/include/ \ |
| 25 | -Iplat/imx/imx7/warp7/include \ |
| 26 | -Idrivers/imx/timer \ |
| 27 | -Idrivers/imx/usdhc \ |
| 28 | -Iplat/imx/imx7/include |
| 29 | |
| 30 | # Translation tables library |
| 31 | include lib/xlat_tables_v2/xlat_tables.mk |
| 32 | |
| 33 | BL2_SOURCES += common/desc_image_load.c \ |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 34 | drivers/delay_timer/delay_timer.c \ |
| 35 | drivers/mmc/mmc.c \ |
| 36 | drivers/io/io_block.c \ |
| 37 | drivers/io/io_fip.c \ |
| 38 | drivers/io/io_memmap.c \ |
| 39 | drivers/io/io_storage.c \ |
| 40 | drivers/imx/timer/imx_gpt.c \ |
| 41 | drivers/imx/uart/imx_uart.c \ |
| 42 | drivers/imx/uart/imx_crash_uart.S \ |
| 43 | drivers/imx/usdhc/imx_usdhc.c \ |
| 44 | lib/aarch32/arm32_aeabi_divmod.c \ |
| 45 | lib/aarch32/arm32_aeabi_divmod_a32.S \ |
| 46 | lib/cpus/aarch32/cortex_a7.S \ |
| 47 | lib/optee/optee_utils.c \ |
| 48 | plat/imx/common/imx_aips.c \ |
| 49 | plat/imx/common/imx_caam.c \ |
| 50 | plat/imx/common/imx_clock.c \ |
| 51 | plat/imx/common/imx_csu.c \ |
| 52 | plat/imx/common/imx_io_mux.c \ |
| 53 | plat/imx/common/imx_snvs.c \ |
| 54 | plat/imx/common/imx_wdog.c \ |
| 55 | plat/imx/common/imx7_clock.c \ |
| 56 | plat/imx/imx7/warp7/aarch32/warp7_helpers.S \ |
| 57 | plat/imx/imx7/warp7/warp7_bl2_el3_setup.c \ |
| 58 | plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c \ |
| 59 | plat/imx/imx7/warp7/warp7_io_storage.c \ |
| 60 | plat/imx/imx7/warp7/warp7_image_load.c \ |
Ying-Chun Liu (PaulLiu) | 26ca4f5 | 2019-02-12 18:33:04 +0800 | [diff] [blame] | 61 | plat/imx/common/aarch32/imx_uart_console.S \ |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 62 | ${XLAT_TABLES_LIB_SRCS} |
| 63 | |
Bryan O'Donoghue | 59ca2f6 | 2018-10-26 14:19:43 +0100 | [diff] [blame] | 64 | ifneq (${TRUSTED_BOARD_BOOT},0) |
| 65 | |
| 66 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 67 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 68 | |
| 69 | AUTH_SOURCES := drivers/auth/auth_mod.c \ |
| 70 | drivers/auth/crypto_mod.c \ |
| 71 | drivers/auth/img_parser_mod.c \ |
| 72 | drivers/auth/tbbr/tbbr_cot.c |
| 73 | |
| 74 | BL2_SOURCES += ${AUTH_SOURCES} \ |
| 75 | plat/common/tbbr/plat_tbbr.c \ |
| 76 | plat/imx/imx7/warp7/warp7_trusted_boot.c \ |
| 77 | plat/imx/imx7/warp7/warp7_rotpk.S |
| 78 | |
| 79 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 80 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 81 | |
| 82 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
| 83 | $(eval $(call MAKE_LIB_DIRS)) |
| 84 | |
| 85 | $(BUILD_PLAT)/bl2/warp7_rotpk.o: $(ROTPK_HASH) |
| 86 | |
| 87 | certificates: $(ROT_KEY) |
| 88 | |
| 89 | $(ROT_KEY): | $(BUILD_PLAT) |
| 90 | @echo " OPENSSL $@" |
| 91 | @if [ ! -f $(ROT_KEY) ]; then \ |
| 92 | openssl genrsa 2048 > $@ 2>/dev/null; \ |
| 93 | fi |
| 94 | |
| 95 | $(ROTPK_HASH): $(ROT_KEY) |
| 96 | @echo " OPENSSL $@" |
| 97 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 98 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 99 | endif |
| 100 | |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 101 | # Build config flags |
| 102 | # ------------------ |
| 103 | |
| 104 | WORKAROUND_CVE_2017_5715 := 0 |
| 105 | |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 106 | # Enable reset to BL31 by default |
| 107 | RESET_TO_BL31 := 0 |
| 108 | |
| 109 | # Non-TF Boot ROM |
| 110 | BL2_AT_EL3 := 1 |
| 111 | |
| 112 | # Indicate single-core |
| 113 | COLD_BOOT_SINGLE_CPU := 1 |
| 114 | |
| 115 | # Have different sections for code and rodata |
| 116 | SEPARATE_CODE_AND_RODATA := 1 |
| 117 | |
| 118 | # Use Coherent memory |
| 119 | USE_COHERENT_MEM := 1 |
| 120 | |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 121 | # PLAT_WARP7_UART |
| 122 | PLAT_WARP7_UART :=1 |
| 123 | $(eval $(call add_define,PLAT_WARP7_UART)) |
| 124 | |
Bryan O'Donoghue | 59ca2f6 | 2018-10-26 14:19:43 +0100 | [diff] [blame] | 125 | # Add the build options to pack BLx images and kernel device tree |
| 126 | # in the FIP if the platform requires. |
| 127 | ifneq ($(BL2),) |
| 128 | $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert)) |
| 129 | endif |
| 130 | ifneq ($(BL32_EXTRA1),) |
| 131 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1)) |
| 132 | endif |
| 133 | ifneq ($(BL32_EXTRA2),) |
| 134 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2)) |
| 135 | endif |
| 136 | ifneq ($(HW_CONFIG),) |
| 137 | $(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config)) |
| 138 | endif |
| 139 | |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 140 | # Verify build config |
| 141 | # ------------------- |
| 142 | |
Bryan O'Donoghue | 38c4561 | 2018-07-27 13:50:15 +0100 | [diff] [blame] | 143 | ifeq (${ARCH},aarch64) |
| 144 | $(error Error: AArch64 not supported on i.mx7) |
| 145 | endif |