Changeset 991fdb33 in rtems


Ignore:
Timestamp:
Feb 26, 2015, 8:31:27 PM (5 years ago)
Author:
Martin Galvan <martin.galvan@…>
Branches:
4.11, master
Children:
4ccb79bc
Parents:
63e91fe6
git-author:
Martin Galvan <martin.galvan@…> (02/26/15 20:31:27)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/27/15 11:05:36)
Message:

ARM: Add BSP_START_NEEDS_REGISTER_INITIALIZATION

This patch adds the macro BSP_START_NEEDS_REGISTER_INITIALIZATION and
three hooks for BSP-specific register init code to arm/shared/start.S.
Said hooks are bsp_start_init_registers_core (intended for initializing
the ARM core registers), bsp_start_init_registers_banked_fiq (for the
FIQ mode banked registers) and bsp_start_init_registers_vfp (for the FPU
registers). BSP_START_NEEDS_REGISTER_INITIALIZATION would be defined in
a BSP's configure.ac (so that it appears in its bspopts.h).

This patch also adds the register init code required by the TMS570.
We've tested it with the tms570ls3137_hdk.cfg config and it works fine.

Location:
c/src/lib/libbsp/arm
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/shared/start/start.S

    r63e91fe6 r991fdb33  
    4949        .extern _ARMV7M_Exception_default
    5050
     51#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
     52        .extern bsp_start_init_registers_core
     53        .extern bsp_start_init_registers_banked_fiq
     54        .extern bsp_start_init_registers_vfp
     55#endif
     56
    5157        /* Global symbols */
    5258        .globl  _start
     
    128134         */
    129135
     136#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
     137        bl bsp_start_init_registers_core
     138#endif
     139
    130140#ifdef RTEMS_SMP
    131141        /* Read MPIDR */
     
    162172#endif
    163173
     174#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
     175        bl bsp_start_init_registers_banked_fiq
     176#endif
     177
    164178        /* Enter ABT mode and set up the ABT stack pointer */
    165179        mov     r0, #(ARM_PSR_M_ABT | ARM_PSR_I | ARM_PSR_F)
     
    208222        mov r0, #(1 << 30)
    209223        vmsr FPEXC, r0
     224
     225#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
     226        bl bsp_start_init_registers_vfp
     227#endif
     228
    210229#endif /* ARM_MULTILIB_VFP */
    211230
     
    305324_start:
    306325
     326#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
     327        bl bsp_start_init_registers_core
     328#endif
     329
    307330#ifdef ARM_MULTILIB_VFP
    308331        /*
     
    316339        dsb
    317340        isb
    318 #endif
     341
     342#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
     343        bl bsp_start_init_registers_vfp
     344#endif
     345
     346#endif /* ARM_MULTILIB_VFP */
    319347
    320348        ldr     sp, =bsp_stack_main_end
  • c/src/lib/libbsp/arm/tms570/Makefile.am

    r63e91fe6 r991fdb33  
    8383# Startup
    8484libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
     85libbsp_a_SOURCES += ../shared/startup/bsp-start-init-registers.S
    8586libbsp_a_SOURCES += ../../shared/bsppretaskinghook.c
    8687libbsp_a_SOURCES += startup/bspreset.c
  • c/src/lib/libbsp/arm/tms570/configure.ac

    r63e91fe6 r991fdb33  
    3737                        size in bytes])
    3838
     39RTEMS_BSPOPTS_SET([BSP_START_NEEDS_REGISTER_INITIALIZATION],[*],[1])
     40RTEMS_BSPOPTS_HELP([BSP_START_NEEDS_REGISTER_INITIALIZATION],
     41                                        [The TMS570 needs to have the registers of its CPU initialized
     42                                        to avoid CCMR4F errors])
     43
    3944RTEMS_BSPOPTS_SET([TMS570_OSCILLATOR_MAIN],[*],[12000000U])
    4045RTEMS_BSPOPTS_HELP([TMS570_OSCILLATOR_MAIN],[main oscillator frequency in Hz])
Note: See TracChangeset for help on using the changeset viewer.