Commit Graph

30426 Commits

Author SHA1 Message Date
Martin Aberg
aa19873f68 leon: allow SMP boot from any CPU 2017-05-14 12:31:59 +02:00
Martin Aberg
039edd2adc leon, grcan: removed unused txerror, rxerror 2017-05-14 12:31:59 +02:00
Martin Aberg
ee078c217d leon, grcan: fixed historical comment 2017-05-14 12:31:59 +02:00
Daniel Hellstrom
9154155110 leon, grcan: semaphore reset count required after flushing
It is also required to use semaphore release instead of flush when stopping
or on BUSOFF/AHBERR condition. Otherwise a task just about to wait
(taking the semaphore) could end up locked because the semaphore count is
still the same.

There was previously a scenario where the semaphore flush would not always make
semaphore obtain to return in case of BUSOFF, AHBERROR or grcan_stop. It has to
do with the rtems_semaphore_flush() not releasing the semaphore but just aborts
any _current_ waiter.
2017-05-14 12:31:58 +02:00
Daniel Hellstrom
9855690300 leon, grcan: split hw_stop() into hw and sw stop
this is to avoid owning the spin-lock during semaphore operations.
2017-05-14 12:31:58 +02:00
Martin Aberg
3a650d3b2c leon, grcan: RTEMS_NO_TIMEOUT on tx_sem 2017-05-14 12:31:58 +02:00
Martin Aberg
2d3d8f96b2 leon, grcan: redesigned bus-off and AHB error handling
When bus-off condition is detected by the ISR, it sets the started flag to
STATE_BUSOFF. This is monitored by the user functions grcan_read() and
grcan_write() each time they want to enable DMA or update interrupt mask. If
they detect that ISR has detected bus-off then they will return either with an
error or with the number of CAN messages processed. Future calls to functions
which require STARTED mode will be rejected and grcan_isstarted() will return
0. The next call to grcan_stop() will do the transition from BUSOFF->STOPPED
and the device can then be started again with grcan_start().

Similar to a bus-off condition, the AHB error condition detected by the ISR
will trigger the same shut-down logic of the driver. The difference is that
the state entered is STATE_AHBERR and the routines will return a different
value to indicate AHB error state.

This commit also fixes an issue where ISR was not always unregistered on close.

User functions can cause these transitions:
  STATE_STOPPED -> STATE_STARTED (grcan_start)
  STATE_STARTED -> STATE_STOPPED (grcan_stop)
  STATE_BUSOFF  -> STATE_STOPPED (grcan_stop, grcan_close)
  STATE_AHBERR  -> STATE_STOPPED (grcan_stop, grcan_close)

ISR can cause these transition
  STATE_STARTED -> STATE_BUSOFF (grcan_interrupt)
  STATE_STARTED -> STATE_AHBERR (grcan_interrupt)

STATE_BUSOFF/AHBERR is entered from ISR on bus-off condition. At transition
the ISR disables DMA, masks all interrupts and flushes semaphores.

Other related updates:

 * Statistics are updated from the ISR. Update is now spin-locked to ensure a
   consistent user view.
 * The debug output has been updated to include state changes.
 * For read/write/flush, return error (-4) if driver aborted the operation
   due to bus-off. Likewise if abourted due to AHB error -5 is returned.
 * Collect bus-off statistics

Related to the new BUSOFF and AHBERR states the API has been updated to
reflect the current SW driver state. The isstarted() function has been
replaced with get_state().
2017-05-14 12:31:58 +02:00
Daniel Hellstrom
ca4c4164b5 leon, grcan: updated device name and use it for ISR 2017-05-14 12:31:58 +02:00
Martin Aberg
057496906f leon, grcan: fixed race on interrupt mask register
There was a potential read-modify-write race on the interrupt mask (imr)
register between the ISR and user functions.
2017-05-14 12:31:58 +02:00
Martin Aberg
5d367c56cf leon, grcan: unregister interrupt handler at close 2017-05-14 12:31:58 +02:00
Martin Aberg
c297060b11 leon, grcan: protect statistics on copy to user
Locking the stats structure when copying to user buffer ensures a consistent
view to the user.
2017-05-14 12:31:57 +02:00
Martin Aberg
7b8a920a27 leon, grcan: use RTEMS 4.12 SMP interrupt lock 2017-05-14 12:31:57 +02:00
Martin Aberg
bc40b4def8 leon, grcan: consistent indentation
This commit does not contain any change of functionality.
2017-05-14 12:31:57 +02:00
Martin Aberg
ad203e5887 leon, grcan: function based user interface
This commit preserves all driver services, using a function based user
interface instead of the I/O interface.

The messages count parameter is now number of CAN messages instead of
number of bytes.
2017-05-14 12:31:57 +02:00
Martin Aberg
229c42499e bsp/leon3: Cleaner namespace for LEON3 debug UART
Prefix BSP specific symbols with BSP name:
dbg_uart -> leon3_debug_uart
debug_uart_index -> leon3_debug_uart_index
2017-05-14 12:31:57 +02:00
Daniel Hellstrom
011efee813 leon, irq: single CPU SMP configuration does not need IPI ISR 2017-05-14 12:31:56 +02:00
Daniel Hellstrom
fa27fe5c82 leon, greth: new option and change soft-reset logic for EDCL 2017-05-14 12:31:56 +02:00
Daniel Hellstrom
8ac070ab99 leon, greth: 10/100 modes should be assigned in fastest priority 2017-05-14 12:31:56 +02:00
Daniel Hellstrom
e6fbd26fdb leon, greth: speed modes advertising now configurable 2017-05-14 12:31:56 +02:00
Daniel Hellstrom
1271813421 leon, greth: EDCL and DD is disabled during reset
The EDCL and Duplex-Detection are now disabled during soft-reset
of the GRETH core.

The speed settings are preserved on boot and greth_stop() also,
this is required to keep EDCL operational when DD is set.
2017-05-14 12:31:56 +02:00
Phong Pham
a9859d1a58 interrupt vector indexing is assuming BSP_INTERRUPT_VECTOR_MIN = 0
Closes #3014.
2017-05-13 23:10:25 -05:00
Phong Pham
f219adc3f8 missing a couple register names + a #ifndef_ASM__ around serial.h inclusion
Closes #3016.
2017-05-13 22:50:39 -05:00
Sebastian Huber
00d982080c sptests/spprivenv01: Use default task mode
There is no need to run the task with interrupts disabled.
2017-05-12 10:10:07 +02:00
Sebastian Huber
f778b7f3f1 confdefs.h: Use SMP scheduler only if necessary
Update #3001.
2017-05-12 08:35:36 +02:00
Sebastian Huber
1309718114 confdefs.h: CONFIGURE_DISABLE_SMP_CONFIGURATION
Enable the SMP configuration by default in case SMP is enabled.  Add
configuration option CONFIGURE_DISABLE_SMP_CONFIGURATION to disable it
explicitly.

Add CONFIGURE_DISABLE_SMP_CONFIGURATION to all test which would fail
otherwise.

Update #3001.
2017-05-11 11:40:44 +02:00
Sebastian Huber
0e4941701f bsps/arm: Fix bit field offset in GIC support
Update #3002.
2017-05-11 09:53:45 +02:00
Chris Johns
900c40730d testsuites: Build the tests in parallel if make is asked too. 2017-05-11 08:09:50 +10:00
Chris Johns
6130a47e72 testsuites: Fix build dependences for generated files. 2017-05-11 08:09:43 +10:00
Gedare Bloom
87de70a298 posix/mman: add mmap support for shm objects
Update #2859.
2017-05-05 10:34:08 -04:00
Chris Johns
8290f95cbd posix: Add mmap/unmap support for mapping files.
This version of mmap comes from early work done
on the RTL code base circa 2012.

Update #2859.
2017-05-05 10:34:08 -04:00
Gedare Bloom
bd9d5ebc33 posix/shm: replace threadq with mutex (allocator lock)
Closes #2957.
2017-05-05 10:34:08 -04:00
Gedare Bloom
889eb76731 posix/mman: update atime on shared memory read call
Update #2859.
2017-05-05 10:34:08 -04:00
Sebastian Huber
e0627c69b5 cpukit: Fix __RTEMS_REVISION__ define 2017-05-04 07:11:28 +02:00
Daniel Hellstrom
430949aa0d leon, greth: let Gbit full duplex override half 2017-05-02 12:34:50 +02:00
Daniel Hellstrom
998e34ad33 leon, greth: SMP support by using spin-lock protection 2017-05-02 12:34:50 +02:00
Martin Aberg
8927c0f8e7 leon, gptimer: offset intnum with subtimer index
If separate interrupts are not available, then do not add the timer hardware
index number when configuring interrupt affinity.
2017-05-02 12:34:49 +02:00
Martin Aberg
256e083ffb leon, gptimer: fixed probing separate interrupts
Probing of separate interrupts was done by storing the GPTIMER_CFG_SI bit. But
it was never actually stored since it is bit 8 and the datatype is 8-bit. Now
store the AND result as boolean value instead.
2017-05-02 12:34:49 +02:00
Javier Jalle
6234abe8bd leon, l4stat: Initial driver commit 2017-05-02 12:34:49 +02:00
Javier Jalle
21b3319f74 leon, ambapp: Added L4STAT driver to ambapp ids 2017-05-02 12:34:49 +02:00
Martin Aberg
a8595605c2 leon, occan: Converted disable/enable to SMP locks
This commit updates the OCCAN driver locking mechanism:
1. Convert interrupt disable/enable to interrupt locks.
2. Make sure interrupt service routines use proper locking to deal with threads
running in parallel.
2017-05-02 12:34:48 +02:00
Martin Aberg
c609cceabb leon, ahbstat: Use RTEMS 4.12 SMP interrupt lock 2017-05-02 12:34:48 +02:00
Javier Jalle
c241236139 leon, memscrub: add GR740 memory scrubber driver 2017-05-02 12:34:48 +02:00
Javier Jalle
d79429fa52 leon, griommu: add GR740 IOMMU driver
The driver is limited to the access protection bit-vector. It
currently does not support the IOMMU page-table functionality.
2017-05-02 12:34:48 +02:00
Javier Jalle
3e948ccadd leon, ambapp: Added GRIOMMU driver to ambapp ids 2017-05-02 12:34:48 +02:00
Javier Jalle
dfa8633805 leon, l2cache: add GR740 L2-Cache driver 2017-05-02 12:34:47 +02:00
Javier Jalle
d24ed5459b leon, ambapp: Added L2CACHE driver to ambapp ids 2017-05-02 12:34:47 +02:00
Javier Jalle
93c5e6376c leon, grpci2dma: add GR740 PCI DMA driver 2017-05-02 12:34:47 +02:00
Javier Jalle
31ba1f218a leon, grpci2: prepare for GRPCI2DMA driver 2017-05-02 12:34:47 +02:00
Javier Jalle
8e45d55303 leon, grpci2: Make driver SMP safe 2017-05-02 12:34:47 +02:00
Daniel Hellstrom
9631e5a9fc leon, ambapp: updated AMBA PnP IDs and names database 2017-05-02 12:34:47 +02:00