Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | override COLD_BOOT_SINGLE_CPU := 1 |
| 8 | override ENABLE_PLAT_COMPAT := 0 |
| 9 | override ERROR_DEPRECATED := 1 |
| 10 | override LOAD_IMAGE_V2 := 1 |
| 11 | override USE_COHERENT_MEM := 1 |
| 12 | override USE_TBBR_DEFS := 1 |
David Cunado | c5b0c0f | 2017-10-31 23:19:21 +0000 | [diff] [blame] | 13 | override ENABLE_SVE_FOR_NS := 0 |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 14 | |
| 15 | # Cortex-A53 revision r0p4-51rel0 |
| 16 | # needed for LD20, unneeded for LD11, PXs3 (no ACE) |
| 17 | ERRATA_A53_855873 := 1 |
| 18 | |
| 19 | FIP_ALIGN := 512 |
| 20 | |
| 21 | ifeq ($(NEED_BL32),yes) |
| 22 | $(eval $(call add_define,UNIPHIER_LOAD_BL32)) |
| 23 | endif |
| 24 | |
Douglas Raillard | 7dd775a | 2017-09-25 17:48:20 +0100 | [diff] [blame] | 25 | # Libraries |
| 26 | include lib/xlat_tables_v2/xlat_tables.mk |
| 27 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 28 | PLAT_PATH := plat/socionext/uniphier |
| 29 | PLAT_INCLUDES := -I$(PLAT_PATH)/include |
| 30 | |
| 31 | # IO sources for BL1, BL2 |
| 32 | IO_SOURCES := drivers/io/io_block.c \ |
| 33 | drivers/io/io_fip.c \ |
| 34 | drivers/io/io_memmap.c \ |
| 35 | drivers/io/io_storage.c \ |
| 36 | $(PLAT_PATH)/uniphier_boot_device.c \ |
| 37 | $(PLAT_PATH)/uniphier_emmc.c \ |
| 38 | $(PLAT_PATH)/uniphier_io_storage.c \ |
| 39 | $(PLAT_PATH)/uniphier_nand.c \ |
| 40 | $(PLAT_PATH)/uniphier_usb.c |
| 41 | |
| 42 | # common sources for BL1, BL2, BL31 |
| 43 | PLAT_BL_COMMON_SOURCES += drivers/console/aarch64/console.S \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 44 | $(PLAT_PATH)/uniphier_console.S \ |
| 45 | $(PLAT_PATH)/uniphier_helpers.S \ |
| 46 | $(PLAT_PATH)/uniphier_soc_info.c \ |
Douglas Raillard | 7dd775a | 2017-09-25 17:48:20 +0100 | [diff] [blame] | 47 | $(PLAT_PATH)/uniphier_xlat_setup.c \ |
| 48 | ${XLAT_TABLES_LIB_SRCS} |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 49 | |
| 50 | BL1_SOURCES += lib/cpus/aarch64/cortex_a53.S \ |
| 51 | lib/cpus/aarch64/cortex_a72.S \ |
| 52 | $(PLAT_PATH)/uniphier_bl1_helpers.S \ |
| 53 | $(PLAT_PATH)/uniphier_bl1_setup.c \ |
| 54 | $(IO_SOURCES) |
| 55 | |
| 56 | BL2_SOURCES += common/desc_image_load.c \ |
| 57 | $(PLAT_PATH)/uniphier_bl2_setup.c \ |
| 58 | $(PLAT_PATH)/uniphier_image_desc.c \ |
| 59 | $(PLAT_PATH)/uniphier_scp.c \ |
| 60 | $(IO_SOURCES) |
| 61 | |
| 62 | BL31_SOURCES += drivers/arm/cci/cci.c \ |
| 63 | drivers/arm/gic/common/gic_common.c \ |
| 64 | drivers/arm/gic/v3/gicv3_helpers.c \ |
| 65 | drivers/arm/gic/v3/gicv3_main.c \ |
| 66 | lib/cpus/aarch64/cortex_a53.S \ |
| 67 | lib/cpus/aarch64/cortex_a72.S \ |
| 68 | plat/common/plat_gicv3.c \ |
| 69 | plat/common/plat_psci_common.c \ |
| 70 | $(PLAT_PATH)/uniphier_bl31_setup.c \ |
| 71 | $(PLAT_PATH)/uniphier_cci.c \ |
| 72 | $(PLAT_PATH)/uniphier_gicv3.c \ |
| 73 | $(PLAT_PATH)/uniphier_psci.c \ |
| 74 | $(PLAT_PATH)/uniphier_scp.c \ |
| 75 | $(PLAT_PATH)/uniphier_smp.S \ |
| 76 | $(PLAT_PATH)/uniphier_syscnt.c \ |
| 77 | $(PLAT_PATH)/uniphier_topology.c |
| 78 | |
| 79 | ifeq (${TRUSTED_BOARD_BOOT},1) |
| 80 | |
| 81 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 82 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 83 | |
| 84 | PLAT_INCLUDES += -Iinclude/common/tbbr |
| 85 | |
| 86 | TBB_SOURCES := drivers/auth/auth_mod.c \ |
| 87 | drivers/auth/crypto_mod.c \ |
| 88 | drivers/auth/img_parser_mod.c \ |
| 89 | drivers/auth/tbbr/tbbr_cot.c \ |
| 90 | plat/common/tbbr/plat_tbbr.c \ |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 91 | $(PLAT_PATH)/uniphier_rotpk.S \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 92 | $(PLAT_PATH)/uniphier_tbbr.c |
| 93 | |
| 94 | BL1_SOURCES += $(TBB_SOURCES) |
| 95 | BL2_SOURCES += $(TBB_SOURCES) |
| 96 | |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 97 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 98 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 99 | |
| 100 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
| 101 | $(BUILD_PLAT)/bl1/uniphier_rotpk.o: $(ROTPK_HASH) |
| 102 | $(BUILD_PLAT)/bl2/uniphier_rotpk.o: $(ROTPK_HASH) |
| 103 | |
| 104 | certificates: $(ROT_KEY) |
Masahiro Yamada | df8fab9 | 2017-11-04 03:14:03 +0900 | [diff] [blame] | 105 | $(ROT_KEY): | $(BUILD_PLAT) |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 106 | @echo " OPENSSL $@" |
| 107 | $(Q)openssl genrsa 2048 > $@ 2>/dev/null |
| 108 | |
| 109 | $(ROTPK_HASH): $(ROT_KEY) |
| 110 | @echo " OPENSSL $@" |
| 111 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 112 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 113 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 114 | endif |
| 115 | |
| 116 | .PHONY: bl1_gzip |
| 117 | bl1_gzip: $(BUILD_PLAT)/bl1.bin.gzip |
| 118 | %.gzip: % |
Masahiro Yamada | e56b5cd | 2017-12-20 01:37:15 +0900 | [diff] [blame] | 119 | @echo " GZIP $@" |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 120 | $(Q)(cat $< | gzip -n -f -9 > $@) || (rm -f $@ || false) |