mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
feat(cpus): make revision procedure call optional
For runtime errata, we should avoid generating calls to `cpu_get_rev_var` unless its necessary. Make the path that generates this call parameterized, and cache the result in a temporary register to allow future calls that go down the alternate path to retrieve the cache CPU revision. Change-Id: I9882ede76568fbd9a7ccd4caa74eff0c66a7b20e Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
This commit is contained in:
parent
bfd856004f
commit
4d22b0e5ba
2 changed files with 17 additions and 4 deletions
|
@ -472,15 +472,25 @@
|
|||
* _chosen:
|
||||
* Compile time flag on whether the erratum is included
|
||||
*
|
||||
* clobbers: x0-x9 (PCS compliant)
|
||||
* _get_rev:
|
||||
* Optional parameter that determines whether to insert a call to the CPU revision fetching
|
||||
* procedure. Stores the result of this in the temporary register x10.
|
||||
*
|
||||
* clobbers: x0-x10 (PCS compliant)
|
||||
*/
|
||||
.macro apply_erratum _cpu:req, _cve:req, _id:req, _chosen:req
|
||||
.if \_chosen
|
||||
.macro apply_erratum _cpu:req, _cve:req, _id:req, _chosen:req, _get_rev=GET_CPU_REV
|
||||
.if (\_chosen & \_get_rev)
|
||||
mov x9, x30
|
||||
bl cpu_get_rev_var
|
||||
mov x10, x0
|
||||
.elseif (\_chosen)
|
||||
mov x9, x30
|
||||
mov x0, x10
|
||||
.endif
|
||||
|
||||
.if \_chosen
|
||||
bl erratum_\_cpu\()_\_id\()_wa
|
||||
mov x30, x9
|
||||
|
||||
.endif
|
||||
.endm
|
||||
|
||||
|
|
|
@ -66,6 +66,9 @@ CASSERT(sizeof(struct erratum_entry) == ERRATUM_ENTRY_SIZE,
|
|||
#define NO_ASSERT 0
|
||||
#define NO_APPLY_AT_RESET 0
|
||||
#define APPLY_AT_RESET 1
|
||||
#define GET_CPU_REV 1
|
||||
#define NO_GET_CPU_REV 0
|
||||
|
||||
/* useful for errata that end up always being worked around */
|
||||
#define ERRATUM_ALWAYS_CHOSEN 1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue