Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 1 | # |
Manish V Badarkhe | 043fd62 | 2020-05-16 16:36:39 +0100 | [diff] [blame] | 2 | # Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [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 | TF_CFLAGS += -mfpu=neon |
| 11 | ASFLAGS += -mfpu=neon |
| 12 | |
| 13 | # Platform |
| 14 | PLAT_INCLUDES := -Idrivers/imx/uart \ |
| 15 | -Iplat/imx/common/include \ |
| 16 | -Iplat/imx/imx7/include \ |
| 17 | -Idrivers/imx/timer \ |
| 18 | -Idrivers/imx/usdhc \ |
Ying-Chun Liu (PaulLiu) | 54cabc4 | 2021-04-07 06:10:32 +0800 | [diff] [blame] | 19 | -Iinclude/common/tbbr |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 20 | |
| 21 | # Translation tables library |
| 22 | include lib/xlat_tables_v2/xlat_tables.mk |
| 23 | |
| 24 | BL2_SOURCES += common/desc_image_load.c \ |
| 25 | drivers/delay_timer/delay_timer.c \ |
| 26 | drivers/mmc/mmc.c \ |
| 27 | drivers/io/io_block.c \ |
| 28 | drivers/io/io_fip.c \ |
| 29 | drivers/io/io_memmap.c \ |
| 30 | drivers/io/io_storage.c \ |
| 31 | drivers/imx/timer/imx_gpt.c \ |
| 32 | drivers/imx/uart/imx_uart.c \ |
| 33 | drivers/imx/uart/imx_crash_uart.S \ |
| 34 | lib/aarch32/arm32_aeabi_divmod.c \ |
| 35 | lib/aarch32/arm32_aeabi_divmod_a32.S \ |
| 36 | lib/cpus/aarch32/cortex_a7.S \ |
| 37 | lib/optee/optee_utils.c \ |
| 38 | plat/imx/common/imx_aips.c \ |
| 39 | plat/imx/common/imx_caam.c \ |
| 40 | plat/imx/common/imx_clock.c \ |
| 41 | plat/imx/common/imx_csu.c \ |
| 42 | plat/imx/common/imx_io_mux.c \ |
| 43 | plat/imx/common/imx_snvs.c \ |
| 44 | plat/imx/common/imx_wdog.c \ |
| 45 | plat/imx/common/imx7_clock.c \ |
| 46 | plat/imx/imx7/common/imx7_bl2_mem_params_desc.c \ |
| 47 | plat/imx/imx7/common/imx7_bl2_el3_common.c \ |
| 48 | plat/imx/imx7/common/imx7_helpers.S \ |
| 49 | plat/imx/imx7/common/imx7_image_load.c \ |
Ying-Chun Liu (PaulLiu) | 54cabc4 | 2021-04-07 06:10:32 +0800 | [diff] [blame] | 50 | plat/imx/common/imx_io_storage.c \ |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 51 | plat/imx/common/aarch32/imx_uart_console.S \ |
| 52 | ${XLAT_TABLES_LIB_SRCS} |
| 53 | |
| 54 | ifneq (${TRUSTED_BOARD_BOOT},0) |
| 55 | |
| 56 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 57 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 58 | |
| 59 | AUTH_SOURCES := drivers/auth/auth_mod.c \ |
| 60 | drivers/auth/crypto_mod.c \ |
| 61 | drivers/auth/img_parser_mod.c \ |
Manish V Badarkhe | 043fd62 | 2020-05-16 16:36:39 +0100 | [diff] [blame] | 62 | drivers/auth/tbbr/tbbr_cot_common.c |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 63 | |
| 64 | BL2_SOURCES += ${AUTH_SOURCES} \ |
| 65 | plat/common/tbbr/plat_tbbr.c \ |
| 66 | plat/imx/imx7/common/imx7_trusted_boot.c \ |
Manish V Badarkhe | 043fd62 | 2020-05-16 16:36:39 +0100 | [diff] [blame] | 67 | plat/imx/imx7/common/imx7_rotpk.S \ |
| 68 | drivers/auth/tbbr/tbbr_cot_bl2.c |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 69 | |
| 70 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 71 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 72 | |
| 73 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
| 74 | $(eval $(call MAKE_LIB_DIRS)) |
| 75 | |
| 76 | $(BUILD_PLAT)/bl2/imx7_rotpk.o: $(ROTPK_HASH) |
| 77 | |
| 78 | certificates: $(ROT_KEY) |
| 79 | |
| 80 | $(ROT_KEY): | $(BUILD_PLAT) |
| 81 | @echo " OPENSSL $@" |
| 82 | @if [ ! -f $(ROT_KEY) ]; then \ |
| 83 | openssl genrsa 2048 > $@ 2>/dev/null; \ |
| 84 | fi |
| 85 | |
| 86 | $(ROTPK_HASH): $(ROT_KEY) |
| 87 | @echo " OPENSSL $@" |
| 88 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 89 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 90 | endif |
| 91 | |
| 92 | # Add the build options to pack BLx images and kernel device tree |
| 93 | # in the FIP if the platform requires. |
| 94 | ifneq ($(BL2),) |
| 95 | $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert)) |
| 96 | endif |
| 97 | ifneq ($(BL32_EXTRA1),) |
| 98 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1)) |
| 99 | endif |
| 100 | ifneq ($(BL32_EXTRA2),) |
| 101 | $(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2)) |
| 102 | endif |
| 103 | ifneq ($(HW_CONFIG),) |
| 104 | $(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config)) |
| 105 | endif |
| 106 | |
| 107 | # Verify build config |
| 108 | # ------------------- |
| 109 | |
| 110 | ifeq (${ARCH},aarch64) |
| 111 | $(error Error: AArch64 not supported on i.mx7) |
| 112 | endif |