| Commit message (Collapse) | Author | Files | Lines |
|
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.
Updates #3053.
|
|
Close #4324.
|
|
Update #4324.
|
|
The new GRCAN_FD IP supports CAN FD standard and is mostly backwards
compatible with GRCAN SW interface. The GRCAN driver have been extended
to support the GRCANFD IP using the same driver.
Additional functions have been added that uses a new CAN FD frame
format and read/write/baud-rate functions that supports both GRCANFD
and GRCAN. To keep the SW API fully backwards compatible with GRCAN,
the old functions remain.
Update #4324.
|
|
Update #4323.
|
|
CID 1437613: Unused value in grcan_set_filter().
This fix was recommended by Daniel Hellstrom (daniel@gaisler.com).
Closes #4301
|
|
Update #3678.
|
|
Update #3678.
|
|
Update #3678.
|
|
This avoids a dependency to errno in device driver code.
|
|
Reduce copy and paste.
|
|
This patch is a part of the BSP source reorganization.
Update #3285.
|
|
|
|
|
|
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.
|
|
this is to avoid owning the spin-lock during semaphore operations.
|
|
|
|
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().
|
|
|
|
There was a potential read-modify-write race on the interrupt mask (imr)
register between the ISR and user functions.
|
|
|
|
Locking the stats structure when copying to user buffer ensures a consistent
view to the user.
|
|
|
|
This commit does not contain any change of functionality.
|
|
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.
|
|
|
|
|
|
|
|
Some bugfixes at the same time. After this patch the drivers
may be used on RASTA systems having a big-endian PCI layout.
Removed not up to date changelogs, rely on git log instead.
|
|
|
|
|
|
|
|
|
|
Some register layout definitions for LEON3 reside in ambapp.h which
does not really has anything to do with device registers. The
register structures has been incorrectly named LEON3_*, the cores
are not only used on LEON3 but on LEON4 and perhaps on LEON5 when
that day comes. Some structures has been renamed according to the
GRLIB core name instead, which CPU that actually use it is not
relevant. Drivers has been updated with the new names.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
|
|
The drivers are updated to use the new AMBA layer, however the
backwards-compatibility interface (ambapp_old) is used.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
|
|
* shared/1553/b1553brm.c, shared/can/grcan.c, shared/can/occan.c,
shared/spw/grspw.c, shared/uart/apbuart.c:
Use "__asm__" instead of "asm" for improved c99-compliance.
|
|
|
|
* shared/can/grcan.c, shared/can/grcan_rasta.c,
shared/include/ambapp.h: GRCAN CAN driver. Fixes Interrupt
enabling/disabling in the driver, interrupt may not be restored
correctly. Implements the baud rate calculation routine. Removed
unnecessary printk. Fixed scanning to support GRCAN and GRHCAN
hardware. Added GRCAN device number to ambapp.h.
|
|
* shared/1553/b1553brm.c, shared/can/grcan.c: Remove include of sched.h
|
|
* shared/can/grcan.c, shared/include/debug_defs.h, shared/spw/grspw.c:
Remove use of DEBUG_printf.
|
|
* shared/1553/b1553brm.c, shared/can/grcan.c, shared/can/grcan_rasta.c,
shared/can/occan.c, shared/spw/grspw.c, shared/spw/grspw_pci.c,
shared/uart/apbuart.c: Remove warnings.
|
|
New drivers: PCI, b1553BRM, SpaceWire(GRSPW), CAN (GRCAN,OC_CAN),
Raw UART.
* shared/1553/b1553brm.c, shared/1553/b1553brm_pci.c,
shared/1553/b1553brm_rasta.c, shared/can/grcan.c,
shared/can/grcan_rasta.c, shared/can/occan.c, shared/can/occan_pci.c,
shared/spw/grspw.c, shared/spw/grspw_pci.c, shared/spw/grspw_rasta.c,
shared/uart/apbuart.c, shared/uart/apbuart_pci.c,
shared/uart/apbuart_rasta.c: New files missed in previous commit.
|