Commit Graph

139 Commits

Author SHA1 Message Date
Sebastian Huber
5babc54d8d validation: Task create/construct
Run the task create/construct tests also on validation test suite 1
which has exactly one processor configured.
2021-03-16 12:47:52 +01:00
Eshan dhawan
a26a326e55 Test suite for FTW.H methods
Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
2021-03-11 11:40:13 -06:00
Daniel Hellstrom
b2da982c87 leon,tn-0018: work around GRLIB-TN-0018 errata
Overview
========

The errata is worked around in the kernel without requiring toolchain
modifications. It is triggered the JMPL/RETT return from trap instruction
sequence never generated by the compiler and. There are also other
conditions that must must be true to trigger the errata, for example the
instruction that the trap returns to has to be a JMPL instruction. The
errata can only be triggered if certain data is corrected by ECC
(inflicted by radiation), thus it can not be triggered under normal
operation. For more information see:
	 www.gaisler.com/notes

Affected RTEMS target BSPs:
 * GR712RC
 * UT699
 * UT700/699E

The work around is enabled by defining __FIX_LEON3_TN0018 at build time.
After applying the following GCC patch, GCC will set the define when
compiling for an affected multilib:
  * GR712RC (-mcpu=leon3 -mfix-gr712rc)
  * UT700/UT699E (-mpcu=leon3 -mfix-ut700)
  * UT699 (-mcpu=leon -mfix-ut699)
When building for another multilib and TN0018 is still required, it
is possible to enable it on the RTEMS kernel configure line using the
TARGET_CFLAGS (-D__FIX_LEON3FT_TN0018) or other by other means.

The following GCC patch sets __FIX_LEON3FT_TN0018 for the affected RTEMS
multilibs:
---------
diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h
index 6570590..ddec98c 100644
--- a/gcc/config/sparc/rtemself.h
+++ b/gcc/config/sparc/rtemself.h
@@ -33,6 +33,8 @@
        builtin_assert ("system=rtems");        \
        if (sparc_fix_b2bst)                    \
          builtin_define ("__FIX_LEON3FT_B2BST"); \
+       if (sparc_fix_gr712rc || sparc_fix_ut700 || sparc_fix_ut699) \
+         builtin_define ("__FIX_LEON3FT_TN0018"); \
     }                                          \
   while (0)
---------

Workaround Implementation
=========================

In general there are two approaches that the workaround uses:
 A) avoid ECC restarting the RETT instruction
 B) avoid returning from trap to a JMPL instruction

Where A) comes at a higher performance cost than B), so B) is used
where posssible. B) can be achived for certain returns from trap
handlers if trap entry is controlled by assembly, such as system calls.

A)
A special JMPL/RETT sequence where instruction cache is disabled
temporarily to avoid RETT containing ECC errors, and reading of RETT
source registers to "clean" them from incorrect ECC just before RETT
is executed.

B)
The work around prevents JMPL after system calls (TA instruction) and
modifies assembly code on return from traps jumping back to application
code. Note that for some traps the trapped instruction is always
re-executed and can therefore not trigger the errata, for example the
SAVE instruction causing window overflow or an float instruction causing
FPU disabled trap.

RTEMS SPARC traps workaround implementation:
   NAME                 NOTE   TRAP   COMMENT
 * window overflow         1 - 0x05   always returns to a SAVE
 * window underflow        1 - 0x06   always returns to a RESTORE
 * interrupt traps         2 - 0x10..1f special rett sequence workaround
 * syscall                 3 - 0x80   shutdown system - never returns
 * ABI flush windows       2 - 0x83   special rett sequence workaround
 * syscall_irqdis          4 - 0x89
 * syscall_irqen           4 - 0x8A
 * syscall_irqdis_fp       1 - 0x8B   always jumps back to FP instruction
 * syscall_lazy_fp_switch  5 - 0x04   A) jumps back to FP instruction, or to
                                      B) _Internal_error() starting with SAVE

 Notes:
 1) no workaround needed because trap always returns to non-JMPL instruction
 2) workaround implemented by special rett sequence
 3) no workaround needed because system call never returns
 4) workaround implemented by inserting NOP in system call generation. Thus
    fall into 1) when workaround is enabled and no trap handler fix needed.
 5) trap handler branches into both 1) and returning to _Internal_error()
    which starts with a SAVE and besides since it shuts down the system that
    RETT should never be in cache (only executed once) so fix not necessary
    in this case.

Any custom trap handlers may also have to be updated. To simplify that,
helper work around assembly code in macros are available in a separate
include file <libcpu/grlib-tn-0018.h>.

Close #4155.
2021-03-11 17:35:28 +01:00
Daniel Hellstrom
b57436c8fc leon3: avoid dependency on apbuart/timer driver
Moves drvmgr_drivers[] from amba.c to a separate file in order
to avoid the dependecy on APBUART/GPTIMER drivers. This has
an effect when user configured not to use timer or uart
in their project.
2021-03-11 17:35:27 +01:00
Daniel Hellstrom
9bf8a9d147 leon,grcan: split out GRCAN non-FD specific support in separate file
Close #4324.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
9c76ca0c0c leon,grcanfd: split out GRCANFD specific support in separate file
Update #4324.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
cff99cf1fa leon,can: introduce common CAN baud-rate calculation function
Reimplemented the baud-rate algorithm from scratch to cope with
GRCAN, GRCANFD and OC_CAN devices.

Update #4323.
2021-03-11 17:31:21 +01:00
Jan Sommer
06129897a9 bsps/xilinx_zynq: Add SPI driver to waf
Updates #4320
2021-03-10 20:12:08 +01:00
Sebastian Huber
ba48f20e2a build: Fix broken link 2021-03-09 13:03:15 +01:00
Alex White
10db41e6f1 spec/aarch64: Enable previously disabled tests
This enables several testsuites that were initially disabled during
development.
2021-03-08 15:18:51 -06:00
Kinsey Moore
f662420667 spec/aarch64: Rename ZynqMP QEMU BSPs
The current ZynqMP BSPs don't have _qemu in their name as do all other
RTEMS BSPs that are specifically made to run on QEMU. This fixes the
naming for those ZynqMP BSP variants for easier identification.
2021-03-05 10:40:28 -06:00
Kinsey Moore
9d77c0f425 spec: Move hypervisor start for use by AArch64
AArch64 on hardware is often started at EL2 instead of EL1 from either
u-boot or a first stage bootloader. This allows RTEMS to drop from EL2
execution to EL1 to operate as normal.
2021-03-05 08:43:15 -06:00
Alex White
0729781234 spec/aarch64: Remove sp37 from intermittent tests 2021-03-05 08:43:15 -06:00
Kinsey Moore
6bfbfb5a3d bsps/aarch64: Resolve usage of SUBALIGN()
Remove usage of SUBALIGN() in aarch64 linkcmds which works around a
difference in behavior on AArch64 platforms. This is no longer necessary
since alignment is now enforced explicitly.

Closes #4178.
2021-03-05 08:43:15 -06:00
Sebastian Huber
8fe59be236 validation: Fix for 64-bit targets
Closes #4179.
2021-03-04 09:08:03 +01:00
James Fitzsimons
db86c3eb4f bsps/beagle: Adding QEP driver support to BeagleBoneBlack BSP 2021-03-02 19:48:48 +01:00
Sebastian Huber
08cbd4ba20 score: Fix _Stack_Extend_size()
Check for an integer overflow.  Add a validation test for task create
errors.
2021-03-01 07:18:14 +01:00
Sebastian Huber
2428a8caf2 build: Install <rtems/score/hash.h>
Update #4267.
2021-02-26 09:57:05 +01:00
Sebastian Huber
74eff26c1d libtest: Report target hash
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
7480c34698 bsps: Add default rtems_get_target_hash()
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
dea125d02c score: Add Hash Handler
Update #4267.
2021-02-26 09:10:07 +01:00
Sebastian Huber
d8bfa5a9bc rtems: Add rtems_get_build_label()
Update #4269.
2021-02-25 16:16:16 +01:00
Sebastian Huber
e8284a3458 build: Sort source lists
Use the Python sorted() function to sort the "source" lists.
2021-02-24 09:22:54 +01:00
Sebastian Huber
88543adeb5 score: Remove _CORE_barrier_Do_flush()
Call _Thread_queue_Flush_critical() directly.
2021-02-24 09:22:36 +01:00
Sebastian Huber
f6a97f5992 rtems: Simplify signal handling
Remove superfluous ASR_Information::signals_posted.  Move code out of
trivial inline functions.

Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
3e7d658033 validation: Add signal manager tests
Update #4244.
2021-02-20 15:18:48 +01:00
Sebastian Huber
f38c0de407 validation: Add Validation1 test suite
Update #4244.
2021-02-20 15:18:48 +01:00
Chris Johns
e1676c1a0d Update motorola_power to irq-generic interrupt management
- Add support to the BSP to enable irq-generic management

- Update the powerpc shared irq code to support irq-generic. This
  is an opt in option for existing powerpc bsps. This change
  should be simpler now

- Fix a number of issues in ISA IRQ controller handling by porting
  fixes from the i386 (PC) BSP

Closes #4238
Closes #4239
2021-02-13 13:26:07 +11:00
Chris Johns
03dff2019f libcsupport: Add sbrk greedy support to consume all sbrk memory
- Move the heap sbrk code into a separate routnine.

- Update heap and workspace greedy allocators to use the common
  sbrk greedy support.

Closes #3982
2021-02-10 17:28:32 +11:00
Sebastian Huber
e59efd8835 validation: Tests for barrier manager 2021-02-08 08:44:14 +01:00
Sebastian Huber
c9ceff92c3 validation: Add tests for rtems_build_name() 2021-02-08 07:52:42 +01:00
Sebastian Huber
9477d9aedb score: Make FIFO thread queue ops public
Update #4230.
2021-02-06 20:55:51 +01:00
Sebastian Huber
51e59d59b7 nios2: Allow ISR nesting in dispatch variant
Rename _Nios2_ISR_Dispatch_with_shadow_non_preemptive() in
_Nios2_ISR_Dispatch_with_shadow_register_set().  Remove
_Nios2_ISR_Dispatch_with_shadow_preemptive().
2021-02-01 06:26:18 +01:00
Sebastian Huber
9eb9813dc1 bsps: Add missing DWARF 5 sections
Sort alphabetically.
2021-01-26 15:29:36 +01:00
Sebastian Huber
40c4e2ecc3 build: Add test excludes 2021-01-26 07:17:50 +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
Christian Mauderer
c45da42b7a bsps/shared: Build fsl-edma only for certain BSP
Move the Freescale EDMA driver to it's own object and build it only for
the BSP that is currently using it.
2021-01-22 15:51:14 +01:00
Christian Mauderer
36b4e8c394 bsps/imxrt: Add ioctl to LPSPI to get registers
This allows an application to get the registers of the LPSPI. That is
usefull for applications that want to use DMA for a very specialized and
highly optimized communication.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
a434cc80cb bsps/shared: Adapt fsl-edma driver for imxrt
Note: The changes have been done with portability in mind. The driver
should (in theory) be able to replace the original one in the MPC BSPs
too. For full compatibility an adaption layer and especially a test
would be necessary. Because both are missing, don't integrate it into
the MPC BSP now.

Update #4180
2021-01-21 10:17:31 +01:00
Sebastian Huber
6600585fc8 bsp/stm32h7: Split console configuration
This allows applications to individually provide configuration
structures.

Update #4209.
2021-01-04 19:23:15 +01:00
Sebastian Huber
affc8de85f bsp/stm32h7: Split start configuration
This allows applications to individually provide configuration
structures.

Update #4209.
2021-01-04 19:22:53 +01:00
G S Niteesh Babu
f867e7b6f4 libtests/ofw01: Added a test for RTEMS OFW
This commit adds a basic test that tests all the implemented
RTEMS OFW functions.
2020-12-27 10:05:09 +01:00
G S Niteesh Babu
9d2ed41fcb bsps/shared/ofw: Implement RTEMS OFW interface
RTEMS OFW is a FDT only implementation of the OpenFirmWare
interface. This API is created to be compatible with FreeBSD
OpenFirmWare interface. The main intention is to make
porting of FreeBSD drivers to RTEMS easier.

Most functions implemented have an direct one-one mapping
with the original OFW API and some extra auxiliary functions
were implemented to make working with device trees easier in
RTEMS.

Update #3784
2020-12-27 10:05:02 +01:00
Sebastian Huber
81c7f5be92 arm/fvp: New BSP
This BSP supports the Arm Fixed Virtual Platform.  Only the Cortex-R52
processor configuration is supported by the BSP.  It should be easy to
add support for other variants if needed.

Update #4202.
2020-12-23 09:24:49 +01:00
Sebastian Huber
9f3a08ef2d bsps: Use header file for GIC architecture support
This avoids a function call overhead in the interrupt dispatching.

Update #4202.
2020-12-23 09:24:49 +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
854ea2b4d8 arm: Add support for Arm PMSAv8-32
Update #4202.
2020-12-22 13:02:41 +01:00
Sebastian Huber
d3f2ecc87a build: Fix duplicate install of jffs2.h 2020-12-16 07:12:25 +01:00
Christian Mauderer
9b3def237a bsps/arm/imx*: Fix location of shared headers
When moving the headers from the imx BSP to the shared area, the wrong
directory has been selected. This patch fixes that problem.

Update #4180
2020-12-14 11:29:36 +01:00
Christian Mauderer
b63a187ec0 bsps/imxrt: Split up dts.
This allows simpler creation of own dts files for custom boards.

Update #4180
2020-12-14 11:10:38 +01:00