blob: 26218a4074fb19843babfe1130dc750802421ae0 [file] [log] [blame]
Haojian Zhuang5f281b32017-05-24 08:45:05 +08001#
2# Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Victor Chong2d9a42d2017-08-17 15:21:10 +09007# Enable version2 of image loading
8LOAD_IMAGE_V2 := 1
9
Victor Chongb9a8db22017-05-28 00:14:25 +090010# On Hikey, the TSP can execute from TZC secure area in DRAM (default)
11# or SRAM.
12HIKEY_TSP_RAM_LOCATION := dram
13ifeq (${HIKEY_TSP_RAM_LOCATION}, dram)
14 HIKEY_TSP_RAM_LOCATION_ID = HIKEY_DRAM_ID
15else ifeq (${HIKEY_TSP_RAM_LOCATION}, sram)
16 HIKEY_TSP_RAM_LOCATION_ID := HIKEY_SRAM_ID
17else
18 $(error "Currently unsupported HIKEY_TSP_RAM_LOCATION value")
19endif
20
Haojian Zhuang5f281b32017-05-24 08:45:05 +080021CONSOLE_BASE := PL011_UART3_BASE
22CRASH_CONSOLE_BASE := PL011_UART3_BASE
Haojian Zhuang934ae712017-05-24 08:47:49 +080023PLAT_PARTITION_MAX_ENTRIES := 12
Haojian Zhuang5f281b32017-05-24 08:45:05 +080024PLAT_PL061_MAX_GPIOS := 160
25COLD_BOOT_SINGLE_CPU := 1
26PROGRAMMABLE_RESET_ADDRESS := 1
27
28# Process flags
Victor Chongb9a8db22017-05-28 00:14:25 +090029$(eval $(call add_define,HIKEY_TSP_RAM_LOCATION_ID))
Haojian Zhuang5f281b32017-05-24 08:45:05 +080030$(eval $(call add_define,CONSOLE_BASE))
31$(eval $(call add_define,CRASH_CONSOLE_BASE))
32$(eval $(call add_define,PLAT_PL061_MAX_GPIOS))
Haojian Zhuang934ae712017-05-24 08:47:49 +080033$(eval $(call add_define,PLAT_PARTITION_MAX_ENTRIES))
Haojian Zhuang5f281b32017-05-24 08:45:05 +080034
Victor Chong7d787f52017-08-16 13:53:56 +090035# Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images
36# in the FIP if the platform requires.
37ifneq ($(BL32_EXTRA1),)
38$(eval $(call FIP_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1))
39endif
40ifneq ($(BL32_EXTRA2),)
41$(eval $(call FIP_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2))
42endif
43
Haojian Zhuang5f281b32017-05-24 08:45:05 +080044ENABLE_PLAT_COMPAT := 0
45
46USE_COHERENT_MEM := 1
47
48PLAT_INCLUDES := -Iinclude/common/tbbr \
49 -Iinclude/drivers/synopsys \
50 -Iplat/hisilicon/hikey/include
51
52PLAT_BL_COMMON_SOURCES := drivers/arm/pl011/pl011_console.S \
53 lib/aarch64/xlat_tables.c \
54 plat/hisilicon/hikey/aarch64/hikey_common.c
55
56BL1_SOURCES += bl1/tbbr/tbbr_img_desc.c \
57 drivers/arm/pl061/pl061_gpio.c \
58 drivers/arm/sp804/sp804_delay_timer.c \
59 drivers/delay_timer/delay_timer.c \
60 drivers/gpio/gpio.c \
61 drivers/io/io_block.c \
62 drivers/io/io_fip.c \
63 drivers/io/io_storage.c \
64 drivers/emmc/emmc.c \
65 drivers/synopsys/emmc/dw_mmc.c \
66 lib/cpus/aarch64/cortex_a53.S \
67 plat/hisilicon/hikey/aarch64/hikey_helpers.S \
68 plat/hisilicon/hikey/hikey_bl1_setup.c \
69 plat/hisilicon/hikey/hikey_io_storage.c
Haojian Zhuang934ae712017-05-24 08:47:49 +080070
71BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c \
72 drivers/delay_timer/delay_timer.c \
73 drivers/io/io_block.c \
74 drivers/io/io_fip.c \
75 drivers/io/io_storage.c \
76 drivers/emmc/emmc.c \
77 drivers/synopsys/emmc/dw_mmc.c \
78 plat/hisilicon/hikey/aarch64/hikey_helpers.S \
79 plat/hisilicon/hikey/hikey_bl2_setup.c \
80 plat/hisilicon/hikey/hikey_ddr.c \
81 plat/hisilicon/hikey/hikey_io_storage.c \
82 plat/hisilicon/hikey/hisi_dvfs.c \
83 plat/hisilicon/hikey/hisi_mcu.c
Haojian Zhuang3846f142017-05-24 08:49:26 +080084
Victor Chong2d9a42d2017-08-17 15:21:10 +090085ifeq (${LOAD_IMAGE_V2},1)
86BL2_SOURCES += plat/hisilicon/hikey/hikey_bl2_mem_params_desc.c \
87 plat/hisilicon/hikey/hikey_image_load.c \
88 common/desc_image_load.c
Victor Chong7d787f52017-08-16 13:53:56 +090089
90ifeq (${SPD},opteed)
91BL2_SOURCES += lib/optee/optee_utils.c
92endif
Victor Chong2d9a42d2017-08-17 15:21:10 +090093endif
94
Haojian Zhuang3846f142017-05-24 08:49:26 +080095HIKEY_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
96 drivers/arm/gic/v2/gicv2_main.c \
97 drivers/arm/gic/v2/gicv2_helpers.c \
98 plat/common/plat_gicv2.c
99
100BL31_SOURCES += drivers/arm/cci/cci.c \
Leo Yand5e2d1a2017-05-27 13:17:45 +0800101 drivers/arm/sp804/sp804_delay_timer.c \
102 drivers/delay_timer/delay_timer.c \
Haojian Zhuang3846f142017-05-24 08:49:26 +0800103 lib/cpus/aarch64/cortex_a53.S \
104 plat/common/aarch64/plat_psci_common.c \
105 plat/hisilicon/hikey/aarch64/hikey_helpers.S \
106 plat/hisilicon/hikey/hikey_bl31_setup.c \
107 plat/hisilicon/hikey/hikey_pm.c \
108 plat/hisilicon/hikey/hikey_topology.c \
109 plat/hisilicon/hikey/hisi_ipc.c \
110 plat/hisilicon/hikey/hisi_pwrc.c \
111 plat/hisilicon/hikey/hisi_pwrc_sram.S \
112 ${HIKEY_GIC_SOURCES}
Vincent Guittot492acec2017-06-07 10:12:05 +0200113ifeq (${ENABLE_PMF}, 1)
114BL31_SOURCES += plat/hisilicon/hikey/hisi_sip_svc.c \
115 lib/pmf/pmf_smc.c
116endif
117
Haojian Zhuang66430832017-06-30 16:21:54 +0800118# Enable workarounds for selected Cortex-A53 errata.
119ERRATA_A53_836870 := 1
120ERRATA_A53_843419 := 1
121ERRATA_A53_855873 := 1