Commit Graph

117 Commits

Author SHA1 Message Date
Sebastian Huber
b5aceef5d9 bsps: Remove gicvx_interrupt_dispatch()
Avoid one level of indirection.

Update #4202.
2020-12-16 11:00:03 +01:00
Sebastian Huber
747fb65c6e bsps: Add GICv3 arm_gic_irq_processor_count()
Update #4202.
2020-12-16 11:00:03 +01:00
Christian Mauderer
21a0d20c68 bsps: Replace non-ASCII bullet points 2020-12-14 10:48:57 +01:00
Kinsey Moore
9edca35dbe bsps/gicv3: Resolve build warnings on 64bit 2020-12-11 15:32:15 -06: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
bd7bef528d bsps/arm: Support system level ARM Generic Timer
Update #4202.
2020-12-10 07:58:03 +01:00
Sebastian Huber
368fab5a82 bsps: Print CPU in default fatal error extension 2020-12-10 07:58:03 +01:00
Sebastian Huber
9ce47a52a4 bsps: Add SMP support to ARM GICv3
Update #4202.
2020-12-09 17:30:52 +01:00
Kinsey Moore
5686b44d13 zynq-uart: Fix set_attributes implementation
The zynq-uart set_attributes implementation was configured to always
return false which causes spconsole01 to fail. This restores the
disabled implementation which sets the baud rate registers
appropriately and allows spconsole01 to pass. This also expands the
set_attributes functionality to allow setting of the stop bits,
character width, and parity.
2020-12-03 17:35:28 -06:00
Kinsey Moore
a151ee167e bsps: Move ARM GICv2 driver to bsps/shared
This moves the ARM GICv2 driver to bsps/shared to be usable by AArch64
code.
2020-12-02 18:51:40 -06:00
Kinsey Moore
f0859573f9 bsps: Move zynq-uart to bsps/shared
This moves the zynq-uart driver from bsps/arm/shared to bsps/shared to
accomodate use by AArch64 BSPs.
2020-12-02 18:51:40 -06:00
Sebastian Huber
9c20b987cd rtems: Add <rtems/rtems/clockimpl.h> 2020-12-02 07:45:53 +01:00
Sebastian Huber
99c73303de rtems: Improve rtems_interrupt_server_create()
Also start interrupt server tasks on processors which do not have a
scheduler.  Applications may dynamically manage processors using
rtems_scheduler_remove_processor() and rtems_scheduler_add_processor().
2020-11-24 07:40:24 +01:00
Sebastian Huber
6c078901b2 doxygen: Use common syntax for groups 2020-11-23 10:36:46 +01:00
Jiri Gaisler
b4c29b54e7 Add networking support for griscv bsp
* Only GRETH device supported for now
	* Fix endian problem in GRETH driver
	* Remove SPARC assembly from greth.c
	* Builds with both autoconf and waf
2020-11-09 09:35:11 +01:00
Sebastian Huber
bb4e534014 bsps: Fix rtems_interrupt_server_delete()
The ISR lock must be destroyed to prevent memory corruption if RTEMS_PROFILING
and RTEMS_SMP is enabled.

Close #4158.
2020-10-19 17:44:49 +02: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
Frank Kühndel
f28a6defd1 disp_hcms29xx: Fix string truncation warning
The strlcpy() function ensures there is always a NUL character
at the end of the string. Hence it is safer as strncpy() and it avoids the
compiler warning
2020-10-10 15:04:15 +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
Kinsey Moore
cb2afd2eaa bsps/shared: Add PSCI-based bspreset implementation
This adds a bsp_reset implementation based on the ARM PSCI
specification often present in ARMv8 systems.
2020-10-05 16:11:39 -05:00
Kinsey Moore
f8ad5bb2a4 bsps: Break out AArch32 GICv3 support
This breaks out AArch32-specific code so that the shared GICv3 code can
be reused by other architectures.
2020-10-05 16:11:39 -05:00
Kinsey Moore
1480c3f5e8 bsps: Break out AArch32 portions of GPT driver
This breaks AArch32-specific portions of the ARM GPT driver into their
own file so that the generic code can be moved for reuse by other
architectures.
2020-10-05 16:11:39 -05:00
Kinsey Moore
1c03649312 Move ARM PL011 UART driver
This UART driver is now needed for BSPs other than ARM.
2020-10-05 16:11:39 -05:00
Sebastian Huber
29e7a069f8 dev/spi-memdrv: Fix use of uninit mem_param_ptr 2020-08-03 08:53:31 +02:00
Sebastian Huber
c60942ea5b rtems: Add rtems_interrupt_server_create()
Add rtems_interrupt_server_destroy().

Before this patch, the only way to create interrupt servers was
rtems_interrupt_server_initialize(). This function creates the default
interrupt server and in SMP configurations additional interrupt servers
for the additional processors. The interrupt server is heavily used by
libbsd. This includes the epoch based reclamation which performs time
consuming resource and memory deallocation work. This does not work well
with time critical services, for example an UART over SPI or I2C. One
approach to address this problem is to allow the application to create
custom interrupt servers with the right priority and task properties.
The interrupt server API accounted for this, however, it was not
implemented before this patch.

Close #4034.
2020-08-03 08:52:41 +02:00
Christian Mauderer
02c9eb8567 bsps/fdt: Make sure data is cache aligned
The cache of the fdt blob is flushed after copy. Therefore it should be
aligned.
2020-07-31 08:26:14 +02:00
Sebastian Huber
33314eb60a bsps/clock: Fix fast idle clock tick support
If we interrupt a thread dispatch critical section (thread dispatch
disable level != ISR nest level), then we should not do the fast idle
mode since this may delay an ongoing system call forever.
2020-07-23 08:56:06 +02:00
Sebastian Huber
479b2bfe87 rtems: Remove _Copyright_Notice from API header
Close #3981.
2020-07-14 07:25:46 +02:00
Jan Sommer
1483012b38 bsp/shared/clock: Reset Clock_driver_isrs to correct value
CLOCK_DRIVER_ISRS_PER_TICK is the configuration define,
CLOCK_DRIVER_ISRS_PER_TICK_VALUE is the actual value of ISRS per clock
tick, therefore use this one to reset the Clock_driver_isrs after each
tick.
2020-04-03 11:47:18 +02:00
Sebastian Huber
5662210311 bsps: Remove legacy interrupt API from default
This fixes linker issues on the powerpc/virtex4 and powerpc/virtex5
BSPs.
2020-03-13 15:20:30 +01:00
Sebastian Huber
51614bd5bf bsps/clock: Use _SMP_Get_processor_maximum()
Use a specific test to enable the fast idle mode instead of using the
rtems_configuration_is_smp_enabled() workaround.

Update #3876.
2020-02-25 07:18:35 +01:00
Dennis Pfau
7006f08b86 drvmgr: Fix determination of prefix in grlib uart driver
drvmgr_get_dev_prefix returns 0 if a prefix was found.
Therefore the if condition needs to check for 0, i.e. DRVMGR_OK.
2020-02-20 09:57:27 -07:00
G S Niteesh
5857e83cfc libchip/ns16550: Allow user calculate baud divisor
This patch will allow the user to pass a function to calculate
the baud divisor.
This will allow for more flexibility, since for some BSPs
like raspberrypi, the calculation of baud divisor is different
from what is in the current driver.
2020-02-16 16:55:20 +01:00
Sebastian Huber
2d07ce6d21 config: Add CONFIGURE_DIRTY_MEMORY
Replace the BSP_DIRTY_MEMORY BSP option with a CONFIGURE_DIRTY_MEMORY
configuration option.

Update #3843.
2020-02-06 15:19:36 +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
Gedare Bloom
739e3d0f72 bsps/irq: fix resource leak in irq-server.c
Resource leak identified by Coverity (CID 1456675). The value
of instances is leaked in case some but not all irq servers are
created. It should be stored in bsp_interrupt_server_instances.
2020-01-03 11:33:02 -07:00
Sebastian Huber
a00dff42cf rtems: Add and use rtems_object_get_local_node()
Update #3841.
2019-12-13 08:22:58 +01:00
Sebastian Huber
84aee2e982 mpci: Simplify MPCI configuration
Use watchdog for shared memory driver instead of a Classic API Timer.
2019-12-11 09:05:07 +01:00
Sebastian Huber
bb99cd0d83 clock: Simplify driver initialization
Use a system initialization handler instead of a legacy IO driver.

Update #3834.
2019-12-11 09:05:07 +01:00
Sebastian Huber
33ed4123c0 rtems: Add rtems_interrupt_server_entry_move()
The use case for this function is the libbsd.  In FreeBSD, the interrupt
setup and binding to a processor is done in two steps.  Message
based interrupts like PCIe MSI and MSI-X interrupts can be implemented
through interrupt server entries.  They are setup at the default
interrupt server and may optionally move to an interrupt server bound to
a specific processor.
2019-09-20 09:22:46 +02:00
Sebastian Huber
c331bdc777 record: Allow tracing of ISR disable/enable
Directly use the CPU port API in boot_card() to allow tracing of the
higher level interrupt disable/enable routines, e.g.
_ISR_Local_disable() and _ISR_Local_enable().  Currently, there is no
configuration option to enable this.  Below is a patch.  It may be used
to investigate some nasty low level bugs in the system.

Update #3665.

diff --git a/cpukit/include/rtems/score/isrlevel.h b/cpukit/include/rtems/score/isrlevel.h
index c42451d010..46d361ddc2 100644
--- a/cpukit/include/rtems/score/isrlevel.h
+++ b/cpukit/include/rtems/score/isrlevel.h
@@ -40,6 +40,10 @@ extern "C" {
  */
 typedef uint32_t   ISR_Level;

+uint32_t rtems_record_interrupt_disable( void );
+
+void rtems_record_interrupt_enable( uint32_t level );
+
 /**
  *  @brief Disables interrupts on this processor.
  *
@@ -56,8 +60,7 @@ typedef uint32_t   ISR_Level;
  */
 #define _ISR_Local_disable( _level ) \
   do { \
-    _CPU_ISR_Disable( _level ); \
-    RTEMS_COMPILER_MEMORY_BARRIER(); \
+    _level = rtems_record_interrupt_disable(); \
   } while (0)

 /**
@@ -72,10 +75,7 @@ typedef uint32_t   ISR_Level;
  *  _ISR_Local_disable().
  */
 #define _ISR_Local_enable( _level ) \
-  do { \
-    RTEMS_COMPILER_MEMORY_BARRIER(); \
-    _CPU_ISR_Enable( _level ); \
-  } while (0)
+  rtems_record_interrupt_enable( _level )

 /**
  *  @brief Temporarily enables interrupts on this processor.
@@ -98,9 +98,8 @@ typedef uint32_t   ISR_Level;
  */
 #define _ISR_Local_flash( _level ) \
   do { \
-    RTEMS_COMPILER_MEMORY_BARRIER(); \
-    _CPU_ISR_Flash( _level ); \
-    RTEMS_COMPILER_MEMORY_BARRIER(); \
+    rtems_record_interrupt_enable( _level ); \
+    _level = rtems_record_interrupt_disable(); \
   } while (0)

 /
2019-09-06 08:09:34 +02:00
Sebastian Huber
5ee70c5487 Add and use THREAD_DEFAULT_MAXIMUM_NAME_SIZE 2019-07-30 07:21:06 +02:00
Sebastian Huber
20bd667d8a bsps: Fix warnings in greth 2019-05-27 07:35:07 +02:00
Sebastian Huber
3b2481f9a7 score: Simplify _SMP_Multicast_action()
Move resposibility to disable thread dispatching to the caller of
_SMP_Multicast_action().  Using an interrupt disable for this purpose is
questionable.
2019-05-20 08:49:39 +02:00
Sebastian Huber
658700449d score: Add _SMP_Broadcast_action() 2019-05-20 08:49:39 +02:00
Sebastian Huber
45d06591f1 bsps: Always build generic interrupt support
This makes it possible to write tests for the generic interrupt
controller support.

Update #3269.
2019-05-16 07:29:24 +02:00
Sebastian Huber
df8d7bd76f score: Use processor mask in _SMP_Multicast_action
Processor_mask is the internal data type to deal with processor sets.
2019-04-12 09:44:48 +02:00
Sebastian Huber
ad87de4a67 score: Rename _SMP_Get_processor_count()
Rename _SMP_Get_processor_count() in _SMP_Get_processor_maximum() to be
in line with the API level rtems_scheduler_get_processor_maximum().

Update #3732.
2019-04-11 09:19:12 +02:00