1#
2# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# On Poplar, the TSP can execute from TZC secure area in DRAM.
8POPLAR_TSP_RAM_LOCATION	?=	dram
9ifeq (${POPLAR_TSP_RAM_LOCATION}, dram)
10  POPLAR_TSP_RAM_LOCATION_ID = POPLAR_DRAM_ID
11else ifeq (${POPLAR_TSP_RAM_LOCATION}, sram)
12  POPLAR_TSP_RAM_LOCATION_ID = POPLAR_SRAM_ID
13else
14  $(error "Currently unsupported POPLAR_TSP_RAM_LOCATION value")
15endif
16$(eval $(call add_define,POPLAR_TSP_RAM_LOCATION_ID))
17
18POPLAR_DRAM_SIZE ?= two_gig
19ifeq (${POPLAR_DRAM_SIZE}, two_gig)
20  POPLAR_DRAM_SIZE_ID = POPLAR_DRAM_SIZE_2G
21else ifeq (${POPLAR_DRAM_SIZE}, one_gig)
22  POPLAR_DRAM_SIZE_ID = POPLAR_DRAM_SIZE_1G
23else
24  $(error "Currently unsupported POPLAR_DRAM_SIZE value")
25endif
26$(eval $(call add_define,POPLAR_DRAM_SIZE_ID))
27
28POPLAR_RECOVERY		:= 0
29$(eval $(call add_define,POPLAR_RECOVERY))
30
31# Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images
32# in the FIP if the platform requires.
33ifneq ($(BL32_EXTRA1),)
34$(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1))
35endif
36ifneq ($(BL32_EXTRA2),)
37$(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2))
38endif
39
40NEED_BL33			:= yes
41
42COLD_BOOT_SINGLE_CPU		:= 1
43PROGRAMMABLE_RESET_ADDRESS	:= 1
44CTX_INCLUDE_FPREGS		:= 1
45ERRATA_A53_855873		:= 1
46ERRATA_A53_835769		:= 1
47ERRATA_A53_843419		:= 1
48ENABLE_SVE_FOR_NS		:= 0
49WORKAROUND_CVE_2017_5715	:= 0
50
51PLAT_PL061_MAX_GPIOS 		:= 104
52$(eval $(call add_define,PLAT_PL061_MAX_GPIOS))
53
54PLAT_INCLUDES	:=	-Iplat/hisilicon/poplar/include		\
55			-Iplat/hisilicon/poplar
56
57PLAT_BL_COMMON_SOURCES	:=						\
58		lib/xlat_tables/aarch64/xlat_tables.c			\
59		lib/xlat_tables/xlat_tables_common.c			\
60		drivers/delay_timer/generic_delay_timer.c		\
61		drivers/arm/gic/common/gic_common.c			\
62		drivers/arm/gic/v2/gicv2_helpers.c			\
63		drivers/delay_timer/delay_timer.c			\
64		drivers/arm/pl011/aarch64/pl011_console.S		\
65		drivers/arm/gic/v2/gicv2_main.c				\
66		plat/common/plat_gicv2.c				\
67		plat/hisilicon/poplar/aarch64/platform_common.c		\
68		plat/hisilicon/poplar/aarch64/poplar_helpers.S		\
69		plat/hisilicon/poplar/poplar_gicv2.c
70
71BL1_SOURCES	+=							\
72		lib/cpus/aarch64/cortex_a53.S				\
73		drivers/arm/pl061/pl061_gpio.c				\
74		drivers/mmc/mmc.c					\
75		drivers/synopsys/emmc/dw_mmc.c				\
76		drivers/io/io_storage.c					\
77		drivers/io/io_block.c					\
78		drivers/gpio/gpio.c					\
79		drivers/io/io_fip.c					\
80		drivers/io/io_memmap.c					\
81		plat/hisilicon/poplar/bl1_plat_setup.c			\
82		plat/hisilicon/poplar/plat_storage.c
83
84BL2_SOURCES	+=      						\
85		drivers/arm/pl061/pl061_gpio.c				\
86		drivers/mmc/mmc.c					\
87		drivers/synopsys/emmc/dw_mmc.c				\
88		drivers/io/io_storage.c					\
89		drivers/io/io_block.c					\
90		drivers/io/io_fip.c					\
91		drivers/gpio/gpio.c					\
92		drivers/io/io_memmap.c					\
93		plat/hisilicon/poplar/bl2_plat_setup.c			\
94		plat/hisilicon/poplar/plat_storage.c
95
96BL2_SOURCES	+=							\
97		plat/hisilicon/poplar/bl2_plat_mem_params_desc.c	\
98		plat/hisilicon/poplar/poplar_image_load.c		\
99		common/desc_image_load.c
100
101ifeq (${SPD},opteed)
102BL2_SOURCES	+=							\
103		lib/optee/optee_utils.c
104endif
105
106BL31_SOURCES	+=							\
107		lib/cpus/aarch64/aem_generic.S				\
108		lib/cpus/aarch64/cortex_a53.S				\
109		plat/common/plat_psci_common.c			\
110		plat/hisilicon/poplar/bl31_plat_setup.c			\
111		plat/hisilicon/poplar/plat_topology.c			\
112		plat/hisilicon/poplar/plat_pm.c
113