Commit Graph

48 Commits

Author SHA1 Message Date
Joel Sherrill
8ca4b5c8bb bsps/arm/shared: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Karel Gardas
635cd68aa7 bsp/arm: allocate .rtemsstack on REGION_STACK instead of on REGION_WORK
REGION_WORK may be backed by external RAM which may not be initialized
in a time we need stack to work well. E.g. code loaded in flash,
stack allocated on in-cpu SRAM and data (REGION_WORK) on external SDRAM.

Sponsored-By:	Precidata
2022-05-23 08:36:41 +02:00
Sebastian Huber
e7a2470d06 bsps/arm: Fix bsp_start_memcpy() for ARMv7-AR
Synchronize data and instruction streams.
2022-03-14 09:23:54 +01:00
Joel Sherrill
ba619b7f36 bsps/arm/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Sebastian Huber
59472042ec bsps/arm: More robust SMP start
Do not continue execution on processors which are not configured to prevent the
use of arbitrary memory for the initialization stack.
2021-08-12 10:04:11 +02:00
Sebastian Huber
a398909dc2 bsps/arm: Fix SMP start
Skip the data cache initialization if we are a secondary processor.

The bug was introduced by e164df5e33 and
did not show up in tests using Qemu since the data cache behaviour is
not emulated.
2021-07-09 10:43:10 +02:00
Pranav Dangi
8b0e333487 bsps/arm: Add start up support for ARMv6 RPi Models 2021-07-07 20:09:47 +02:00
Sebastian Huber
3fee662093 bsps/irq: Use BSP_INTERRUPT_VECTOR_COUNT
Use BSP_INTERRUPT_VECTOR_COUNT instead of BSP_INTERRUPT_VECTOR_MAX.

Update #3269.
2021-06-24 11:36:25 +02:00
Sebastian Huber
e10dec0fe7 bsps: Support RTEMS_NOINIT in linkcmds
Update #3866.
2021-05-02 18:41:21 +02:00
Sebastian Huber
2a24f99d11 bsps/arm: Set MSP in ARMv7-M start code
Set the Main Stack Pointer (MSP) to the ISR stack area end just in case
we run using the Process Stack Pointer (PSP).  This helps if
applications are started by a boot loader.
2021-04-21 07:04:53 +02:00
Sebastian Huber
9eb9813dc1 bsps: Add missing DWARF 5 sections
Sort alphabetically.
2021-01-26 15:29:36 +01:00
Sebastian Huber
33c12d5f92 bsps: Support DWARF 5 sections
GCC 11 uses DWARF 5 by default.
2021-01-25 12:56:00 +01:00
Sebastian Huber
23d9223ad3 bsps/arm: Invalidate TLB in start.S
Update #4202.
2020-12-23 09:24:47 +01:00
Sebastian Huber
e164df5e33 bsps/arm: Clear SCTLR[M, I, A, C] in start.S
Initialize the data and unified cache levels.  Invalidate the
instruction cache levels.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
46a3c0446f bsps/arm: Remove optional start hook arguments
The start hook arguments are not used by a BSP.  Removing them avoids
the need for a stack during the very early system initialization.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
76a1a53780 bsps/arm: Invalidate branch predictors earlier
Make sure the branch predictors are invalidated before the first branch
is executed.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
272534eb72 bsps/arm: Set VBAR in start.S
Set the VBAR to the vector table in the start section before
bsp_start_hook_0() is called to earlier handle exceptions in RTEMS.

Set the VBAR to the normal vector table in start.S for the main
processor.  Secondary processors set it in bsp_start_hook_0().

Update #4202.
2020-12-23 09:19:17 +01:00
Sebastian Huber
105e52032e bsps: Remove ARM GIC SGI target filter
Remove the target filter for software-generated interrupts since this
feature is not supported by the affinity routing in GICv3.

Update #4202.
2020-12-10 09:42:50 +01:00
Sebastian Huber
b6925e10c8 bsps: Fix GICv3 arm_gic_trigger_sgi()
Use the targets parameter to determine the targets of the SGI.  Change
targets parameter type to 32-bit to ease the parameter passing.  GICv3
supports up to 16 targets.

Update #4202.
2020-12-10 09:42:49 +01:00
Sebastian Huber
273613f1a8 bsps/arm: Sort fast text/data sections 2020-10-21 07:58:38 +02:00
Sebastian Huber
3fccdc956c bsps/arm: Add support for MPU region alignment
Update #3910.
2020-10-21 07:58:34 +02:00
Sebastian Huber
95d37b6307 bsps/arm: Use _Assert() 2020-08-20 14:54:18 +02:00
Sebastian Huber
51307919b4 arm: ARMv7-M statically initialized vector table
Statically initialize the ARMv7-M vector table to allow a placement in
ROM with read-only MPU settings.

Change licence to BSD-2-Clause in some files.
2020-04-03 09:12:44 +02:00
Sebastian Huber
32991495b4 score: Statically allocate idle/MPCI stacks
Place idle and MPCI stacks into extra linker sections.  This can be
optionally used by applications to control the placement of the stacks.

Update #3835.
2020-02-12 09:08:36 +01:00
Sebastian Huber
ffa1153170 bsps: Add RamEnd to linker command files
Update #3838.
2020-02-04 05:52:28 +01:00
Sebastian Huber
2497da06de bsps/arm: Export bsp_start_hook_0_done
Close #3789.
2019-12-19 10:59:20 +01:00
Jeff Kubascik
001cd9bd5c bsps/arm: Add zImage boot header
Xen currently only supports the zImage loader for 32 bit guests on ARM
targets.
2019-12-05 07:25:52 +01:00
Sebastian Huber
1e6380baf2 bsps/arm: Move HYP to SVC change to start.S
This fixes the corruption of r3 by the call to
bsp_start_arm_drop_hyp_mode().

Moving the code makes it easier to review changes in start.S.

Close #3773.
2019-07-26 08:12:20 +02:00
Sebastian Huber
0ee2125a92 bsps/arm: Move register init to start.S
This makes it easier to review changes in start.S.

Update #3773.
2019-07-26 08:00:48 +02:00
Sebastian Huber
0f5c1d5344 bsps/arm: Remove register init for ARMv7-M
There are no known ARMv7-M chips with a dual lockstep mode.

Update #3773.
2019-07-26 08:00:39 +02:00
Sebastian Huber
3fe215502a Remove superfluous <rtems/system.h> includes 2019-03-14 13:13:27 +01:00
Sebastian Huber
feea03b625 Remove explicit file names from @file
This makes the @file documentation independent of the actual file name.

Update #3707.
2019-02-28 11:47:33 +01:00
Sebastian Huber
bdec62c4d5 bsps/arm: Move device tree copy
Move device tree copy operation after the mode initialization so that
bsp_fdt_copy() uses the initialization stack and not the stack provided
up by the boot loader.
2019-02-18 09:01:27 +01:00
Sebastian Huber
95c19211d1 bsps/arm: Remove unused bsp_stack_irq_size
Update #3459.
2019-01-21 09:17:51 +01:00
Sebastian Huber
e0caabe08d bsps/arm: Avoid short range branch in start.S 2018-11-21 07:48:23 +01:00
Sebastian Huber
faafc22928 bsps/arm: Use local labels in start.S 2018-11-21 07:48:23 +01:00
Sebastian Huber
945291312c bsps/arm: Simplify start.S
The boot_card() function does not return.
2018-11-21 07:48:23 +01: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
Sebastian Huber
186a0b1dc0 bsps/arm: Recognize .tm_clone_table input section 2018-10-15 10:40:31 +02:00
Sebastian Huber
511ef83ce4 bsps/arm: Fix ctor/dtor invocation order
Remove obsolete .ctor and .dtor output sections.
2018-10-09 12:01:27 +02:00
Sebastian Huber
0d362ff397 score: _SMP_Inter_processor_interrupt_handler()
Pass current processor control via parameter since it may be already
available at the caller side.
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
715d6167e0 bsps: Support .rtemsstack.* linker input sections
Use a dedicated memory region or place it between the BSS and workspace.

Update #3459.
2018-06-27 08:58:16 +02:00
Joel Sherrill
a3fe23ccbb Drop executable permissions on .[S] files 2018-05-14 15:22:52 -05:00
Sebastian Huber
864e72e400 bsps: Move arm-a9mpcore-smp.c to bsps
This patch is a part of the BSP source reorganization.

Update #3285.
2018-04-24 10:24:29 +02:00
Sebastian Huber
c3a4434314 bsps: Move bspreset.c to bsps
This patch is a part of the BSP source reorganization.

Update #3285.
2018-04-24 10:24:28 +02:00
Sebastian Huber
9964895866 bsps: Move startup files to bsps
Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.
2018-04-20 13:52:14 +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