BSP-specific init code in arm/shared/start.S?
Sebastian Huber
sebastian.huber at embedded-brains.de
Sun Feb 22 18:38:22 UTC 2015
On 20/02/15 19:43, Martin Galvan wrote:
> Hello everybody! As some of you may already know, we're working on the
> TMS570 BSP. According to the board's datasheet we need to initialize
> the CPU's registers at startup:
>
> "The TMS570LS series of microcontrollers include dual Cortex-R4F CPUs
> running in a lock-step operation mode. A Core Compare Module (CCM-R4)
> compares the output signals from each R4F CPU. Any difference in the
> two CPUs outputs is flagged as a fault of a high severity level. The
> CPU internal core registers need to be initialized to a predefined
> state in order to prevent an error from being flagged during system
> initialization."
>
> Ideally, we would do this in _start right before initializing the
> stack pointer registers. However, this would be wrong as start.S is
> shared by all the ARM BSPs. Right now we're doing it at the beginning
> of bsp_start, but it would be safer to do it at the beginning of
> _start.
The start.S already has a #include <bspopts.h>. So I would add a BSP
option to define something like BSP_START_DO_LOCKSTEP_INITIALIZATION and
use it in start.S.
>
> Additionally, when the CCM detects an error it raises a FIQ which must
> be handled in a board-specific way, otherwise it re-raises the FIQ as
> soon as _ARMV4_Exception_fiq_default enables FIQs in the CPSR.
Oh, this is a bug, the _ARMV4_Exception_fiq_default should not enable
the FIQs.
> Again,
> we don't want to mix our BSP-specific things with the shared ARM code.
> How should we go about this?
>
> Thanks a lot!
>
I would add BSP_START_EXCEPTION_UNDEF_HANDLER etc. defines and add
something like this:
#ifdef BSP_START_EXCEPTION_UNDEF_HANDLER
.word BSP_START_EXCEPTION_UNDEF_HANDLER
#else
.word _ARMV4_Exception_undef_default
#endif
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list