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