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