amlogic: Move assembly helpers to common directory
authorCarlo Caione <[email protected]>
Fri, 23 Aug 2019 19:02:32 +0000 (20:02 +0100)
committerCarlo Caione <[email protected]>
Thu, 5 Sep 2019 09:39:30 +0000 (10:39 +0100)
The assembly helpers are common to all the amlogic SoCs. Move the .S
file to the common directory.

Signed-off-by: Carlo Caione <[email protected]>
Change-Id: I0d8616a7ae22dbcb14848cefd0149b6bb5814ea6

plat/amlogic/common/aarch64/aml_helpers.S [new file with mode: 0644]
plat/amlogic/gxbb/aarch64/gxbb_helpers.S [deleted file]
plat/amlogic/gxbb/platform.mk
plat/amlogic/gxl/aarch64/gxl_helpers.S [deleted file]
plat/amlogic/gxl/platform.mk

diff --git a/plat/amlogic/common/aarch64/aml_helpers.S b/plat/amlogic/common/aarch64/aml_helpers.S
new file mode 100644 (file)
index 0000000..760d6c4
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <arch.h>
+#include <asm_macros.S>
+#include <assert_macros.S>
+#include <platform_def.h>
+
+       .globl  plat_crash_console_flush
+       .globl  plat_crash_console_init
+       .globl  plat_crash_console_putc
+       .globl  platform_mem_init
+       .globl  plat_is_my_cpu_primary
+       .globl  plat_my_core_pos
+       .globl  plat_reset_handler
+       .globl  plat_gxbb_calc_core_pos
+
+       /* -----------------------------------------------------
+        * unsigned int plat_my_core_pos(void);
+        * -----------------------------------------------------
+        */
+func plat_my_core_pos
+       mrs     x0, mpidr_el1
+       b       plat_gxbb_calc_core_pos
+endfunc plat_my_core_pos
+
+       /* -----------------------------------------------------
+        *  unsigned int plat_gxbb_calc_core_pos(u_register_t mpidr);
+        * -----------------------------------------------------
+        */
+func plat_gxbb_calc_core_pos
+       and     x0, x0, #MPIDR_CPU_MASK
+       ret
+endfunc plat_gxbb_calc_core_pos
+
+       /* -----------------------------------------------------
+        * unsigned int plat_is_my_cpu_primary(void);
+        * -----------------------------------------------------
+        */
+func plat_is_my_cpu_primary
+       mrs     x0, mpidr_el1
+       and     x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
+       cmp     x0, #GXBB_PRIMARY_CPU
+       cset    w0, eq
+       ret
+endfunc plat_is_my_cpu_primary
+
+       /* ---------------------------------------------
+        * void platform_mem_init(void);
+        * ---------------------------------------------
+        */
+func platform_mem_init
+       ret
+endfunc platform_mem_init
+
+       /* ---------------------------------------------
+        * int plat_crash_console_init(void)
+        * ---------------------------------------------
+        */
+func plat_crash_console_init
+       mov_imm x0, GXBB_UART0_AO_BASE
+       mov_imm x1, GXBB_UART0_AO_CLK_IN_HZ
+       mov_imm x2, GXBB_UART_BAUDRATE
+       b       console_meson_init
+endfunc plat_crash_console_init
+
+       /* ---------------------------------------------
+        * int plat_crash_console_putc(int c)
+        * Clobber list : x1, x2
+        * ---------------------------------------------
+        */
+func plat_crash_console_putc
+       mov_imm x1, GXBB_UART0_AO_BASE
+       b       console_meson_core_putc
+endfunc plat_crash_console_putc
+
+       /* ---------------------------------------------
+        * int plat_crash_console_flush()
+        * Out : return -1 on error else return 0.
+        * Clobber list : x0, x1
+        * ---------------------------------------------
+        */
+func plat_crash_console_flush
+       mov_imm x0, GXBB_UART0_AO_BASE
+       b       console_meson_core_flush
+endfunc plat_crash_console_flush
+
+       /* ---------------------------------------------
+        * void plat_reset_handler(void);
+        * ---------------------------------------------
+        */
+func plat_reset_handler
+       ret
+endfunc plat_reset_handler
diff --git a/plat/amlogic/gxbb/aarch64/gxbb_helpers.S b/plat/amlogic/gxbb/aarch64/gxbb_helpers.S
deleted file mode 100644 (file)
index 760d6c4..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <arch.h>
-#include <asm_macros.S>
-#include <assert_macros.S>
-#include <platform_def.h>
-
-       .globl  plat_crash_console_flush
-       .globl  plat_crash_console_init
-       .globl  plat_crash_console_putc
-       .globl  platform_mem_init
-       .globl  plat_is_my_cpu_primary
-       .globl  plat_my_core_pos
-       .globl  plat_reset_handler
-       .globl  plat_gxbb_calc_core_pos
-
-       /* -----------------------------------------------------
-        * unsigned int plat_my_core_pos(void);
-        * -----------------------------------------------------
-        */
-func plat_my_core_pos
-       mrs     x0, mpidr_el1
-       b       plat_gxbb_calc_core_pos
-endfunc plat_my_core_pos
-
-       /* -----------------------------------------------------
-        *  unsigned int plat_gxbb_calc_core_pos(u_register_t mpidr);
-        * -----------------------------------------------------
-        */
-func plat_gxbb_calc_core_pos
-       and     x0, x0, #MPIDR_CPU_MASK
-       ret
-endfunc plat_gxbb_calc_core_pos
-
-       /* -----------------------------------------------------
-        * unsigned int plat_is_my_cpu_primary(void);
-        * -----------------------------------------------------
-        */
-func plat_is_my_cpu_primary
-       mrs     x0, mpidr_el1
-       and     x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
-       cmp     x0, #GXBB_PRIMARY_CPU
-       cset    w0, eq
-       ret
-endfunc plat_is_my_cpu_primary
-
-       /* ---------------------------------------------
-        * void platform_mem_init(void);
-        * ---------------------------------------------
-        */
-func platform_mem_init
-       ret
-endfunc platform_mem_init
-
-       /* ---------------------------------------------
-        * int plat_crash_console_init(void)
-        * ---------------------------------------------
-        */
-func plat_crash_console_init
-       mov_imm x0, GXBB_UART0_AO_BASE
-       mov_imm x1, GXBB_UART0_AO_CLK_IN_HZ
-       mov_imm x2, GXBB_UART_BAUDRATE
-       b       console_meson_init
-endfunc plat_crash_console_init
-
-       /* ---------------------------------------------
-        * int plat_crash_console_putc(int c)
-        * Clobber list : x1, x2
-        * ---------------------------------------------
-        */
-func plat_crash_console_putc
-       mov_imm x1, GXBB_UART0_AO_BASE
-       b       console_meson_core_putc
-endfunc plat_crash_console_putc
-
-       /* ---------------------------------------------
-        * int plat_crash_console_flush()
-        * Out : return -1 on error else return 0.
-        * Clobber list : x0, x1
-        * ---------------------------------------------
-        */
-func plat_crash_console_flush
-       mov_imm x0, GXBB_UART0_AO_BASE
-       b       console_meson_core_flush
-endfunc plat_crash_console_flush
-
-       /* ---------------------------------------------
-        * void plat_reset_handler(void);
-        * ---------------------------------------------
-        */
-func plat_reset_handler
-       ret
-endfunc plat_reset_handler
index 5ab4d52794fb72463d5f1becbfce879b804acb72..e69f3f6316a1dfa55fbf0d7db2ea50f79ce4cd7c 100644 (file)
@@ -8,6 +8,7 @@ include lib/xlat_tables_v2/xlat_tables.mk
 
 AML_PLAT               :=      plat/amlogic
 AML_PLAT_SOC           :=      ${AML_PLAT}/${PLAT}
+AML_PLAT_COMMON                :=      ${AML_PLAT}/common
 
 PLAT_INCLUDES          :=      -I${AML_PLAT_SOC}/include
 
@@ -23,7 +24,7 @@ PLAT_BL_COMMON_SOURCES        :=      drivers/amlogic/console/aarch64/meson_console.S \
 
 BL31_SOURCES           +=      lib/cpus/aarch64/cortex_a53.S           \
                                plat/common/plat_psci_common.c          \
-                               ${AML_PLAT_SOC}/aarch64/gxbb_helpers.S  \
+                               ${AML_PLAT_COMMON}/aarch64/aml_helpers.S        \
                                ${AML_PLAT_SOC}/gxbb_bl31_setup.c       \
                                ${AML_PLAT_SOC}/gxbb_efuse.c            \
                                ${AML_PLAT_SOC}/gxbb_mhu.c              \
diff --git a/plat/amlogic/gxl/aarch64/gxl_helpers.S b/plat/amlogic/gxl/aarch64/gxl_helpers.S
deleted file mode 100644 (file)
index 760d6c4..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <arch.h>
-#include <asm_macros.S>
-#include <assert_macros.S>
-#include <platform_def.h>
-
-       .globl  plat_crash_console_flush
-       .globl  plat_crash_console_init
-       .globl  plat_crash_console_putc
-       .globl  platform_mem_init
-       .globl  plat_is_my_cpu_primary
-       .globl  plat_my_core_pos
-       .globl  plat_reset_handler
-       .globl  plat_gxbb_calc_core_pos
-
-       /* -----------------------------------------------------
-        * unsigned int plat_my_core_pos(void);
-        * -----------------------------------------------------
-        */
-func plat_my_core_pos
-       mrs     x0, mpidr_el1
-       b       plat_gxbb_calc_core_pos
-endfunc plat_my_core_pos
-
-       /* -----------------------------------------------------
-        *  unsigned int plat_gxbb_calc_core_pos(u_register_t mpidr);
-        * -----------------------------------------------------
-        */
-func plat_gxbb_calc_core_pos
-       and     x0, x0, #MPIDR_CPU_MASK
-       ret
-endfunc plat_gxbb_calc_core_pos
-
-       /* -----------------------------------------------------
-        * unsigned int plat_is_my_cpu_primary(void);
-        * -----------------------------------------------------
-        */
-func plat_is_my_cpu_primary
-       mrs     x0, mpidr_el1
-       and     x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
-       cmp     x0, #GXBB_PRIMARY_CPU
-       cset    w0, eq
-       ret
-endfunc plat_is_my_cpu_primary
-
-       /* ---------------------------------------------
-        * void platform_mem_init(void);
-        * ---------------------------------------------
-        */
-func platform_mem_init
-       ret
-endfunc platform_mem_init
-
-       /* ---------------------------------------------
-        * int plat_crash_console_init(void)
-        * ---------------------------------------------
-        */
-func plat_crash_console_init
-       mov_imm x0, GXBB_UART0_AO_BASE
-       mov_imm x1, GXBB_UART0_AO_CLK_IN_HZ
-       mov_imm x2, GXBB_UART_BAUDRATE
-       b       console_meson_init
-endfunc plat_crash_console_init
-
-       /* ---------------------------------------------
-        * int plat_crash_console_putc(int c)
-        * Clobber list : x1, x2
-        * ---------------------------------------------
-        */
-func plat_crash_console_putc
-       mov_imm x1, GXBB_UART0_AO_BASE
-       b       console_meson_core_putc
-endfunc plat_crash_console_putc
-
-       /* ---------------------------------------------
-        * int plat_crash_console_flush()
-        * Out : return -1 on error else return 0.
-        * Clobber list : x0, x1
-        * ---------------------------------------------
-        */
-func plat_crash_console_flush
-       mov_imm x0, GXBB_UART0_AO_BASE
-       b       console_meson_core_flush
-endfunc plat_crash_console_flush
-
-       /* ---------------------------------------------
-        * void plat_reset_handler(void);
-        * ---------------------------------------------
-        */
-func plat_reset_handler
-       ret
-endfunc plat_reset_handler
index 41a62618baf64c267b96fbb6e0489cf7c6190d4b..f699381d54db3019780884ffa104d07881820f62 100644 (file)
@@ -8,6 +8,7 @@ include lib/xlat_tables_v2/xlat_tables.mk
 
 AML_PLAT               :=      plat/amlogic
 AML_PLAT_SOC           :=      ${AML_PLAT}/${PLAT}
+AML_PLAT_COMMON                :=      ${AML_PLAT}/common
 
 DOIMAGEPATH            ?=      tools/amlogic
 DOIMAGETOOL            ?=      ${DOIMAGEPATH}/doimage
@@ -28,7 +29,7 @@ PLAT_BL_COMMON_SOURCES        :=      drivers/amlogic/console/aarch64/meson_console.S \
 
 BL31_SOURCES           +=      lib/cpus/aarch64/cortex_a53.S           \
                                plat/common/plat_psci_common.c          \
-                               ${AML_PLAT_SOC}/aarch64/gxl_helpers.S   \
+                               ${AML_PLAT_COMMON}/aarch64/aml_helpers.S        \
                                ${AML_PLAT_SOC}/gxl_bl31_setup.c        \
                                ${AML_PLAT_SOC}/gxl_efuse.c             \
                                ${AML_PLAT_SOC}/gxl_mhu.c               \