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 | |
| 24 | PLAT_PATH := plat/socionext/uniphier |
| 25 | PLAT_INCLUDES := -I$(PLAT_PATH)/include |
| 26 | |
| 27 | # IO sources for BL1, BL2 |
| 28 | IO_SOURCES := drivers/io/io_block.c \ |
| 29 | drivers/io/io_fip.c \ |
| 30 | drivers/io/io_memmap.c \ |
| 31 | drivers/io/io_storage.c \ |
| 32 | $(PLAT_PATH)/uniphier_boot_device.c \ |
| 33 | $(PLAT_PATH)/uniphier_emmc.c \ |
| 34 | $(PLAT_PATH)/uniphier_io_storage.c \ |
| 35 | $(PLAT_PATH)/uniphier_nand.c \ |
| 36 | $(PLAT_PATH)/uniphier_usb.c |
| 37 | |
| 38 | # common sources for BL1, BL2, BL31 |
| 39 | PLAT_BL_COMMON_SOURCES += drivers/console/aarch64/console.S \ |
| 40 | lib/xlat_tables_v2/aarch64/xlat_tables_arch.c \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 41 | lib/xlat_tables_v2/xlat_tables_internal.c \ |
| 42 | $(PLAT_PATH)/uniphier_console.S \ |
| 43 | $(PLAT_PATH)/uniphier_helpers.S \ |
| 44 | $(PLAT_PATH)/uniphier_soc_info.c \ |
| 45 | $(PLAT_PATH)/uniphier_xlat_setup.c |
| 46 | |
| 47 | BL1_SOURCES += lib/cpus/aarch64/cortex_a53.S \ |
| 48 | lib/cpus/aarch64/cortex_a72.S \ |
| 49 | $(PLAT_PATH)/uniphier_bl1_helpers.S \ |
| 50 | $(PLAT_PATH)/uniphier_bl1_setup.c \ |
| 51 | $(IO_SOURCES) |
| 52 | |
| 53 | BL2_SOURCES += common/desc_image_load.c \ |
| 54 | $(PLAT_PATH)/uniphier_bl2_setup.c \ |
| 55 | $(PLAT_PATH)/uniphier_image_desc.c \ |
| 56 | $(PLAT_PATH)/uniphier_scp.c \ |
| 57 | $(IO_SOURCES) |
| 58 | |
| 59 | BL31_SOURCES += drivers/arm/cci/cci.c \ |
| 60 | drivers/arm/gic/common/gic_common.c \ |
| 61 | drivers/arm/gic/v3/gicv3_helpers.c \ |
| 62 | drivers/arm/gic/v3/gicv3_main.c \ |
| 63 | lib/cpus/aarch64/cortex_a53.S \ |
| 64 | lib/cpus/aarch64/cortex_a72.S \ |
| 65 | plat/common/plat_gicv3.c \ |
| 66 | plat/common/plat_psci_common.c \ |
| 67 | $(PLAT_PATH)/uniphier_bl31_setup.c \ |
| 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 | |
| 81 | PLAT_INCLUDES += -Iinclude/common/tbbr |
| 82 | |
| 83 | TBB_SOURCES := drivers/auth/auth_mod.c \ |
| 84 | drivers/auth/crypto_mod.c \ |
| 85 | drivers/auth/img_parser_mod.c \ |
| 86 | drivers/auth/tbbr/tbbr_cot.c \ |
| 87 | plat/common/tbbr/plat_tbbr.c \ |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 88 | $(PLAT_PATH)/uniphier_rotpk.S \ |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 89 | $(PLAT_PATH)/uniphier_tbbr.c |
| 90 | |
| 91 | BL1_SOURCES += $(TBB_SOURCES) |
| 92 | BL2_SOURCES += $(TBB_SOURCES) |
| 93 | |
Masahiro Yamada | 9679c9c | 2017-06-14 20:38:12 +0900 | [diff] [blame] | 94 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 95 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 96 | |
| 97 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
| 98 | $(BUILD_PLAT)/bl1/uniphier_rotpk.o: $(ROTPK_HASH) |
| 99 | $(BUILD_PLAT)/bl2/uniphier_rotpk.o: $(ROTPK_HASH) |
| 100 | |
| 101 | certificates: $(ROT_KEY) |
| 102 | $(ROT_KEY): |
| 103 | @echo " OPENSSL $@" |
| 104 | $(Q)openssl genrsa 2048 > $@ 2>/dev/null |
| 105 | |
| 106 | $(ROTPK_HASH): $(ROT_KEY) |
| 107 | @echo " OPENSSL $@" |
| 108 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 109 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 110 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 111 | endif |
| 112 | |
| 113 | .PHONY: bl1_gzip |
| 114 | bl1_gzip: $(BUILD_PLAT)/bl1.bin.gzip |
| 115 | %.gzip: % |
| 116 | @echo " GZIP $@" |
| 117 | $(Q)(cat $< | gzip -n -f -9 > $@) || (rm -f $@ || false) |