Commit Graph

133 Commits

Author SHA1 Message Date
Joel Sherrill
7a9b240801 bsps/sparc: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Sebastian Huber
1b1ace7620 bsp/leon3: Fix warning 2022-03-08 08:12:47 +01:00
Sebastian Huber
cfeb3cbb68 bsp/leon3: Include missing header file
The <leon.h> include was removed from <bsp.h> in commit
1577a48369.
2022-03-08 08:12:47 +01:00
Sebastian Huber
f44e2c99cc bsp/leon3: Do not invalidate cache in SMP start
Since the trap table is now statically initialized, there is no need to
invalidate the instruction cache.
2021-12-13 07:32:58 +01:00
Sebastian Huber
044701eb8b bsp/leon3: Use interrupt entry for tm27 support
Using rtems_interrupt_entry_install() instead of
rtems_interrupt_handler_install() avoids a dependency on the dynamic memory
allocation.

Use Interrupt Manager directives instead of a BSP-specific API.  Use inline
functions.  In SMP configurations, set an affinity to all online processors and
raise the interrupt on the current processor.
2021-12-13 07:32:58 +01:00
Sebastian Huber
1179430fb4 bsp/leon3: Use interrupt entry for the SMP support
Using rtems_interrupt_entry_install() instead of
rtems_interrupt_handler_install() avoids a dependency on the dynamic memory
allocation.
2021-12-13 07:32:58 +01:00
Sebastian Huber
6318154199 bsp/leon3: Use interrupt entry for Clock Driver
Using rtems_interrupt_entry_install() instead of
rtems_interrupt_handler_install() avoids a dependency on the dynamic memory
allocation.
2021-12-13 07:32:58 +01:00
Joel Sherrill
dd70c81699 bsp_specs: Delete last remnants of these.
Updates #3937.
2021-11-29 08:50:03 -06:00
Sebastian Huber
db8f598d56 build: Remove old build system
Close #3250.
Close #4081.
2021-09-21 07:39:09 +02:00
Sebastian Huber
01d22f7f79 bsps/leon3: Rename fatal error code
Rename LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR in
LEON3_FATAL_INVALID_CACHE_CONFIG_BOOT_PROCESSOR since the term
"boot processor" is used elsewhere in the code base.
2021-09-02 09:22:38 +02:00
Sebastian Huber
75af5be6a8 bsp/leon3: Fix rtems_interrupt_is_pending()
Take the interrupt force register into account in all configurations.

Update #3269.
2021-08-12 21:06:39 +02:00
Sebastian Huber
8b65b57472 score: Canonicalize _CPU_Fatal_halt()
Move _CPU_Fatal_halt() declaration to <rtems/score/cpuimpl.h> and make sure it
is a proper declaration of a function which does not return.  Fix the type of
the error code.  If necessary, add the implementation to cpu.c.  Implementing
_CPU_Fatal_halt() as a function makes it possible to wrap this function for
example to fully test _Terminate().
2021-07-28 21:04:20 +02:00
Sebastian Huber
c7b4eca7fa bsps/irq: bsp_interrupt_facility_initialize()
Do not return a status code in bsp_interrupt_facility_initialize() since this
leads to unreachable code in bsp_interrupt_initialize().  Use RTEMS_DEBUG
assertions in bsp_interrupt_facility_initialize() if necessary.
2021-07-27 10:03:19 +02:00
Sebastian Huber
09be98d910 sparc/irq: Implement new interrupt directives
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
85a378510d bsps/irq: bsp_interrupt_set_affinity()
Return a status code for bsp_interrupt_set_affinity().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
23ec04c48c bsps/irq: bsp_interrupt_get_affinity()
Return a status code for bsp_interrupt_get_affinity().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
32f5a195d7 bsps/irq: bsp_interrupt_vector_disable()
Return a status code for bsp_interrupt_vector_disable().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
bc86a5fa84 bsps/irq: bsp_interrupt_vector_enable()
Return a status code for bsp_interrupt_vector_enable().

Update #3269.
2021-07-26 19:57:30 +02:00
Sebastian Huber
deb5afb2f2 bsps/irq: Add rtems_interrupt_is_pending()
Add a default implementation which just returns RTEMS_UNSATISFIED.

Update #3269.
2021-07-26 17:08:42 +02:00
Sebastian Huber
eebecd09fa bsps/irq: Add rtems_interrupt_get_attributes()
Add a default implementation which clears the attributes to zero and
just returns RTEMS_SUCCESSFUL for valid parameters.

Update #3269.
2021-07-26 17:08:42 +02:00
Sebastian Huber
9832652c53 bsps/irq: Add rtems_interrupt_raise()
Add rtems_interrupt_raise_on() and rtems_interrupt_clear().

Add a default implementation which just returns RTEMS_UNSATISFIED for
valid parameters.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
781213f9ec bsps/irq: Add rtems_interrupt_vector_is_enabled()
Add a default implementation which just returns RTEMS_UNSATISFIED for
valid parameters.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
1577a48369 bsp/leon3: Remove <leon.h> include form <bsp.h>
The <leon.h> header file contains a lot of implementation details.  Hide them
from <bsp.h>.
2021-07-19 16:28:26 +02:00
Sebastian Huber
c7b3df3f51 bsps/sparc: Improve interrupt affinity support
Fully support the interrupt extension API to set/get the interrupt affinity.
Remove LEON3_irq_to_cpu which defined the interrupt to processor mapping in a
BSP-specific way.

Update #3269.
2021-07-09 15:29:04 +02:00
Sebastian Huber
cb7d26845e bsp/leon3: Move bsp_interrupt_is_valid_vector()
This function is not performance critical.  There is no need to
implement it inline.
2021-07-01 16:43:35 +02:00
Sebastian Huber
52fb74ca65 bsp/leon3: Fix bsp_interrupt_is_valid_vector()
The fix to address CID 1399742 (NO_EFFECT) in commit
f8b6359415 introduced a bug since
LEON3_IrqCtrl_EIrq == -1 in case no extended interrupts are supported by
the interrupt controller.  Fix this by checking for
LEON3_IrqCtrl_EIrq > 0.

In addition, interrupt number 0 is reserved and should not be used.
2021-07-01 16:43:35 +02: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
5c30e3d376 bsps/sparc: Use rtems_interrupt_handler_install()
Avoid using set_vector() which depends on _ISR_Vector_table().  Prepare for a
statically initialized trap table.

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
94cf67ca66 bsps/irq: Remove BSP_INTERRUPT_VECTOR_MAX
This define is no longer used.

Update #3269.
2021-06-24 11:36:27 +02:00
Sebastian Huber
cd5573c09d bsps/irq: Add BSP_INTERRUPT_VECTOR_COUNT
Assert BSP_INTERRUPT_VECTOR_MAX + 1 == BSP_INTERRUPT_VECTOR_COUNT.

After building all BSPs with this patch, BSP_INTERRUPT_VECTOR_MAX can be
removed and replaced by BSP_INTERRUPT_VECTOR_COUNT.  The
BSP_INTERRUPT_VECTOR_COUNT allows a default implementation which supports no
interrupt vector at all.  Using COUNT instead of MAX may avoid some
interpretation issues, for example is the maximum value a valid vector number
or not.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
af73b7b64b bsps/irq: Remove BSP_INTERRUPT_VECTOR_MIN
Remove BSP_INTERRUPT_VECTOR_MIN and unconditionally let interrupt vector
numbers start with zero.

The BSP_INTERRUPT_VECTOR_MIN == 0 invariant was tested by the previous commit
and building all BSPs.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
a0a8262fd6 bsp/leon3: Fix compile error
Fix compile error with RTEMS_DRVMGR_STARTUP = True.
2021-06-23 08:12:49 +02:00
Sebastian Huber
af69a8693b grlib: Add apbuart_outbyte_wait() 2021-06-17 12:58:33 +02:00
Sebastian Huber
85febe7b10 grlib: Remove NL -> CR in apbuart_outbyte_polled()
This is already done in rtems_putc().
2021-06-17 12:58:33 +02:00
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