Commit Graph

15 Commits

Author SHA1 Message Date
Daniel Cederman
e01e499490 bsps/sparc: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 10:59:44 +01:00
Sebastian Huber
be96cb4345 sparc: Simplify trap table initialization
Move _ISR_Handler() to a separate file since it is now only used if a handler
is installed by _CPU_ISR_install_raw_handler().

Statically initialize the traps for external interrupts to use the new
_SPARC_Interrupt_trap() which directly dispatches the interrupt handlers
installed by rtems_interrupt_handler_install() via the BSP-provided
_SPARC_Interrupt_dispatch().

Since the trap table is now fully statically initialized, there is no longer a
dependency on the Cache Manager in the default configuration.

Update #4458.
2021-06-24 11:36:28 +02:00
Sebastian Huber
d73e657e06 sparc: More reliable bad trap handling
Statically initialize the trap table in start.S to jump to _SPARC_Bad_trap()
for all unexpected traps.  This enables a proper RTEMS fatal error handling
right from the start.  Do not rely on the stack and register settings which
caused an unexpected trap.  Use the ISR stack of the processor to do the fatal
error handling.  Save the full context which caused the trap.  Fatal error
handler may use it for error logging.

Unify the _CPU_Exception_frame_print() implementations and move it to cpukit.

Update #4459.
2021-06-24 11:36:28 +02:00
Sebastian Huber
7a140e2ed5 bsps/sparc: Add a symbol for each trap table entry
This makes it easier to review start.o and set break points to trap table
entries.  This change was checked by inspecting the trap table in start.o with
objdump.

Update #4458.
2021-06-24 11:36:28 +02:00
Sebastian Huber
93afcff7b5 bsps/sparc: Simplify memory initialization
Directly initialize the memory in the start sequence defined by start.S
instead of using a system initialization handler.  This avoids using the
global variable rdb_start which used a memory location which was shared
with _ERC32_MEC_Timer_Control_Mirror.  This change makes it possible to
use _Memory_Allocate() even before the system initialization is started.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-06-10 07:59:39 +02:00
Sebastian Huber
ef5a53bcf8 bsps/sparc: Simplify stack initialization
Initialize the stacks for all processors in one place.  Do not rely on
Per_CPU_Control::interrupt_stack_high and directly use the statically
allocated interrupt stack area.
2021-06-10 07:58:57 +02:00
Sebastian Huber
b823c9843d bsps/sparc: Unify stack initialization
Initialize the stacks in start.S in one place and identical to
_CPU_Context_Initialize().
2021-06-10 07:53:04 +02:00
Sebastian Huber
07f6a61d03 bsps/sparc: Remove support to load data section
Remove the support to load the data section and rely on the boot loader.  The
code is an artifact from the old erc32 days, when we would boot and execute
from ROM and the .data had to be copied over to RAM.  With leon1/2/3, this is
not used anymore as a boot loader is made from the RAM image using a custom
tool (mkprom).

In SMP configurations, this support was also broken since LEON3_Boot_Cpu
(in the data section due to the -1 initialization value) was used quite
early in the start sequence.

If the data copy is really necessary, then an application can still add this
step as a very early system initialization step, since boot_card() and the
system initialization loop does not use initialized read-write data (only
read-only and BSS data).  However, the SMP startup would still not work in this
case.  A boot loader is a better place to load the sections.
2021-06-10 07:50:00 +02:00
Sebastian Huber
7b8119a13a bsps/sparc: Remove unused __bsp_mem_init symbol 2021-06-10 07:50:00 +02:00
Sebastian Huber
ff081aee72 score: Rename interrupt stack symbols
Rename

  * _Configuration_Interrupt_stack_area_begin in _ISR_Stack_area_begin,
  * _Configuration_Interrupt_stack_area_end in _ISR_Stack_area_end, and
  * _Configuration_Interrupt_stack_size in _ISR_Stack_size.

Move definitions to <rtems/score/isr.h>.  The new names are considerable
shorter and in the right namespace.

Update #3459.
2018-11-08 08:09:20 +01:00
Daniel Hellstrom
a87964d04f sparc,smp: typo in start.S causing SMP not working 2018-08-24 15:51:38 +02:00
Sebastian Huber
71284ce893 bsps/sparc: Fix typo in start.S
Fix typo in start.S introduced by
4678d1a8b0.
2018-08-01 10:07:18 +02:00
Sebastian Huber
4678d1a8b0 bsps: bsp_start_on_secondary_processor()
Pass current processor control as first parameter in
bsp_start_on_secondary_processor() and qoriq_start_thread() to make
dependency more explicit.
2018-07-25 10:07:42 +02:00
Sebastian Huber
511dc4b2be Rework initialization and interrupt stack support
Statically initialize the interrupt stack area
(_Configuration_Interrupt_stack_area_begin,
_Configuration_Interrupt_stack_area_end, and
_Configuration_Interrupt_stack_size) via <rtems/confdefs.h>.  Place the
interrupt stack area in a special section ".rtemsstack.interrupt".  Let
BSPs define the optimal placement of this section in their linker
command files (e.g. in a fast on-chip memory).

This change makes makes the CPU_HAS_SOFTWARE_INTERRUPT_STACK and
CPU_HAS_HARDWARE_INTERRUPT_STACK CPU port defines superfluous, since the
low level initialization code has all information available via global
symbols.

This change makes the CPU_ALLOCATE_INTERRUPT_STACK CPU port define
superfluous, since the interrupt stacks are allocated by confdefs.h for
all architectures.  There is no need for BSP-specific linker command
file magic (except the section placement), see previous ARM linker
command file as a bad example.

Remove _CPU_Install_interrupt_stack().  Initialize the hardware
interrupt stack in _CPU_Initialize() if necessary (e.g.
m68k_install_interrupt_stack()).

The optional _CPU_Interrupt_stack_setup() is still useful to customize
the registration of the interrupt stack area in the per-CPU information.

The initialization stack can reuse the interrupt stack, since

  * interrupts are disabled during the sequential system initialization,
    and

  * the boot_card() function does not return.

This stack resuse saves memory.

Changes per architecture:

arm:

  * Mostly replace the linker symbol based configuration of stacks with
    the standard <rtems/confdefs.h> configuration via
    CONFIGURE_INTERRUPT_STACK_SIZE.  The size of the FIQ, ABT and UND
    mode stack is still defined via linker symbols.  These modes are
    rarely used in applications and the default values provided by the
    BSP should be sufficient in most cases.

  * Remove the bsp_processor_count linker symbol hack used for the SMP
    support. This is possible since the interrupt stack area is now
    allocated by the linker and not allocated from the heap.  This makes
    some configure.ac stuff obsolete.  Remove the now superfluous BSP
    variants altcycv_devkit_smp and realview_pbx_a9_qemu_smp.

bfin:

  * Remove unused magic linker command file allocation of initialization
    stack.  Maybe a previous linker command file copy and paste problem?
    In the start.S the initialization stack is set to a hard coded value.

lm32, m32c, mips, nios2, riscv, sh, v850:

  * Remove magic linker command file allocation of initialization stack.
    Reuse interrupt stack for initialization stack.

m68k:

  * Remove magic linker command file allocation of initialization stack.
    Reuse interrupt stack for initialization stack.

powerpc:

  * Remove magic linker command file allocation of initialization stack.
    Reuse interrupt stack for initialization stack.

  * Used dedicated memory region (REGION_RTEMSSTACK) for the interrupt
    stack on BSPs using the shared linkcmds.base (replacement for
    REGION_RWEXTRA).

sparc:

  * Remove the hard coded initialization stack.  Use the interrupt stack
    for the initialization stack on the boot processor.  This saves
    16KiB of RAM.

Update #3459.
2018-06-27 08:58:16 +02:00
Sebastian Huber
fbcd7c8fa6 bsps: Move start files to bsps
This patch is a part of the BSP source reorganization.

Update #3285.
2018-04-20 13:08:36 +02:00