Commit c66fad93 authored by Sandrine Bailleux's avatar Sandrine Bailleux
Browse files

Cortex-Axx: Unconditionally apply CPU reset operations

In the Cortex-A35/A53/A57 CPUs library code, some of the CPU specific
reset operations are skipped if they have already been applied in a
previous invocation of the reset handler. This precaution is not
required, as all these operations can be reapplied safely.

This patch removes the unneeded test-before-set instructions in
the reset handler for these CPUs.

Change-Id: Ib175952c814dc51f1b5125f76ed6c06a22b95167
parent 54035fc4
...@@ -67,16 +67,12 @@ endfunc cortex_a35_disable_smp ...@@ -67,16 +67,12 @@ endfunc cortex_a35_disable_smp
*/ */
func cortex_a35_reset_func func cortex_a35_reset_func
/* --------------------------------------------- /* ---------------------------------------------
* As a bare minimum enable the SMP bit if it is * Enable the SMP bit.
* not already set.
* --------------------------------------------- * ---------------------------------------------
*/ */
mrs x0, CORTEX_A35_CPUECTLR_EL1 mrs x0, CORTEX_A35_CPUECTLR_EL1
tst x0, #CORTEX_A35_CPUECTLR_SMPEN_BIT
b.ne skip_smp_setup
orr x0, x0, #CORTEX_A35_CPUECTLR_SMPEN_BIT orr x0, x0, #CORTEX_A35_CPUECTLR_SMPEN_BIT
msr CORTEX_A35_CPUECTLR_EL1, x0 msr CORTEX_A35_CPUECTLR_EL1, x0
skip_smp_setup:
isb isb
ret ret
endfunc cortex_a35_reset_func endfunc cortex_a35_reset_func
......
...@@ -151,16 +151,12 @@ func cortex_a53_reset_func ...@@ -151,16 +151,12 @@ func cortex_a53_reset_func
#endif #endif
/* --------------------------------------------- /* ---------------------------------------------
* As a bare minimum enable the SMP bit if it is * Enable the SMP bit.
* not already set.
* --------------------------------------------- * ---------------------------------------------
*/ */
mrs x0, CPUECTLR_EL1 mrs x0, CPUECTLR_EL1
tst x0, #CPUECTLR_SMP_BIT
b.ne skip_smp_setup
orr x0, x0, #CPUECTLR_SMP_BIT orr x0, x0, #CPUECTLR_SMP_BIT
msr CPUECTLR_EL1, x0 msr CPUECTLR_EL1, x0
skip_smp_setup:
isb isb
ret x19 ret x19
endfunc cortex_a53_reset_func endfunc cortex_a53_reset_func
......
...@@ -105,17 +105,9 @@ func errata_a57_806969_wa ...@@ -105,17 +105,9 @@ func errata_a57_806969_wa
ret ret
#endif #endif
apply_806969: apply_806969:
/*
* Test if errata has already been applied in an earlier
* invocation of the reset handler and does not need to
* be applied again.
*/
mrs x1, CPUACTLR_EL1 mrs x1, CPUACTLR_EL1
tst x1, #CPUACTLR_NO_ALLOC_WBWA
b.ne skip_806969
orr x1, x1, #CPUACTLR_NO_ALLOC_WBWA orr x1, x1, #CPUACTLR_NO_ALLOC_WBWA
msr CPUACTLR_EL1, x1 msr CPUACTLR_EL1, x1
skip_806969:
ret ret
endfunc errata_a57_806969_wa endfunc errata_a57_806969_wa
...@@ -139,17 +131,9 @@ func errata_a57_813420_wa ...@@ -139,17 +131,9 @@ func errata_a57_813420_wa
ret ret
#endif #endif
apply_813420: apply_813420:
/*
* Test if errata has already been applied in an earlier
* invocation of the reset handler and does not need to
* be applied again.
*/
mrs x1, CPUACTLR_EL1 mrs x1, CPUACTLR_EL1
tst x1, #CPUACTLR_DCC_AS_DCCI
b.ne skip_813420
orr x1, x1, #CPUACTLR_DCC_AS_DCCI orr x1, x1, #CPUACTLR_DCC_AS_DCCI
msr CPUACTLR_EL1, x1 msr CPUACTLR_EL1, x1
skip_813420:
ret ret
endfunc errata_a57_813420_wa endfunc errata_a57_813420_wa
...@@ -216,16 +200,12 @@ func cortex_a57_reset_func ...@@ -216,16 +200,12 @@ func cortex_a57_reset_func
#endif #endif
/* --------------------------------------------- /* ---------------------------------------------
* As a bare minimum enable the SMP bit if it is * Enable the SMP bit.
* not already set.
* --------------------------------------------- * ---------------------------------------------
*/ */
mrs x0, CPUECTLR_EL1 mrs x0, CPUECTLR_EL1
tst x0, #CPUECTLR_SMP_BIT
b.ne skip_smp_setup
orr x0, x0, #CPUECTLR_SMP_BIT orr x0, x0, #CPUECTLR_SMP_BIT
msr CPUECTLR_EL1, x0 msr CPUECTLR_EL1, x0
skip_smp_setup:
isb isb
ret x19 ret x19
endfunc cortex_a57_reset_func endfunc cortex_a57_reset_func
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment