feat(nxp/common): add CORTEX A53 helper functions

Add helper function to disable the load-store prefetch.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I36d7be37e0b800ab1e5842a56cfd04d779338868
This commit is contained in:
Jiafei Pan 2021-10-21 15:11:17 +08:00
parent 1c87d60b55
commit 3ccc8ac3e5
1 changed files with 26 additions and 0 deletions

View File

@ -6,6 +6,7 @@
*/
#include <asm_macros.S>
#include <cortex_a53.h>
#include <drivers/console.h>
#include <lib/cpus/aarch64/cortex_a72.h>
@ -155,6 +156,31 @@ endfunc plat_core_pos
#endif
/* this function disables the load-store prefetch of the calling core
* Note: this function is for A53 cores ONLY
* in: none
* out: none
* uses x0
*/
func _disable_ldstr_pfetch_A53
mrs x0, CORTEX_A53_CPUACTLR_EL1
tst x0, #CORTEX_A53_CPUACTLR_EL1_L1PCTL
b.ne 1f
b 2f
.align 6
1:
dsb sy
isb
bic x0, x0, #CORTEX_A53_CPUACTLR_EL1_L1PCTL
msr CORTEX_A53_CPUACTLR_EL1, x0
isb
2:
ret
endfunc _disable_ldstr_pfetch_A53
/* this function disables the load-store prefetch of the calling core
* Note: this function is for A72 cores ONLY
* in: none