Commit Graph

197 Commits

Author SHA1 Message Date
Sebastian Huber
634a2c0616 bsps/leon3: Auto initialization for printk()
Get rid of the hack to output into the idle stack during the early system
initialization.  This fixes also a couple of test program failures which fail
due to missing output.
2021-06-17 12:58:33 +02:00
Sebastian Huber
2c07f24af2 grlib: Add ambapp_plb()
Replace the global variable ambapp_plb with a function to allow an automatic on
demand initialization.
2021-06-17 12:58:33 +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
e10dec0fe7 bsps: Support RTEMS_NOINIT in linkcmds
Update #3866.
2021-05-02 18:41:21 +02:00
Vijay Kumar Banerjee
c90fa83041 bsps: Remove networking drivers
Update #3850
2021-04-07 16:15:38 -06:00
Daniel Hellstrom
dfe7901c7f leon: restart and load timer counter at initialization
Without this smp05 and smpthreadlife01 tests may fail
depending on how the boot loader initialized the GPTIMER.
Before the time counter stopped counting when reaching
zero, but tests could work since it could take 2^32 us
before stopping.

The timer driver will potentially overwrite this, but it
happens later due to the initialization order having
RTEMS_SYSINIT_CPU_COUNTER very early.
2021-03-11 17:35:27 +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
Ryan Long
f804778881 gr_cpci_gr740.c: Unchecked return value from library (CID #1437630)
CID 1437630: Unchecked return value from library in gr_cpci_gr740_init1().

Closes #4290
2021-03-05 14:00:07 -06:00
Ryan Long
570b558955 gr_leon4_n2x.c: Fix Unchecked return value from library (CID #1399767)
CID 1399767: Unchecked return value error from library in gr_cpci_leon4_n2x_init1().

Closes #4285
2021-03-05 14:00:06 -06:00
Sebastian Huber
ab97ea6443 bsp/leon3: Improve printk() support
Use the idle stack to buffer early uses of printk().  Print the buffered
characters during initialization when the UART is available and before
the idle stack is used normally.

This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
c44ab8984e bsp/leon3: Fix incompatible function types
This fix relates to a Coverity issue (PW.INCOMPATIBLE_PARAM).
2021-02-01 06:22:20 +01:00
Sebastian Huber
dc2a69871d bsp/leon3: Fix bsp_fatal_extension) indentation
Remove superfluous include.  Fix comment formatting.

This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
f8b6359415 bsp/leon3: Simplify bsp_interrupt_is_valid_vector()
There is not need to check that vector >= BSP_INTERRUPT_VECTOR_MIN since
BSP_INTERRUPT_VECTOR_MIN is zero and vector is unsigned.

This fix relates to CID 1399742 (NO_EFFECT).
2021-01-28 11:12:43 +01:00
Sebastian Huber
b361eabd93 bsps: Replace bsp_specs with an empty file
This fixes an issue with the latest tool chain which adds the default
linker script in the endfile specification.

Update #3250.
2021-01-28 06:28:33 +01:00
Sebastian Huber
350bba7a04 sparc: Add SPARC_INTERRUPT_SOURCE_TO_TRAP()
Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
828114778d sparc: Add SPARC_INTERRUPT_TRAP_TO_SOURCE()
Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
b7271f8c1e sparc: Add SPARC_IS_INTERRUPT_TRAP()
Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
db94626bc3 bsp/leon3: Updat due to API changes 2020-10-26 15:10:05 +01:00
Sebastian Huber
f9c8e14dcb grlib: Add ambapp_common_info to derived types
This avoids a cast in DEV_TO_COMMON().
2020-10-16 07:07:19 +02:00
Sebastian Huber
d7a48e1b25 rtems: Improve RTEMS_NO_RETURN attribute
Provide RTEMS_NO_RETURN also in case RTEMS_DEBUG is defined to prevent errors
like this:

error: no return statement in function returning non-void [-Werror=return-type]

Use C11 and C++11 standard means to declare a no-return function.

Close #4122.
2020-10-10 14:00:37 +02:00
Sebastian Huber
e1a0e0c308 grlib: Add and use irqmp_has_timestamp()
Replace leon3_irqmp_has_timestamp() with irqmp_has_timestamp() and move
it to grlib.h.

Close #4128.
2020-10-10 14:00:37 +02:00
Sebastian Huber
d556af3605 bsps: Always install IPI in SMP configs
The inter-processor interrupt (IPI) may be used to process per-CPU jobs.
See for example the blocked handler in T_interrupt_test().

Update #3199.
2020-08-31 16:19:53 +02:00
Sebastian Huber
fe6191f91a bsps/leon3: Remove superfluous includes 2020-08-20 14:54:18 +02:00
Chris Johns
7d00247497 testsuite: Add expected-fail to erc32, leon2, and leon3 BSPs
Updates #2962
2020-05-06 18:39:05 +10:00
Sebastian Huber
0161b93d50 imfs: Replace devfs with an IMFS specialization
Add a simplified path evaluation function IMFS_eval_path_devfs() for a
device only IMFS configuration.

The code size can be further reduced by the application if it disables
the support for legacy IO drivers via:

  #define CONFIGURE_IMFS_DISABLE_MKNOD
  #define CONFIGURE_IMFS_DISABLE_MKNOD_DEVICE

Obsolete CONFIGURE_MAXIMUM_DEVICES.  Remove BSP_MAXIMUM_DEVICES.

Update #3894.
Update #3898.
2020-03-09 17:26:54 +01:00
Sebastian Huber
c344e5828c Use RTEMS_SYSINIT_ORDER_LAST_BUT_5
Use RTEMS_SYSINIT_ORDER_LAST_BUT_5 instead of RTEMS_SYSINIT_ORDER_LAST
to allow applications and support functions to place system
initialization handlers behind the standard handlers.

Update #3838.
2020-02-04 06:06:42 +01:00
Sebastian Huber
eea21eaca1 bsps: Rework work area initialization
The work area initialization was done by the BSP through
bsp_work_area_initialize(). This approach predated the system
initialization through the system initialization linker set. The
workspace and C program heap were unconditionally initialized.  The aim
is to support RTEMS application configurations which do not need the
workspace and C program heap.  In these configurations, the workspace
and C prgram heap should not get initialized.

Change all bsp_work_area_initialize() to implement _Memory_Get()
instead.  Move the dirty memory, sbrk(), per-CPU data, workspace, and
malloc() heap initialization into separate system initialization steps.
This makes it also easier to test the individual initialization steps.

This change adds a dependency to _Heap_Extend() to all BSPs.  This
dependency will be removed in a follow up change.

Update #3838.
2020-02-04 06:06:41 +01:00
Sebastian Huber
07e2eacf89 bsps: Remove uses of BSP_GET_WORK_AREA_DEBUG
The code covered by BSP_GET_WORK_AREA_DEBUG was basically dead code
since there was no normal way to activate it (e.g. via a BSP
configuration option).  A follow up patch will bring back this feature
through a CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION configuration option.

Update #3838.
2020-02-04 06:06:30 +01:00
Sebastian Huber
be3d697450 bsp/erc32: Improve pseudo-SMP support
Add support for _SMP_Send_message() to the own processor.  This is
required by the smpmulticast01 test program.
2019-10-01 09:55:07 +02:00
Sebastian Huber
f9219db2a9 rtems: Add rtems_scheduler_get_processor_maximum()
Add rtems_scheduler_get_processor_maximum() as a replacement for
rtems_get_processor_count(). The rtems_get_processor_count() is a bit
orphaned. Adopt it by the Scheduler Manager. The count is also
misleading, since the processor set may have gaps and the actual count
of online processors may be less than the value returned by
rtems_get_processor_count().

Update #3732.
2019-04-09 08:06:46 +02:00
Sebastian Huber
03c9f24061 rtems: Add rtems_scheduler_get_processor()
Add rtems_scheduler_get_processor() as a replacement for
rtems_get_current_processor(). The rtems_get_current_processor() is a
bit orphaned. Adopt it by the Scheduler Manager. This is in line with
the glibc sched_getcpu() function.

Deprecate rtems_get_current_processor().

Update #3731.
2019-04-09 08:06:46 +02:00
Joel Sherrill
6163ab2c01 erc32/start/setvec.c: Fix warning 2019-03-25 16:27:43 -05:00
Sebastian Huber
828276b081 bsps: Adjust shared Doxygen groups
Update #3706.
2019-03-08 07:42:54 +01:00
Sebastian Huber
c991eeeccc bsps: Adjust bsp.h Doxygen groups
Update #3706.
2019-03-08 07:42:54 +01:00
Sebastian Huber
212663bede bsps: Adjust architecture Doxygen groups
- Use CamelCase as it is not used in our C code.  Enables simple search and
   replace.

 - Prefix with "RTEMS" to aid deployment and integration.  It aids
   searching and sorting.

Update #3706.
2019-03-04 07:51:38 +01:00
Jiri Gaisler
411c29735d grlib: make apbuart driver independent of bsp
Update #3678.
2019-01-22 12:48:19 +01:00
Sebastian Huber
7eb606d393 grlib: Move source files
Update #3678.
2019-01-22 12:46:33 +01:00
Sebastian Huber
3172092576 grlib: Move header files
Update #3678.
2019-01-22 12:46:28 +01:00
Sebastian Huber
c05d7a9d17 bsps/sparc: Fix warnings 2018-12-21 21:43:54 +01:00
Sebastian Huber
75e1009f1e bsps/sparc: Fix typo 2018-12-21 21:43:54 +01:00
Sebastian Huber
11f3b9a535 bsps/sparc: Add grlib_malloc(), grlib_calloc()
This avoids a dependency to errno in device driver code.
2018-12-21 14:54:13 +01:00
Sebastian Huber
0a1f5df98e Simplify _CPU_Counter_difference()
In order to simplify the use of CPU counter values it is beneficial to
have monotonic increasing values within the range of the CPU counter
ticks data type, e.g. 32-bit unsigned integer.  This eases the use of
CPU counter timestamps in external tools which do not know the details
of the CPU counter hardware.  The CPU counter is the fastest way to get
a time on an RTEMS system.

Such a CPU counter may be also used as the timecounter.  Use it on SPARC
for this purpose to simplify the clock drivers.

Update #3456.
2018-12-07 14:22:01 +01:00
Sebastian Huber
2e8b5de2b2 bsp/leon2: Move printk() support
Avoid assert() in console_inbyte_nonblocking().

Do not poll forever in bsp_in_char().  This allows the caller to decide
what to do if no character is available.

This entangles some dependencies and fixes a spconfig02 test failure.
2018-12-05 13:06:07 +01:00
Marçal Comajoan Cara
0446f68056 Spelling and grammar fixes in source code comments (GCI 2018) 2018-12-04 15:12:53 -06:00
Sebastian Huber
fdcba406db bsp/leon3: Fix CPU counter frequency 2018-12-04 16:11:05 +01:00
Sebastian Huber
a7267241a9 bsps/sparc: Add and use <grlib_impl.h>
Reduce copy and paste.
2018-11-27 08:06:53 +01:00