xref: /rk3399_ARM-atf/plat/hisilicon/poplar/platform.mk (revision 6f7dba4b24ee8e6c134a5237b5af461c9898501e)
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
49MULTI_CONSOLE_API		:= 1
50WORKAROUND_CVE_2017_5715	:= 0
51
52PLAT_PL061_MAX_GPIOS 		:= 104
53$(eval $(call add_define,PLAT_PL061_MAX_GPIOS))
54
55PLAT_INCLUDES	:=	-Iplat/hisilicon/poplar/include		\
56			-Iplat/hisilicon/poplar			\
57			-Iinclude/common/tbbr			\
58			-Iinclude/drivers/synopsys		\
59			-Iinclude/drivers/io
60
61PLAT_BL_COMMON_SOURCES	:=						\
62		lib/xlat_tables/aarch64/xlat_tables.c			\
63		lib/xlat_tables/xlat_tables_common.c			\
64		drivers/delay_timer/generic_delay_timer.c		\
65		drivers/arm/gic/common/gic_common.c			\
66		drivers/arm/gic/v2/gicv2_helpers.c			\
67		drivers/delay_timer/delay_timer.c			\
68		drivers/arm/pl011/aarch64/pl011_console.S		\
69		drivers/arm/gic/v2/gicv2_main.c				\
70		plat/common/plat_gicv2.c				\
71		plat/hisilicon/poplar/aarch64/platform_common.c		\
72		plat/hisilicon/poplar/aarch64/poplar_helpers.S		\
73		plat/hisilicon/poplar/poplar_gicv2.c
74
75BL1_SOURCES	+=							\
76		lib/cpus/aarch64/cortex_a53.S				\
77		drivers/arm/pl061/pl061_gpio.c				\
78		drivers/mmc/mmc.c					\
79		drivers/synopsys/emmc/dw_mmc.c				\
80		drivers/io/io_storage.c					\
81		drivers/io/io_block.c					\
82		drivers/gpio/gpio.c					\
83		drivers/io/io_fip.c					\
84		drivers/io/io_memmap.c					\
85		plat/hisilicon/poplar/bl1_plat_setup.c			\
86		plat/hisilicon/poplar/plat_storage.c
87
88BL2_SOURCES	+=      						\
89		drivers/arm/pl061/pl061_gpio.c				\
90		drivers/mmc/mmc.c					\
91		drivers/synopsys/emmc/dw_mmc.c				\
92		drivers/io/io_storage.c					\
93		drivers/io/io_block.c					\
94		drivers/io/io_fip.c					\
95		drivers/gpio/gpio.c					\
96		drivers/io/io_memmap.c					\
97		plat/hisilicon/poplar/bl2_plat_setup.c			\
98		plat/hisilicon/poplar/plat_storage.c
99
100BL2_SOURCES	+=							\
101		plat/hisilicon/poplar/bl2_plat_mem_params_desc.c	\
102		plat/hisilicon/poplar/poplar_image_load.c		\
103		common/desc_image_load.c
104
105ifeq (${SPD},opteed)
106BL2_SOURCES	+=							\
107		lib/optee/optee_utils.c
108endif
109
110BL31_SOURCES	+=							\
111		lib/cpus/aarch64/aem_generic.S				\
112		lib/cpus/aarch64/cortex_a53.S				\
113		plat/common/plat_psci_common.c			\
114		plat/hisilicon/poplar/bl31_plat_setup.c			\
115		plat/hisilicon/poplar/plat_topology.c			\
116		plat/hisilicon/poplar/plat_pm.c
117