diff options
author | Deepak Pandey <Deepak.Pandey@arm.com> | 2018-10-11 13:44:43 +0530 |
---|---|---|
committer | Deepak Pandey <Deepak.Pandey@arm.com> | 2018-10-15 13:08:52 +0530 |
commit | da3b038fd5e39147792df02d87b61054f94da8a5 (patch) | |
tree | f216bbd645fcf1586f18ae87edccf904329aadd6 /plat | |
parent | 424f68dd1dedba416105d513cc7f99904fe4ceac (diff) | |
download | platform_external_arm-trusted-firmware-da3b038fd5e39147792df02d87b61054f94da8a5.tar.gz platform_external_arm-trusted-firmware-da3b038fd5e39147792df02d87b61054f94da8a5.tar.bz2 platform_external_arm-trusted-firmware-da3b038fd5e39147792df02d87b61054f94da8a5.zip |
plat/arm: relocate the jump_if_cpu_midr macro.
macro jump_if_cpu_midr is used commonly by many arm platform.
It has now been relocated to common place to remove duplication
of code.
Change-Id: Ic0876097dbc085df4f90eadb4b7687dde7c726da
Signed-off-by: Deepak Pandey <Deepak.Pandey@arm.com>
Diffstat (limited to 'plat')
-rw-r--r-- | plat/arm/board/juno/aarch32/juno_helpers.S | 16 | ||||
-rw-r--r-- | plat/arm/board/juno/aarch64/juno_helpers.S | 14 | ||||
-rw-r--r-- | plat/arm/css/sgi/aarch64/sgi_helper.S | 16 | ||||
-rw-r--r-- | plat/arm/css/sgm/aarch64/css_sgm_helpers.S | 16 |
4 files changed, 3 insertions, 59 deletions
diff --git a/plat/arm/board/juno/aarch32/juno_helpers.S b/plat/arm/board/juno/aarch32/juno_helpers.S index 824002aed..1bc4e309a 100644 --- a/plat/arm/board/juno/aarch32/juno_helpers.S +++ b/plat/arm/board/juno/aarch32/juno_helpers.S @@ -10,6 +10,7 @@ #include <cortex_a53.h> #include <cortex_a57.h> #include <cortex_a72.h> +#include <cpu_macros.S> #include <v2m_def.h> #include "../juno_def.h" @@ -34,21 +35,6 @@ .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 r0. - * -------------------------------------------------------------------- - */ - .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 - - /* -------------------------------------------------------------------- * Platform reset handler for Juno R0. * * Juno R0 has the following topology: diff --git a/plat/arm/board/juno/aarch64/juno_helpers.S b/plat/arm/board/juno/aarch64/juno_helpers.S index 29c2c0a52..edcfc7449 100644 --- a/plat/arm/board/juno/aarch64/juno_helpers.S +++ b/plat/arm/board/juno/aarch64/juno_helpers.S @@ -40,20 +40,6 @@ .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 - - /* -------------------------------------------------------------------- * Platform reset handler for Juno R0. * * Juno R0 has the following topology: diff --git a/plat/arm/css/sgi/aarch64/sgi_helper.S b/plat/arm/css/sgi/aarch64/sgi_helper.S index dd0fc5bbd..27bae43cf 100644 --- a/plat/arm/css/sgi/aarch64/sgi_helper.S +++ b/plat/arm/css/sgi/aarch64/sgi_helper.S @@ -8,6 +8,7 @@ #include <asm_macros.S> #include <platform_def.h> #include <cortex_a75.h> +#include <cpu_macros.S> .globl plat_arm_calc_core_pos .globl plat_reset_handler @@ -48,21 +49,6 @@ func plat_arm_calc_core_pos ret endfunc plat_arm_calc_core_pos - /* ------------------------------------------------------ - * 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 - /* ----------------------------------------------------- * void plat_reset_handler(void); * diff --git a/plat/arm/css/sgm/aarch64/css_sgm_helpers.S b/plat/arm/css/sgm/aarch64/css_sgm_helpers.S index d9b3df68d..32ca1bbc2 100644 --- a/plat/arm/css/sgm/aarch64/css_sgm_helpers.S +++ b/plat/arm/css/sgm/aarch64/css_sgm_helpers.S @@ -9,6 +9,7 @@ #include <platform_def.h> #include <cortex_a75.h> #include <cortex_a55.h> +#include <cpu_macros.S> .globl plat_arm_calc_core_pos .globl plat_reset_handler @@ -50,21 +51,6 @@ func plat_arm_calc_core_pos ret endfunc plat_arm_calc_core_pos - /* ------------------------------------------------------ - * 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 - /* ----------------------------------------------------- * void plat_reset_handler(void); * |