blob: 31cd837be0f725fe1abf6a887d3956d38d04b131 [file] [log] [blame]
Soby Mathewd9bdaf22014-08-14 16:19:29 +01001#
Douglas Raillarda94cc372017-06-19 15:38:02 +01002# Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
Soby Mathewd9bdaf22014-08-14 16:19:29 +01003#
dp-arm82cb2c12017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Soby Mathewd9bdaf22014-08-14 16:19:29 +01005#
6
Soby Mathew5541bb32014-09-22 14:13:34 +01007# Cortex A57 specific optimisation to skip L1 cache flush when
8# cluster is powered down.
9SKIP_A57_L1_FLUSH_PWR_DWN ?=0
10
Sandrine Bailleux54035fc2016-01-13 14:57:38 +000011# Flag to disable the cache non-temporal hint.
12# It is enabled by default.
13A53_DISABLE_NON_TEMPORAL_HINT ?=1
14
15# Flag to disable the cache non-temporal hint.
16# It is enabled by default.
17A57_DISABLE_NON_TEMPORAL_HINT ?=1
18
Dimitris Papastamosf62ad322017-11-30 14:53:53 +000019WORKAROUND_CVE_2017_5715 ?=1
Dimitris Papastamosb8a25bb2018-04-05 14:38:26 +010020WORKAROUND_CVE_2018_3639 ?=1
Dimitris Papastamosf62ad322017-11-30 14:53:53 +000021
Soby Mathew5541bb32014-09-22 14:13:34 +010022# Process SKIP_A57_L1_FLUSH_PWR_DWN flag
23$(eval $(call assert_boolean,SKIP_A57_L1_FLUSH_PWR_DWN))
24$(eval $(call add_define,SKIP_A57_L1_FLUSH_PWR_DWN))
25
Sandrine Bailleux54035fc2016-01-13 14:57:38 +000026# Process A53_DISABLE_NON_TEMPORAL_HINT flag
27$(eval $(call assert_boolean,A53_DISABLE_NON_TEMPORAL_HINT))
28$(eval $(call add_define,A53_DISABLE_NON_TEMPORAL_HINT))
29
30# Process A57_DISABLE_NON_TEMPORAL_HINT flag
31$(eval $(call assert_boolean,A57_DISABLE_NON_TEMPORAL_HINT))
32$(eval $(call add_define,A57_DISABLE_NON_TEMPORAL_HINT))
33
Dimitris Papastamosf62ad322017-11-30 14:53:53 +000034# Process WORKAROUND_CVE_2017_5715 flag
35$(eval $(call assert_boolean,WORKAROUND_CVE_2017_5715))
36$(eval $(call add_define,WORKAROUND_CVE_2017_5715))
Soby Mathew5541bb32014-09-22 14:13:34 +010037
Dimitris Papastamosb8a25bb2018-04-05 14:38:26 +010038# Process WORKAROUND_CVE_2018_3639 flag
39$(eval $(call assert_boolean,WORKAROUND_CVE_2018_3639))
40$(eval $(call add_define,WORKAROUND_CVE_2018_3639))
41
Sandrine Bailleux097b7872016-04-14 12:59:42 +010042# CPU Errata Build flags.
43# These should be enabled by the platform if the erratum workaround needs to be
44# applied.
Soby Mathewd9bdaf22014-08-14 16:19:29 +010045
Sandrine Bailleux097b7872016-04-14 12:59:42 +010046# Flag to apply erratum 826319 workaround during reset. This erratum applies
47# only to revision <= r0p2 of the Cortex A53 cpu.
Jimmy Huang6b0d97b2015-07-29 20:55:31 +080048ERRATA_A53_826319 ?=0
49
Douglas Raillarda94cc372017-06-19 15:38:02 +010050# Flag to apply erratum 835769 workaround at compile and link time. This
51# erratum applies to revision <= r0p4 of the Cortex A53 cpu. Enabling this
52# workaround can lead the linker to create "*.stub" sections.
53ERRATA_A53_835769 ?=0
54
Sandrine Bailleux097b7872016-04-14 12:59:42 +010055# Flag to apply erratum 836870 workaround during reset. This erratum applies
56# only to revision <= r0p3 of the Cortex A53 cpu. From r0p4 and onwards, this
Douglas Raillard3fbe46d2017-02-15 17:38:43 +000057# erratum workaround is enabled by default in hardware.
Jimmy Huang6b0d97b2015-07-29 20:55:31 +080058ERRATA_A53_836870 ?=0
59
Douglas Raillarda94cc372017-06-19 15:38:02 +010060# Flag to apply erratum 843419 workaround at link time.
61# This erratum applies to revision <= r0p4 of the Cortex A53 cpu. Enabling this
62# workaround could lead the linker to emit "*.stub" sections which are 4kB
63# aligned.
64ERRATA_A53_843419 ?=0
65
Andre Przywarab75dc0e2016-10-06 16:54:53 +010066# Flag to apply errata 855873 during reset. This errata applies to all
67# revisions of the Cortex A53 CPU, but this firmware workaround only works
68# for revisions r0p3 and higher. Earlier revisions are taken care
69# of by the rich OS.
70ERRATA_A53_855873 ?=0
71
Sandrine Bailleux097b7872016-04-14 12:59:42 +010072# Flag to apply erratum 806969 workaround during reset. This erratum applies
73# only to revision r0p0 of the Cortex A57 cpu.
Soby Mathewd9bdaf22014-08-14 16:19:29 +010074ERRATA_A57_806969 ?=0
75
Antonio Nino Diazccbec912017-02-24 11:39:22 +000076# Flag to apply erratum 813419 workaround during reset. This erratum applies
77# only to revision r0p0 of the Cortex A57 cpu.
78ERRATA_A57_813419 ?=0
79
Sandrine Bailleux097b7872016-04-14 12:59:42 +010080# Flag to apply erratum 813420 workaround during reset. This erratum applies
81# only to revision r0p0 of the Cortex A57 cpu.
Soby Mathewd9bdaf22014-08-14 16:19:29 +010082ERRATA_A57_813420 ?=0
83
Sandrine Bailleuxdf22d602016-04-14 13:32:31 +010084# Flag to apply erratum 826974 workaround during reset. This erratum applies
85# only to revision <= r1p1 of the Cortex A57 cpu.
86ERRATA_A57_826974 ?=0
87
Sandrine Bailleux07288862016-04-14 14:24:13 +010088# Flag to apply erratum 826977 workaround during reset. This erratum applies
89# only to revision <= r1p1 of the Cortex A57 cpu.
90ERRATA_A57_826977 ?=0
91
Sandrine Bailleuxa8b1c762016-04-14 14:04:48 +010092# Flag to apply erratum 828024 workaround during reset. This erratum applies
93# only to revision <= r1p1 of the Cortex A57 cpu.
94ERRATA_A57_828024 ?=0
95
Sandrine Bailleux0b771972016-04-14 14:18:07 +010096# Flag to apply erratum 829520 workaround during reset. This erratum applies
97# only to revision <= r1p2 of the Cortex A57 cpu.
98ERRATA_A57_829520 ?=0
99
Sandrine Bailleuxadeecf92016-04-21 11:10:52 +0100100# Flag to apply erratum 833471 workaround during reset. This erratum applies
101# only to revision <= r1p2 of the Cortex A57 cpu.
102ERRATA_A57_833471 ?=0
103
Eleanor Bonnici45b52c22017-08-02 16:35:04 +0100104# Flag to apply erratum 855972 workaround during reset. This erratum applies
105# only to revision <= r1p3 of the Cortex A57 cpu.
106ERRATA_A57_859972 ?=0
107
Eleanor Bonnici6de9b332017-08-02 18:33:41 +0100108# Flag to apply erratum 855971 workaround during reset. This erratum applies
109# only to revision <= r0p3 of the Cortex A72 cpu.
110ERRATA_A72_859971 ?=0
111
Jimmy Huang6b0d97b2015-07-29 20:55:31 +0800112# Process ERRATA_A53_826319 flag
113$(eval $(call assert_boolean,ERRATA_A53_826319))
114$(eval $(call add_define,ERRATA_A53_826319))
115
Douglas Raillarda94cc372017-06-19 15:38:02 +0100116# Process ERRATA_A53_835769 flag
117$(eval $(call assert_boolean,ERRATA_A53_835769))
118$(eval $(call add_define,ERRATA_A53_835769))
119
Jimmy Huang6b0d97b2015-07-29 20:55:31 +0800120# Process ERRATA_A53_836870 flag
121$(eval $(call assert_boolean,ERRATA_A53_836870))
122$(eval $(call add_define,ERRATA_A53_836870))
123
Douglas Raillarda94cc372017-06-19 15:38:02 +0100124# Process ERRATA_A53_843419 flag
125$(eval $(call assert_boolean,ERRATA_A53_843419))
126$(eval $(call add_define,ERRATA_A53_843419))
127
Andre Przywarab75dc0e2016-10-06 16:54:53 +0100128# Process ERRATA_A53_855873 flag
129$(eval $(call assert_boolean,ERRATA_A53_855873))
130$(eval $(call add_define,ERRATA_A53_855873))
131
Soby Mathewd9bdaf22014-08-14 16:19:29 +0100132# Process ERRATA_A57_806969 flag
133$(eval $(call assert_boolean,ERRATA_A57_806969))
134$(eval $(call add_define,ERRATA_A57_806969))
135
Antonio Nino Diazccbec912017-02-24 11:39:22 +0000136# Process ERRATA_A57_813419 flag
137$(eval $(call assert_boolean,ERRATA_A57_813419))
138$(eval $(call add_define,ERRATA_A57_813419))
139
Soby Mathewd9bdaf22014-08-14 16:19:29 +0100140# Process ERRATA_A57_813420 flag
141$(eval $(call assert_boolean,ERRATA_A57_813420))
142$(eval $(call add_define,ERRATA_A57_813420))
Sandrine Bailleuxdf22d602016-04-14 13:32:31 +0100143
144# Process ERRATA_A57_826974 flag
145$(eval $(call assert_boolean,ERRATA_A57_826974))
146$(eval $(call add_define,ERRATA_A57_826974))
Sandrine Bailleuxa8b1c762016-04-14 14:04:48 +0100147
Sandrine Bailleux07288862016-04-14 14:24:13 +0100148# Process ERRATA_A57_826977 flag
149$(eval $(call assert_boolean,ERRATA_A57_826977))
150$(eval $(call add_define,ERRATA_A57_826977))
151
Sandrine Bailleuxa8b1c762016-04-14 14:04:48 +0100152# Process ERRATA_A57_828024 flag
153$(eval $(call assert_boolean,ERRATA_A57_828024))
154$(eval $(call add_define,ERRATA_A57_828024))
Sandrine Bailleux0b771972016-04-14 14:18:07 +0100155
156# Process ERRATA_A57_829520 flag
157$(eval $(call assert_boolean,ERRATA_A57_829520))
158$(eval $(call add_define,ERRATA_A57_829520))
Sandrine Bailleuxadeecf92016-04-21 11:10:52 +0100159
160# Process ERRATA_A57_833471 flag
161$(eval $(call assert_boolean,ERRATA_A57_833471))
162$(eval $(call add_define,ERRATA_A57_833471))
Douglas Raillarda94cc372017-06-19 15:38:02 +0100163
Eleanor Bonnici45b52c22017-08-02 16:35:04 +0100164# Process ERRATA_A57_859972 flag
165$(eval $(call assert_boolean,ERRATA_A57_859972))
166$(eval $(call add_define,ERRATA_A57_859972))
167
Eleanor Bonnici6de9b332017-08-02 18:33:41 +0100168# Process ERRATA_A72_859971 flag
169$(eval $(call assert_boolean,ERRATA_A72_859971))
170$(eval $(call add_define,ERRATA_A72_859971))
171
Douglas Raillarda94cc372017-06-19 15:38:02 +0100172# Errata build flags
173ifneq (${ERRATA_A53_843419},0)
Douglas Raillardc2b88062017-06-22 14:44:48 +0100174TF_LDFLAGS_aarch64 += --fix-cortex-a53-843419
Douglas Raillarda94cc372017-06-19 15:38:02 +0100175endif
176
177ifneq (${ERRATA_A53_835769},0)
178TF_CFLAGS_aarch64 += -mfix-cortex-a53-835769
Douglas Raillardc2b88062017-06-22 14:44:48 +0100179TF_LDFLAGS_aarch64 += --fix-cortex-a53-835769
Douglas Raillarda94cc372017-06-19 15:38:02 +0100180endif