platform.mk 4.75 KB
Newer Older
1
#
2
# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3
4
5
6
#
# SPDX-License-Identifier: BSD-3-Clause
#

Haojian Zhuang's avatar
Haojian Zhuang committed
7
8
9
# Non-TF Boot ROM
BL2_AT_EL3	:=	1

10
# On Hikey960, the TSP can execute from TZC secure area in DRAM.
11
HIKEY960_TSP_RAM_LOCATION	?=	dram
12
13
14
ifeq (${HIKEY960_TSP_RAM_LOCATION}, dram)
  HIKEY960_TSP_RAM_LOCATION_ID = HIKEY960_DRAM_ID
else ifeq (${HIKEY960_TSP_RAM_LOCATION}, sram)
15
  HIKEY960_TSP_RAM_LOCATION_ID = HIKEY960_SRAM_ID
16
17
18
19
else
  $(error "Currently unsupported HIKEY960_TSP_RAM_LOCATION value")
endif

20
21
CRASH_CONSOLE_BASE		:=	PL011_UART6_BASE
COLD_BOOT_SINGLE_CPU		:=	1
22
PLAT_PL061_MAX_GPIOS		:=	176
23
PROGRAMMABLE_RESET_ADDRESS	:=	1
24
ENABLE_SVE_FOR_NS		:=	0
25
26

# Process flags
27
$(eval $(call add_define,HIKEY960_TSP_RAM_LOCATION_ID))
28
$(eval $(call add_define,CRASH_CONSOLE_BASE))
29
$(eval $(call add_define,PLAT_PL061_MAX_GPIOS))
30

31
32
33
# Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images
# in the FIP if the platform requires.
ifneq ($(BL32_EXTRA1),)
34
$(eval $(call TOOL_ADD_IMG,bl32_extra1,--tos-fw-extra1))
35
36
endif
ifneq ($(BL32_EXTRA2),)
37
$(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2))
38
39
endif

40
41
42
43
44
USE_COHERENT_MEM	:=	1

PLAT_INCLUDES		:=	-Iinclude/common/tbbr			\
				-Iplat/hisilicon/hikey960/include

45
PLAT_BL_COMMON_SOURCES	:=	drivers/arm/pl011/aarch64/pl011_console.S \
46
47
				drivers/delay_timer/delay_timer.c	\
				drivers/delay_timer/generic_delay_timer.c \
48
49
				lib/xlat_tables/aarch64/xlat_tables.c	\
				lib/xlat_tables/xlat_tables_common.c	\
50
51
52
53
54
55
56
57
58
				plat/hisilicon/hikey960/aarch64/hikey960_common.c \
				plat/hisilicon/hikey960/hikey960_boardid.c

HIKEY960_GIC_SOURCES	:=	drivers/arm/gic/common/gic_common.c	\
				drivers/arm/gic/v2/gicv2_main.c		\
				drivers/arm/gic/v2/gicv2_helpers.c	\
				plat/common/plat_gicv2.c

BL1_SOURCES		+=	bl1/tbbr/tbbr_img_desc.c		\
59
60
				drivers/arm/pl061/pl061_gpio.c		\
				drivers/gpio/gpio.c			\
61
62
63
64
65
66
67
				drivers/io/io_block.c			\
				drivers/io/io_fip.c			\
				drivers/io/io_storage.c			\
				drivers/synopsys/ufs/dw_ufs.c		\
				drivers/ufs/ufs.c 			\
				lib/cpus/aarch64/cortex_a53.S		\
				plat/hisilicon/hikey960/aarch64/hikey960_helpers.S \
68
69
				plat/hisilicon/hikey960/hikey960_bl1_setup.c \
				plat/hisilicon/hikey960/hikey960_bl_common.c \
70
71
				plat/hisilicon/hikey960/hikey960_io_storage.c \
				${HIKEY960_GIC_SOURCES}
Haojian Zhuang's avatar
Haojian Zhuang committed
72

Haojian Zhuang's avatar
Haojian Zhuang committed
73
BL2_SOURCES		+=	common/desc_image_load.c		\
74
75
				drivers/arm/pl061/pl061_gpio.c		\
				drivers/gpio/gpio.c			\
Haojian Zhuang's avatar
Haojian Zhuang committed
76
				drivers/io/io_block.c			\
Haojian Zhuang's avatar
Haojian Zhuang committed
77
78
				drivers/io/io_fip.c			\
				drivers/io/io_storage.c			\
Haojian Zhuang's avatar
Haojian Zhuang committed
79
				drivers/synopsys/ufs/dw_ufs.c		\
Haojian Zhuang's avatar
Haojian Zhuang committed
80
				drivers/ufs/ufs.c			\
Haojian Zhuang's avatar
Haojian Zhuang committed
81
82
				lib/cpus/aarch64/cortex_a53.S		\
				plat/hisilicon/hikey960/aarch64/hikey960_helpers.S \
Haojian Zhuang's avatar
Haojian Zhuang committed
83
				plat/hisilicon/hikey960/hikey960_bl2_mem_params_desc.c \
Haojian Zhuang's avatar
Haojian Zhuang committed
84
				plat/hisilicon/hikey960/hikey960_bl2_setup.c \
85
				plat/hisilicon/hikey960/hikey960_bl_common.c \
Haojian Zhuang's avatar
Haojian Zhuang committed
86
				plat/hisilicon/hikey960/hikey960_image_load.c \
Haojian Zhuang's avatar
Haojian Zhuang committed
87
88
				plat/hisilicon/hikey960/hikey960_io_storage.c \
				plat/hisilicon/hikey960/hikey960_mcu_load.c
Haojian Zhuang's avatar
Haojian Zhuang committed
89

90
91
92
ifeq (${SPD},opteed)
BL2_SOURCES		+=	lib/optee/optee_utils.c
endif
93

Haojian Zhuang's avatar
Haojian Zhuang committed
94
95
96
97
BL31_SOURCES		+=	drivers/arm/cci/cci.c			\
				lib/cpus/aarch64/cortex_a53.S           \
				lib/cpus/aarch64/cortex_a72.S		\
				lib/cpus/aarch64/cortex_a73.S		\
98
				plat/common/plat_psci_common.c  \
Haojian Zhuang's avatar
Haojian Zhuang committed
99
100
101
102
103
104
105
				plat/hisilicon/hikey960/aarch64/hikey960_helpers.S \
				plat/hisilicon/hikey960/hikey960_bl31_setup.c \
				plat/hisilicon/hikey960/hikey960_pm.c	\
				plat/hisilicon/hikey960/hikey960_topology.c \
				plat/hisilicon/hikey960/drivers/pwrc/hisi_pwrc.c \
				plat/hisilicon/hikey960/drivers/ipc/hisi_ipc.c \
				${HIKEY960_GIC_SOURCES}
106

107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
ifneq (${TRUSTED_BOARD_BOOT},0)

include drivers/auth/mbedtls/mbedtls_crypto.mk
include drivers/auth/mbedtls/mbedtls_x509.mk

AUTH_SOURCES		:=	drivers/auth/auth_mod.c			\
				drivers/auth/crypto_mod.c		\
				drivers/auth/img_parser_mod.c		\
				drivers/auth/tbbr/tbbr_cot.c

BL1_SOURCES		+=	${AUTH_SOURCES}				\
				plat/common/tbbr/plat_tbbr.c		\
				plat/hisilicon/hikey960/hikey960_tbbr.c	\
				plat/hisilicon/hikey960/hikey960_rotpk.S

BL2_SOURCES		+=	${AUTH_SOURCES}				\
				plat/common/tbbr/plat_tbbr.c		\
				plat/hisilicon/hikey960/hikey960_tbbr.c	\
				plat/hisilicon/hikey960/hikey960_rotpk.S

ROT_KEY		=	$(BUILD_PLAT)/rot_key.pem
ROTPK_HASH		=	$(BUILD_PLAT)/rotpk_sha256.bin

$(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"'))
$(BUILD_PLAT)/bl1/hikey960_rotpk.o: $(ROTPK_HASH)
$(BUILD_PLAT)/bl2/hikey960_rotpk.o: $(ROTPK_HASH)

certificates: $(ROT_KEY)
$(ROT_KEY): | $(BUILD_PLAT)
	@echo "  OPENSSL $@"
	$(Q)openssl genrsa 2048 > $@ 2>/dev/null

$(ROTPK_HASH): $(ROT_KEY)
	@echo "  OPENSSL $@"
	$(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\
	openssl dgst -sha256 -binary > $@ 2>/dev/null
endif

145
146
147
148
# Enable workarounds for selected Cortex-A53 errata.
ERRATA_A53_836870		:=	1
ERRATA_A53_843419		:=	1
ERRATA_A53_855873		:=	1
149
150

FIP_ALIGN			:=	512