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