[PATCH 2/3] bsps/arm: Move register init to start.S
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Jul 26 06:17:39 UTC 2019
This makes it easier to review changes in start.S.
Update #3773.
---
bsps/arm/shared/start/bsp-start-init-registers.S | 105 -----------------------
bsps/arm/shared/start/start.S | 59 ++++++++++++-
c/src/lib/libbsp/arm/tms570/Makefile.am | 1 -
3 files changed, 55 insertions(+), 110 deletions(-)
delete mode 100644 bsps/arm/shared/start/bsp-start-init-registers.S
diff --git a/bsps/arm/shared/start/bsp-start-init-registers.S b/bsps/arm/shared/start/bsp-start-init-registers.S
deleted file mode 100644
index 961d3172bf..0000000000
--- a/bsps/arm/shared/start/bsp-start-init-registers.S
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file
- *
- * @brief ARM register initialization routines.
- */
-
-/*
- * Copyright (c) 2015 Taller Technologies. All rights reserved.
- *
- * @author Martin Galvan <martin.galvan at tallertechnologies.com>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-/*
- * These routines initialize the core and VFP registers of ARM CPUs.
- * This is necessary for boards that operate in a 1oo1D fashion,
- * such as the TMS570.
- */
-
-#include <rtems/asm.h>
-
-.section .text
-.syntax unified
-.cpu cortex-r4
-.arm
-
-/* Initialization of the ARM core registers. */
-FUNCTION_ENTRY(bsp_start_init_registers_core)
- mov r0, #0
- mov r1, #0
- mov r2, #0
- mov r3, #0
- mov r4, #0
- mov r5, #0
- mov r6, #0
- mov r7, #0
- mov r8, #0
- mov r9, #0
- mov r10, #0
- mov r11, #0
- mov r12, #0
- mov r13, #0
-
- bx lr
-FUNCTION_END(bsp_start_init_registers_core)
-
-/* Initialization of the FIQ mode banked registers. */
-FUNCTION_ENTRY(bsp_start_init_registers_banked_fiq)
- mov r8, #0
- mov r9, #0
- mov r10, #0
- mov r11, #0
- mov r12, #0
-
- bx lr
-FUNCTION_END(bsp_start_init_registers_banked_fiq)
-
-#ifdef ARM_MULTILIB_VFP
-
-/* Initialization of the FPU registers. */
-FUNCTION_ENTRY(bsp_start_init_registers_vfp)
- mov r0, #0
- vmov d0, r0, r0
- vmov d1, r0, r0
- vmov d2, r0, r0
- vmov d3, r0, r0
- vmov d4, r0, r0
- vmov d5, r0, r0
- vmov d6, r0, r0
- vmov d7, r0, r0
- vmov d8, r0, r0
- vmov d9, r0, r0
- vmov d10, r0, r0
- vmov d11, r0, r0
- vmov d12, r0, r0
- vmov d13, r0, r0
- vmov d14, r0, r0
- vmov d15, r0, r0
-
-#ifdef ARM_MULTILIB_VFP_D32
- vmov d16, r0, r0
- vmov d17, r0, r0
- vmov d18, r0, r0
- vmov d19, r0, r0
- vmov d20, r0, r0
- vmov d21, r0, r0
- vmov d22, r0, r0
- vmov d23, r0, r0
- vmov d24, r0, r0
- vmov d25, r0, r0
- vmov d26, r0, r0
- vmov d27, r0, r0
- vmov d28, r0, r0
- vmov d29, r0, r0
- vmov d30, r0, r0
- vmov d31, r0, r0
-#endif /* ARM_MULTILIB_VFP_D32 */
-
- bx lr
-FUNCTION_END(bsp_start_init_registers_vfp)
-
-#endif /* ARM_MULTILIB_VFP */
diff --git a/bsps/arm/shared/start/start.S b/bsps/arm/shared/start/start.S
index a7fd7eda62..1f6d38f564 100644
--- a/bsps/arm/shared/start/start.S
+++ b/bsps/arm/shared/start/start.S
@@ -146,7 +146,20 @@ _start:
mov r5, r1 /* machine type number or ~0 for DT boot */
mov r6, r2 /* physical address of ATAGs or DTB */
#else /* BSP_START_NEEDS_REGISTER_INITIALIZATION */
- bl bsp_start_init_registers_core
+ mov r0, #0
+ mov r1, #0
+ mov r2, #0
+ mov r3, #0
+ mov r4, #0
+ mov r5, #0
+ mov r6, #0
+ mov r7, #0
+ mov r8, #0
+ mov r9, #0
+ mov r10, #0
+ mov r11, #0
+ mov r12, #0
+ mov r13, #0
#endif
#ifdef RTEMS_SMP
@@ -204,7 +217,11 @@ _start:
sub r3, r3, r1
#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
- bl bsp_start_init_registers_banked_fiq
+ mov r8, #0
+ mov r9, #0
+ mov r10, #0
+ mov r11, #0
+ mov r12, #0
#endif
/* Enter ABT mode and set up the ABT stack pointer */
@@ -271,8 +288,42 @@ _start:
vmsr FPEXC, r0
#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
- bl bsp_start_init_registers_vfp
-#endif
+ mov r0, #0
+ vmov d0, r0, r0
+ vmov d1, r0, r0
+ vmov d2, r0, r0
+ vmov d3, r0, r0
+ vmov d4, r0, r0
+ vmov d5, r0, r0
+ vmov d6, r0, r0
+ vmov d7, r0, r0
+ vmov d8, r0, r0
+ vmov d9, r0, r0
+ vmov d10, r0, r0
+ vmov d11, r0, r0
+ vmov d12, r0, r0
+ vmov d13, r0, r0
+ vmov d14, r0, r0
+ vmov d15, r0, r0
+#ifdef ARM_MULTILIB_VFP_D32
+ vmov d16, r0, r0
+ vmov d17, r0, r0
+ vmov d18, r0, r0
+ vmov d19, r0, r0
+ vmov d20, r0, r0
+ vmov d21, r0, r0
+ vmov d22, r0, r0
+ vmov d23, r0, r0
+ vmov d24, r0, r0
+ vmov d25, r0, r0
+ vmov d26, r0, r0
+ vmov d27, r0, r0
+ vmov d28, r0, r0
+ vmov d29, r0, r0
+ vmov d30, r0, r0
+ vmov d31, r0, r0
+#endif /* ARM_MULTILIB_VFP_D32 */
+#endif /* BSP_START_NEEDS_REGISTER_INITIALIZATION */
#endif /* ARM_MULTILIB_VFP */
diff --git a/c/src/lib/libbsp/arm/tms570/Makefile.am b/c/src/lib/libbsp/arm/tms570/Makefile.am
index bbff1ec7a6..40aed64f3f 100644
--- a/c/src/lib/libbsp/arm/tms570/Makefile.am
+++ b/c/src/lib/libbsp/arm/tms570/Makefile.am
@@ -49,7 +49,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cp15/arm-cp15-set-ttb
# Startup
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/start/bsp-start-memcpy.S
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/start/bsp-start-init-registers.S
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/tms570/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/tms570/start/bspstart.c
--
2.16.4
More information about the devel
mailing list