xref: /rk3399_ARM-atf/plat/arm/board/a5ds/platform.mk (revision 1fa05dab070274eede406a5c33bb00b4c5a81fd0)
1#
2# Copyright (c) 2019-2021, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Firmware Configuration Framework sources
8include common/fdt_wrappers.mk
9include lib/fconf/fconf.mk
10
11# Add `libfdt` and Arm common helpers required for Dynamic Config
12include lib/libfdt/libfdt.mk
13
14DYN_CFG_SOURCES		+=	plat/arm/common/arm_dyn_cfg.c		\
15				plat/arm/common/arm_dyn_cfg_helpers.c
16
17DYN_CFG_SOURCES		+=	${FDT_WRAPPERS_SOURCES}
18
19# Include GICv2 driver files
20include drivers/arm/gic/v2/gicv2.mk
21
22A5DS_GIC_SOURCES	:=	${GICV2_SOURCES}			\
23				plat/common/plat_gicv2.c		\
24				plat/arm/common/arm_gicv2.c
25
26A5DS_SECURITY_SOURCES	:=	plat/arm/board/a5ds/a5ds_security.c
27
28PLAT_INCLUDES		:=	-Iplat/arm/board/a5ds/include
29
30PLAT_BL_COMMON_SOURCES	:=	drivers/arm/pl011/${ARCH}/pl011_console.S	\
31				plat/arm/board/a5ds/a5ds_common.c		\
32				plat/arm/common/${ARCH}/arm_helpers.S		\
33				plat/arm/common/arm_common.c			\
34				plat/arm/common/arm_console.c			\
35				plat/arm/board/common/${ARCH}/board_arm_helpers.S
36
37A5DS_CPU_LIBS		:=	lib/cpus/aarch32/cortex_a5.S
38
39BL1_SOURCES		+=	drivers/io/io_fip.c				\
40				drivers/io/io_memmap.c				\
41				drivers/io/io_storage.c				\
42				drivers/cfi/v2m/v2m_flash.c			\
43				plat/arm/common/arm_bl1_setup.c			\
44				plat/arm/common/arm_err.c			\
45				plat/arm/board/a5ds/a5ds_err.c			\
46				plat/arm/common/arm_io_storage.c		\
47				plat/arm/common/fconf/arm_fconf_io.c		\
48				plat/arm/board/a5ds/${ARCH}/a5ds_helpers.S	\
49				plat/arm/board/a5ds/a5ds_bl1_setup.c		\
50				lib/aarch32/arm32_aeabi_divmod.c		\
51				lib/aarch32/arm32_aeabi_divmod_a32.S		\
52				${A5DS_CPU_LIBS}				\
53				${DYN_CFG_SOURCES}
54
55BL2_SOURCES		+=	lib/aarch32/arm32_aeabi_divmod.c		\
56				lib/aarch32/arm32_aeabi_divmod_a32.S		\
57				drivers/delay_timer/delay_timer.c		\
58				drivers/delay_timer/generic_delay_timer.c	\
59				drivers/cfi/v2m/v2m_flash.c			\
60				drivers/io/io_fip.c				\
61				drivers/io/io_memmap.c				\
62				drivers/io/io_storage.c				\
63				plat/arm/board/a5ds/a5ds_bl2_setup.c		\
64				plat/arm/common/arm_bl2_setup.c			\
65				plat/arm/common/arm_err.c			\
66				plat/arm/board/a5ds/a5ds_err.c			\
67				plat/arm/common/arm_io_storage.c		\
68				plat/arm/common/fconf/arm_fconf_io.c		\
69				plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c	\
70				plat/arm/common/arm_image_load.c		\
71				common/desc_image_load.c			\
72				${DYN_CFG_SOURCES}				\
73				${A5DS_SECURITY_SOURCES}
74
75# Add the FDT_SOURCES and options for Dynamic Config (only for Unix env)
76ifdef UNIX_MK
77
78FW_CONFIG	:=      ${BUILD_PLAT}/fdts/a5ds_fw_config.dtb
79TB_FW_CONFIG	:=	${BUILD_PLAT}/fdts/a5ds_tb_fw_config.dtb
80
81# Add the TB_FW_CONFIG to FIP and specify the same to certtool
82$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
83# Add the FW_CONFIG to FIP and specify the same to certtool
84$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
85
86$(eval FVP_HW_CONFIG	:=	${BUILD_PLAT}/$(patsubst %.dts,%.dtb, \
87	fdts/$(notdir ${FVP_HW_CONFIG_DTS})))
88# Add the HW_CONFIG to FIP and specify the same to certtool
89$(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG}))
90
91FDT_SOURCES		+=	plat/arm/board/a5ds/fdts/a5ds_fw_config.dts \
92				plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts \
93					${FVP_HW_CONFIG_DTS}
94endif
95
96NEED_BL32 := yes
97
98MULTI_CONSOLE_API		:=	1
99
100PLAT_BL_COMMON_SOURCES	+=	lib/xlat_tables/aarch32/nonlpae_tables.c
101
102# Use translation tables library v1 when using Cortex-A5
103ARM_XLAT_TABLES_LIB_V1		:=	1
104$(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1))
105$(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1))
106
107$(eval $(call assert_boolean,ARM_DISABLE_TRUSTED_WDOG))
108$(eval $(call add_define,ARM_DISABLE_TRUSTED_WDOG))
109