diff options
author | Soby Mathew <soby.mathew@arm.com> | 2018-10-18 09:34:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 09:34:20 +0100 |
commit | 1278f363d3b575b23d095a980d66ccdd801b61f8 (patch) | |
tree | 110775c04303673fb4c7c77e871ecfdd1d24a8a3 /include | |
parent | 7be05cd5d204dce5b6e18232516f20de7e9c26f8 (diff) | |
parent | da3b038fd5e39147792df02d87b61054f94da8a5 (diff) | |
download | platform_external_arm-trusted-firmware-1278f363d3b575b23d095a980d66ccdd801b61f8.tar.gz platform_external_arm-trusted-firmware-1278f363d3b575b23d095a980d66ccdd801b61f8.tar.bz2 platform_external_arm-trusted-firmware-1278f363d3b575b23d095a980d66ccdd801b61f8.zip |
Merge pull request #1631 from deepan02/deepak-arm/relocate-jump_if_cpu_midr
plat/arm: relocate the jump_if_cpu_midr macro.
Diffstat (limited to 'include')
-rw-r--r-- | include/lib/cpus/aarch32/cpu_macros.S | 13 | ||||
-rw-r--r-- | include/lib/cpus/aarch64/cpu_macros.S | 14 |
2 files changed, 27 insertions, 0 deletions
diff --git a/include/lib/cpus/aarch32/cpu_macros.S b/include/lib/cpus/aarch32/cpu_macros.S index 7703be339..525e18caf 100644 --- a/include/lib/cpus/aarch32/cpu_macros.S +++ b/include/lib/cpus/aarch32/cpu_macros.S @@ -214,5 +214,18 @@ bl errata_print_msg .endm #endif + /* + * 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: r0-r1 + */ + .macro jump_if_cpu_midr _cpu_midr, _label + ldcopr r0, MIDR + ubfx r0, r0, #MIDR_PN_SHIFT, #12 + ldr r1, =((\_cpu_midr >> MIDR_PN_SHIFT) & MIDR_PN_MASK) + cmp r0, r1 + beq \_label + .endm #endif /* __CPU_MACROS_S__ */ diff --git a/include/lib/cpus/aarch64/cpu_macros.S b/include/lib/cpus/aarch64/cpu_macros.S index 026a48e32..4672cbc06 100644 --- a/include/lib/cpus/aarch64/cpu_macros.S +++ b/include/lib/cpus/aarch64/cpu_macros.S @@ -272,3 +272,17 @@ cmp \_reg, #1 beq \_label .endm + + /* + * 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 |