diff options
author | Nitin Garg <nitin.garg@nxp.com> | 2017-05-11 16:28:55 -0500 |
---|---|---|
committer | Abel Vesa <abel.vesa@nxp.com> | 2018-06-08 17:34:08 +0300 |
commit | b7de3462169e98839eff4a20fdb1dc9fe43b6031 (patch) | |
tree | 0cd1238a3f22d96bd392c2ff788aba71ff05da4e /plat/imx/common/imx8_helpers.S | |
parent | a9986857ec07fcb3039016d8d1de140a178f702e (diff) |
Fix A72 L2 DATA latency and support booting CA72 as primary
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Diffstat (limited to 'plat/imx/common/imx8_helpers.S')
-rw-r--r-- | plat/imx/common/imx8_helpers.S | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plat/imx/common/imx8_helpers.S b/plat/imx/common/imx8_helpers.S index 6f677ca9..091d60a5 100644 --- a/plat/imx/common/imx8_helpers.S +++ b/plat/imx/common/imx8_helpers.S @@ -30,6 +30,7 @@ #include <asm_macros.S> #include <platform_def.h> +#include <cortex_a72.h> .globl plat_is_my_cpu_primary .globl plat_my_core_pos @@ -42,6 +43,20 @@ .globl platform_mem_init .globl imx_mailbox_init + /* -------------------------------------------------------------------- + * Helper macro that reads the part number of the current CPU and jumps + * to the given label if it matches the CPU MIDR provided. + * + * Clobbers x0. + * -------------------------------------------------------------------- + */ + .macro jump_if_cpu_midr _cpu_midr, _label + mrs x0, midr_el1 + ubfx x0, x0, MIDR_PN_SHIFT, #12 + cmp w0, #((\_cpu_midr >> MIDR_PN_SHIFT) & MIDR_PN_MASK) + b.eq \_label + .endm + /* ---------------------------------------------- * The mailbox_base is used to distinguish warm/cold * reset. The mailbox_base is in the data section, not @@ -102,6 +117,21 @@ func plat_reset_handler msr actlr_el3, x0 msr actlr_el2, x0 isb + /* -------------------------------------------------------------------- + * Nothing to do on Cortex-A53. + * -------------------------------------------------------------------- + */ + jump_if_cpu_midr CORTEX_A72_MIDR, A72 + ret + +A72: + /* -------------------------------------------------------------------- + * Cortex-A72 specific settings + * -------------------------------------------------------------------- + */ + mov x0, #(CORTEX_A72_L2_DATA_RAM_LATENCY_3_CYCLES << CORTEX_A72_L2CTLR_DATA_RAM_LATENCY_SHIFT) + msr CORTEX_A72_L2CTLR_EL1, x0 + isb ret endfunc plat_reset_handler |