Commit Graph

14759 Commits

Author SHA1 Message Date
Sichen Zhao
8f550d2fa1 Add the i2c driver for Beaglebone Black
Update ticket #2891 and my GSOC project
add c/src/lib/libbsp/arm/beagle/i2c/bbb-i2c.c
modify c/src/lib/libbsp/arm/beagle/include/i2c.h
modify c/src/lib/libbsp/arm/beagle/include/bbb-gpio.h
modify c/src/lib/libcpu/arm/shared/include/am335x.h
modify c/src/lib/libbsp/arm/beagle/Makefile.am
Now can read the EEPROM by i2c, the test application link is: https://github.com/hahchenchen/GSOC-test-application
2017-06-14 12:11:31 -05:00
Sichen Zhao
7741545bfc Remove beagle old i2c code
modify c/src/lib/libbsp/arm/beagle/Makefile.am
modify c/src/lib/libbsp/arm/beagle/include/i2c.h
delete c/src/lib/libbsp/arm/beagle/misc/i2c.c
2017-06-14 11:47:58 -05:00
Alexei Pososin
fd10817a83 Remove excessive locking from cache operations.
According to manual, the used operations (Clean Line by PA, Clean and
Invalidate Line by PA, Cache Sync) are atomic and do not require
locking.

Update #3007.
2017-06-14 15:37:58 +02:00
Sebastian Huber
3f884b455f bsp: Fixes due to header file changes
Update #2833.
2017-06-13 11:38:39 +02:00
Sebastian Huber
0af8bb6c37 bsp: Include missing <sys/param.h>
Update #2833.
2017-06-12 15:40:53 +02:00
Sebastian Huber
74a13c86ea bsp/beatnik: Fixes due to header file changes
Update #2833.
2017-06-12 15:30:54 +02:00
Sebastian Huber
7b0c74ffb0 i386: Support thread-local storage (TLS)
Update #2468.
2017-06-12 08:01:58 +02:00
Sebastian Huber
f256685aa3 bsp/psim: Include missing <sys/param.h> 2017-06-09 07:55:16 +02:00
Sebastian Huber
6081ef31ae if_fxp: Include missing <inttypes.h>
Fix format warnings.
2017-06-09 07:54:45 +02:00
Sebastian Huber
32b4a0c427 Simplify TLS support in context switch
There is no need to save the thread pointer in _CPU_Context_switch()
since it is a thread invariant.  It is initialized once in
_CPU_Context_Initialize().
2017-06-09 07:30:41 +02:00
Christian Mauderer
ce3ac00cfc bsps/arm: Fix ARMv7-M interrupt suppport
Enable/disable vector routines now check for a valid vector.  Without
these guards, the enable/disable vector routines will not work with the
interrupt server.
2017-06-07 13:22:12 +02:00
Sebastian Huber
787f51f5b3 Do not include <sys/ioctl.h> in kernel-space
Update #2833.
2017-06-07 13:02:08 +02:00
Sebastian Huber
93531e9b08 Move RTEMS-specific Termios API content
Remove obsolete support for OFILL, OFDEL, NLDLY, CRDLY, BSDLY, VTDLY,
and FFDLY which is not present on FreeBSD and not implemented in Linux.

Update #2833.
2017-06-07 12:57:39 +02:00
Sebastian Huber
cf54965493 network: Include missing <inttypes.h>
Update #2833.
2017-06-07 07:44:12 +02:00
Sebastian Huber
3623c400ff ada-tests/spatcb01: New test
Update #2289.
2017-06-02 10:31:56 +02:00
Sebastian Huber
7203b70be0 bsp/motorola_powerpc: Fix for Binutils 2.28+
There are mismatched sections in the bootloader input:

ld: Warning: ticker.exe uses hard float, ticker.ralf uses soft float
ld: ticker.exe: compiled normally and linked with modules compiled with -mrelocatable
ld: failed to merge target specific data of file ticker.exe

Suppress this error explicitly.
2017-06-01 19:08:47 +02:00
Sebastian Huber
697a6ca05a bsps/powerpc: Set output format in linker script
Set the proper output format in the linker script for the bootloader.
Otherwise the generic linker is used since Binutils 2.28 which does not
understand the PowerPC-specific relocations.
2017-06-01 19:00:38 +02:00
Phong Pham
848007c068 Add support for IBM PowerPC 750 chip.
Closes #3015.
2017-05-29 08:04:43 +02:00
Sebastian Huber
afa5b894b2 ada: Remove task notepad support
Update #2493.
2017-05-29 08:01:54 +02:00
Sebastian Huber
783fbcec35 ada: Update due to Clock Manager API changes
Update #2676.
2017-05-29 08:01:54 +02:00
Sebastian Huber
9ff0f40ca0 ada: Remove <rtems/debug.h> support
Update #2477.
2017-05-29 08:01:54 +02:00
Chris Johns
7ec982bfeb build-system: Fix the targets support for the parallel build. 2017-05-26 10:35:17 +10:00
Chris Johns
ff781cc00f m32c/m32csim: Exclude linpack from the tests.
Closes #3025.
2017-05-25 15:10:11 +10:00
Chris Johns
a748603cb4 build-system: Parallel build all subdirs. 2017-05-24 19:59:22 +10:00
Chris Johns
9935c23f6a arm/tms570: Update preinstall.am after bootstrap. 2017-05-24 09:26:29 +10:00
Jacob Hansen
bc470d3c49 sparc: only define start if it is different from SYM(start)
The SYM define concatenates the input with the compiler set
__USER_LABEL_PREFIX__ define. This define appears to be '_' in GCC but
empty in Clang. Therefore when compiling with Clang/LLVM 'SYM(start)'
and 'start' defines the same symbol, and the compiler complains that the
symbol is defined twice.
2017-05-14 12:32:01 +02:00
Jacob Hansen
863968599c sparc: Adjust assembly to improve compability with LLVM
- All references of %0 changed to %g0

- 'call label,0' changed to 'call label'. According to the sparc
  specification call does not take any registers

- '.seg "text"' changed to '.section ".text"'

- the synonym stub is replaced with stb

- the synonym stuh is replaced with sth
2017-05-14 12:32:00 +02:00
Daniel Hellstrom
1ea73e2b5f leon, grtc: SMP support by using spin-locks 2017-05-14 12:32:00 +02:00
Daniel Hellstrom
818f10bc6c leon, grtc: updated overrun condition handling
The following functions now reports to the user that an overrun has
occured by returning errno EIO:
 * grtc_read, on overrun and no more data in the DMA buffer
 * ioctl(GRTC_IOC_RECV), on overrun and no more frames in the DMA buffer
 * ioctl(GRTC_IOC_ISSTARTED), EIO is returned on overrun
2017-05-14 12:32:00 +02:00
Daniel Hellstrom
6fdded2c75 leon, gr1553bm: SMP support by using spin-locks 2017-05-14 12:32:00 +02:00
Daniel Hellstrom
3feae3bc82 leon, gr1553bc: SMP support by using spin-locks
Since DMA buffers are managed by the user, responsibility is put on
the user to cope with SMP in the application.
2017-05-14 12:32:00 +02:00
Daniel Hellstrom
84e4d10ca3 leon, apbuart: remove old RAW UART driver
This driver was initially intended for APBUART access on GRLIB PCI
peripherals (AMBA-over-PCI). There are already many APBUART drivers
for LEON. Instead of using this one the termios APBUART should work
on AMBA-over-PCI systems with recent changes on LEON3, however that
has not been tested yet.
2017-05-14 12:32:00 +02:00
Daniel Hellstrom
c92f402ca9 leon, grtm: SMP support by using spin-locks 2017-05-14 12:31:59 +02:00
Daniel Hellstrom
f767fe74f5 leon, ahbstat: remove printf warnings 2017-05-14 12:31:59 +02:00
Daniel Hellstrom
ce76b9d295 leon, pci-peripherals: SMP support by spin-locks and updated genirq 2017-05-14 12:31:59 +02:00
Daniel Hellstrom
8670c46470 leon, genirq: SMP support for PCI peripherals
The common interrupt layer for GRLIB PCI perihperals is prepared for SMP
support by this patch. The existing locking (interrupt disabling) is
replaced by a new requirement on the user to implement locking before
calling the genirq API. This approach avoids taking more locks than
necessary.

The split up of the locks also introduces that the user must allocate
memory to describe ISR handlers, to avoid calling malloc()/free() while
possessing a spin-lock and interrupts are globally disabled.
2017-05-14 12:31:59 +02:00
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