blob: c91abb6be6bd7b9897241da3ecee052a38fc68a8 [file] [log] [blame]
Masahiro Yamada574388c2016-09-03 11:37:40 +09001#
2# Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7override COLD_BOOT_SINGLE_CPU := 1
8override ENABLE_PLAT_COMPAT := 0
9override ERROR_DEPRECATED := 1
10override LOAD_IMAGE_V2 := 1
11override USE_COHERENT_MEM := 1
12override USE_TBBR_DEFS := 1
13
14# Cortex-A53 revision r0p4-51rel0
15# needed for LD20, unneeded for LD11, PXs3 (no ACE)
16ERRATA_A53_855873 := 1
17
18FIP_ALIGN := 512
19
20ifeq ($(NEED_BL32),yes)
21$(eval $(call add_define,UNIPHIER_LOAD_BL32))
22endif
23
Douglas Raillard7dd775a2017-09-25 17:48:20 +010024# Libraries
25include lib/xlat_tables_v2/xlat_tables.mk
26
Masahiro Yamada574388c2016-09-03 11:37:40 +090027PLAT_PATH := plat/socionext/uniphier
28PLAT_INCLUDES := -I$(PLAT_PATH)/include
29
30# IO sources for BL1, BL2
31IO_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
42PLAT_BL_COMMON_SOURCES += drivers/console/aarch64/console.S \
Masahiro Yamada574388c2016-09-03 11:37:40 +090043 $(PLAT_PATH)/uniphier_console.S \
44 $(PLAT_PATH)/uniphier_helpers.S \
45 $(PLAT_PATH)/uniphier_soc_info.c \
Douglas Raillard7dd775a2017-09-25 17:48:20 +010046 $(PLAT_PATH)/uniphier_xlat_setup.c \
47 ${XLAT_TABLES_LIB_SRCS}
Masahiro Yamada574388c2016-09-03 11:37:40 +090048
49BL1_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
55BL2_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
61BL31_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
78ifeq (${TRUSTED_BOARD_BOOT},1)
79
80include drivers/auth/mbedtls/mbedtls_crypto.mk
81include drivers/auth/mbedtls/mbedtls_x509.mk
82
83PLAT_INCLUDES += -Iinclude/common/tbbr
84
85TBB_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 Yamada9679c9c2017-06-14 20:38:12 +090090 $(PLAT_PATH)/uniphier_rotpk.S \
Masahiro Yamada574388c2016-09-03 11:37:40 +090091 $(PLAT_PATH)/uniphier_tbbr.c
92
93BL1_SOURCES += $(TBB_SOURCES)
94BL2_SOURCES += $(TBB_SOURCES)
95
Masahiro Yamada9679c9c2017-06-14 20:38:12 +090096ROT_KEY = $(BUILD_PLAT)/rot_key.pem
97ROTPK_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
103certificates: $(ROT_KEY)
Masahiro Yamadadf8fab92017-11-04 03:14:03 +0900104$(ROT_KEY): | $(BUILD_PLAT)
Masahiro Yamada9679c9c2017-06-14 20:38:12 +0900105 @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 Yamada574388c2016-09-03 11:37:40 +0900113endif
114
115.PHONY: bl1_gzip
116bl1_gzip: $(BUILD_PLAT)/bl1.bin.gzip
117%.gzip: %
118 @echo " GZIP $@"
119 $(Q)(cat $< | gzip -n -f -9 > $@) || (rm -f $@ || false)