Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 1 | # |
Masahiro Yamada | 2943c77 | 2020-01-17 13:45:32 +0900 | [diff] [blame] | 2 | # Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 7 | override BL2_AT_EL3 := 1 |
Masahiro Yamada | c9422fb | 2018-01-22 18:35:16 +0900 | [diff] [blame] | 8 | override COLD_BOOT_SINGLE_CPU := 1 |
Masahiro Yamada | c9422fb | 2018-01-22 18:35:16 +0900 | [diff] [blame] | 9 | override PROGRAMMABLE_RESET_ADDRESS := 1 |
| 10 | override USE_COHERENT_MEM := 1 |
Masahiro Yamada | c9422fb | 2018-01-22 18:35:16 +0900 | [diff] [blame] | 11 | override ENABLE_SVE_FOR_NS := 0 |
Masahiro Yamada | 542ed41 | 2020-01-17 13:46:48 +0900 | [diff] [blame] | 12 | |
| 13 | # Disabling ENABLE_PIE saves memory footprint a lot, but you need to adjust |
| 14 | # UNIPHIER_MEM_BASE so that all TF images are loaded at their link addresses. |
Masahiro Yamada | 2943c77 | 2020-01-17 13:45:32 +0900 | [diff] [blame] | 15 | override ENABLE_PIE := 1 |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 16 | |
| 17 | # Cortex-A53 revision r0p4-51rel0 |
| 18 | # needed for LD20, unneeded for LD11, PXs3 (no ACE) |
| 19 | ERRATA_A53_855873 := 1 |
| 20 | |
| 21 | FIP_ALIGN := 512 |
| 22 | |
| 23 | ifeq ($(NEED_BL32),yes) |
| 24 | $(eval $(call add_define,UNIPHIER_LOAD_BL32)) |
| 25 | endif |
| 26 | |
Douglas Raillard | 7dd775a | 2017-09-25 17:48:20 +0100 | [diff] [blame] | 27 | # Libraries |
| 28 | include lib/xlat_tables_v2/xlat_tables.mk |
| 29 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 30 | PLAT_PATH := plat/socionext/uniphier |
| 31 | PLAT_INCLUDES := -I$(PLAT_PATH)/include |
| 32 | |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 33 | # common sources for BL2, BL31 (and BL32 if SPD=tspd) |
Masahiro Yamada | ca8b80e | 2019-07-02 22:03:16 +0900 | [diff] [blame] | 34 | PLAT_BL_COMMON_SOURCES += plat/common/aarch64/crash_console_helpers.S \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 35 | $(PLAT_PATH)/uniphier_console.S \ |
Masahiro Yamada | ca8b80e | 2019-07-02 22:03:16 +0900 | [diff] [blame] | 36 | $(PLAT_PATH)/uniphier_console_setup.c \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 37 | $(PLAT_PATH)/uniphier_helpers.S \ |
| 38 | $(PLAT_PATH)/uniphier_soc_info.c \ |
Douglas Raillard | 7dd775a | 2017-09-25 17:48:20 +0100 | [diff] [blame] | 39 | $(PLAT_PATH)/uniphier_xlat_setup.c \ |
| 40 | ${XLAT_TABLES_LIB_SRCS} |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 41 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 42 | BL2_SOURCES += common/desc_image_load.c \ |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 43 | drivers/io/io_block.c \ |
| 44 | drivers/io/io_fip.c \ |
| 45 | drivers/io/io_memmap.c \ |
| 46 | drivers/io/io_storage.c \ |
| 47 | lib/cpus/aarch64/cortex_a53.S \ |
| 48 | lib/cpus/aarch64/cortex_a72.S \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 49 | $(PLAT_PATH)/uniphier_bl2_setup.c \ |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 50 | $(PLAT_PATH)/uniphier_boot_device.c \ |
| 51 | $(PLAT_PATH)/uniphier_emmc.c \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 52 | $(PLAT_PATH)/uniphier_image_desc.c \ |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 53 | $(PLAT_PATH)/uniphier_io_storage.c \ |
| 54 | $(PLAT_PATH)/uniphier_nand.c \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 55 | $(PLAT_PATH)/uniphier_scp.c \ |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 56 | $(PLAT_PATH)/uniphier_usb.c |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 57 | |
| 58 | BL31_SOURCES += drivers/arm/cci/cci.c \ |
| 59 | drivers/arm/gic/common/gic_common.c \ |
| 60 | drivers/arm/gic/v3/gicv3_helpers.c \ |
| 61 | drivers/arm/gic/v3/gicv3_main.c \ |
| 62 | lib/cpus/aarch64/cortex_a53.S \ |
| 63 | lib/cpus/aarch64/cortex_a72.S \ |
| 64 | plat/common/plat_gicv3.c \ |
| 65 | plat/common/plat_psci_common.c \ |
| 66 | $(PLAT_PATH)/uniphier_bl31_setup.c \ |
Masahiro Yamada | f36272d | 2019-07-08 13:46:44 +0900 | [diff] [blame] | 67 | $(PLAT_PATH)/uniphier_boot_device.c \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 68 | $(PLAT_PATH)/uniphier_cci.c \ |
| 69 | $(PLAT_PATH)/uniphier_gicv3.c \ |
| 70 | $(PLAT_PATH)/uniphier_psci.c \ |
| 71 | $(PLAT_PATH)/uniphier_scp.c \ |
| 72 | $(PLAT_PATH)/uniphier_smp.S \ |
| 73 | $(PLAT_PATH)/uniphier_syscnt.c \ |
| 74 | $(PLAT_PATH)/uniphier_topology.c |
| 75 | |
| 76 | ifeq (${TRUSTED_BOARD_BOOT},1) |
| 77 | |
| 78 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 79 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 80 | |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 81 | BL2_SOURCES += drivers/auth/auth_mod.c \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 82 | drivers/auth/crypto_mod.c \ |
| 83 | drivers/auth/img_parser_mod.c \ |
| 84 | drivers/auth/tbbr/tbbr_cot.c \ |
| 85 | plat/common/tbbr/plat_tbbr.c \ |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 86 | $(PLAT_PATH)/uniphier_rotpk.S \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 87 | $(PLAT_PATH)/uniphier_tbbr.c |
| 88 | |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 89 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 90 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 91 | |
| 92 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 93 | $(BUILD_PLAT)/bl2/uniphier_rotpk.o: $(ROTPK_HASH) |
| 94 | |
| 95 | certificates: $(ROT_KEY) |
Masahiro Yamada | df8fab9 | 2017-11-04 03:14:03 +0900 | [diff] [blame] | 96 | $(ROT_KEY): | $(BUILD_PLAT) |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 97 | @echo " OPENSSL $@" |
| 98 | $(Q)openssl genrsa 2048 > $@ 2>/dev/null |
| 99 | |
| 100 | $(ROTPK_HASH): $(ROT_KEY) |
| 101 | @echo " OPENSSL $@" |
| 102 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 103 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 104 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 105 | endif |
| 106 | |
Masahiro Yamada | 4ff71af | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 107 | ifeq (${FIP_GZIP},1) |
| 108 | |
| 109 | include lib/zlib/zlib.mk |
| 110 | |
| 111 | BL2_SOURCES += common/image_decompress.c \ |
| 112 | $(ZLIB_SOURCES) |
| 113 | |
| 114 | $(eval $(call add_define,UNIPHIER_DECOMPRESS_GZIP)) |
| 115 | |
| 116 | # compress all images loaded by BL2 |
| 117 | SCP_BL2_PRE_TOOL_FILTER := GZIP |
| 118 | BL31_PRE_TOOL_FILTER := GZIP |
| 119 | BL32_PRE_TOOL_FILTER := GZIP |
| 120 | BL33_PRE_TOOL_FILTER := GZIP |
| 121 | |
| 122 | endif |
| 123 | |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 124 | .PHONY: bl2_gzip |
| 125 | bl2_gzip: $(BUILD_PLAT)/bl2.bin.gz |
| 126 | %.gz: % |
Masahiro Yamada | e56b5cd | 2017-12-20 01:37:15 +0900 | [diff] [blame] | 127 | @echo " GZIP $@" |
Masahiro Yamada | b13af2e | 2018-01-04 12:59:11 +0900 | [diff] [blame] | 128 | $(Q)gzip -n -f -9 $< --stdout > $@ |