blob: 41a08ca3030d8b5ee5bd078d83948269b2920b24 [file] [log] [blame]
Saurabh Gorecha70389ca2020-04-22 21:31:24 +05301#
2# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3# Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8# Make for SC7180 QTI platform.
9
10QTI_PLAT_PATH := plat/qti
11CHIPSET := ${PLAT}
12
13# Turn On Separate code & data.
14SEPARATE_CODE_AND_RODATA := 1
Saurabh Gorechab8493012022-04-05 00:11:52 +053015USE_COHERENT_MEM := 0
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053016WARMBOOT_ENABLE_DCACHE_EARLY := 1
Saurabh Gorechab8493012022-04-05 00:11:52 +053017HW_ASSISTED_COHERENCY := 1
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053018
19# Disable the PSCI platform compatibility layer
20ENABLE_PLAT_COMPAT := 0
21
Saurabh Gorechab8493012022-04-05 00:11:52 +053022#Enable errata for cortex_a55 and cortex_a76
23ERRATA_A55_1530923 := 1
24ERRATA_A76_1165522 := 1
25
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053026# Enable PSCI v1.0 extended state ID format
27PSCI_EXTENDED_STATE_ID := 1
28ARM_RECOM_STATE_ID_ENC := 1
29
30COLD_BOOT_SINGLE_CPU := 1
31PROGRAMMABLE_RESET_ADDRESS := 1
32
33RESET_TO_BL31 := 0
34
35MULTI_CONSOLE_API := 1
36
37QTI_SDI_BUILD := 0
38$(eval $(call assert_boolean,QTI_SDI_BUILD))
39$(eval $(call add_define,QTI_SDI_BUILD))
40
41#disable CTX_INCLUDE_AARCH32_REGS to support sc7180 gold cores
42override CTX_INCLUDE_AARCH32_REGS := 0
43WORKAROUND_CVE_2017_5715 := 0
44DYNAMIC_WORKAROUND_CVE_2018_3639 := 1
45# Enable stack protector.
46ENABLE_STACK_PROTECTOR := strong
47
48
49QTI_EXTERNAL_INCLUDES := -I${QTI_PLAT_PATH}/${CHIPSET}/inc \
50 -I${QTI_PLAT_PATH}/common/inc \
51 -I${QTI_PLAT_PATH}/common/inc/$(ARCH) \
52 -I${QTI_PLAT_PATH}/qtiseclib/inc \
53 -I${QTI_PLAT_PATH}/qtiseclib/inc/${CHIPSET} \
54
55QTI_BL31_SOURCES := $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_helpers.S \
56 $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo4_silver.S \
57 $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo4_gold.S \
58 $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_uart_console.S \
Shelley Chen68afc062021-10-01 18:34:07 -070059 $(QTI_PLAT_PATH)/common/src/pm_ps_hold.c \
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053060 $(QTI_PLAT_PATH)/common/src/qti_stack_protector.c \
61 $(QTI_PLAT_PATH)/common/src/qti_common.c \
62 $(QTI_PLAT_PATH)/common/src/qti_bl31_setup.c \
63 $(QTI_PLAT_PATH)/common/src/qti_gic_v3.c \
64 $(QTI_PLAT_PATH)/common/src/qti_interrupt_svc.c \
65 $(QTI_PLAT_PATH)/common/src/qti_syscall.c \
66 $(QTI_PLAT_PATH)/common/src/qti_topology.c \
67 $(QTI_PLAT_PATH)/common/src/qti_pm.c \
Saurabh Gorecha87f47372020-07-09 02:20:08 +053068 $(QTI_PLAT_PATH)/common/src/qti_rng.c \
Julius Werner0375d322019-02-20 17:33:23 -080069 $(QTI_PLAT_PATH)/common/src/spmi_arb.c \
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053070 $(QTI_PLAT_PATH)/qtiseclib/src/qtiseclib_cb_interface.c \
71
72
73PLAT_INCLUDES := -Iinclude/plat/common/ \
74
75PLAT_INCLUDES += ${QTI_EXTERNAL_INCLUDES}
76
77include lib/xlat_tables_v2/xlat_tables.mk
78PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} \
79 plat/common/aarch64/crash_console_helpers.S \
80 common/desc_image_load.c \
81 lib/bl_aux_params/bl_aux_params.c \
82
83include lib/coreboot/coreboot.mk
84
85#PSCI Sources.
86PSCI_SOURCES := plat/common/plat_psci_common.c \
87
88# GIC-600 configuration
Julius Werner8793e2c2020-08-24 18:34:38 -070089GICV3_SUPPORT_GIC600 := 1
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053090# Include GICv3 driver files
91include drivers/arm/gic/v3/gicv3.mk
92
93#Timer sources
94TIMER_SOURCES := drivers/delay_timer/generic_delay_timer.c \
95 drivers/delay_timer/delay_timer.c \
96
97#GIC sources.
98GIC_SOURCES := plat/common/plat_gicv3.c \
99 ${GICV3_SOURCES} \
100
Saurabh Gorechab8493012022-04-05 00:11:52 +0530101CPU_SOURCES := lib/cpus/aarch64/cortex_a76.S \
102 lib/cpus/aarch64/cortex_a55.S \
103
104BL31_SOURCES += ${QTI_BL31_SOURCES} \
105 ${PSCI_SOURCES} \
106 ${GIC_SOURCES} \
107 ${TIMER_SOURCES} \
108 ${CPU_SOURCES} \
Saurabh Gorecha70389ca2020-04-22 21:31:24 +0530109
110LIB_QTI_PATH := ${QTI_PLAT_PATH}/qtiseclib/lib/${CHIPSET}
111
112
113# Override this on the command line to point to the qtiseclib library which
114# will be available in coreboot.org
115QTISECLIB_PATH ?=
116
117ifeq ($(QTISECLIB_PATH),)
118# if No lib then use stub implementation for qtiseclib interface
119$(warning QTISECLIB_PATH is not provided while building, using stub implementation. \
120 Please refer docs/plat/qti.rst for more details \
121 THIS FIRMWARE WILL NOT BOOT!)
122BL31_SOURCES += plat/qti/qtiseclib/src/qtiseclib_interface_stub.c
123else
124# use library provided by QTISECLIB_PATH
125LDFLAGS += -L $(dir $(QTISECLIB_PATH))
126LDLIBS += -l$(patsubst lib%.a,%,$(notdir $(QTISECLIB_PATH)))
127endif
128