Commit Graph

29617 Commits

Author SHA1 Message Date
Pavel Pisa
3d3ad4dc1c arm/raspberrypi: VideoCore access corrections in cache operation and more error checking.
The first, mistake in buffer size computation for cache flush
and invalidate has been corrected.

GCC __attribute__( ( aligned( 64 ) ) ) should work and works for local
variables. Code ensures right stack alignment. But attribute has
to be moved to type declaration to ensure that structure size is affected
by attribute. But even this seems to not work reliably for some reason.
May it be, the stack area between frame start and end of local variable buffer
accessed during context switch or some stack prefetch during resturn
such way that some cache lines belonging to buffer are filled to cache.
Extending buffer by one more cache line padding helps there.

In the longer term perspective, buffer should be moved to some static
area or cache aligned dynamic memory allocated. Concurrent calls
to the VideoCore operations and access serialization should be added
too but problem is that some calls are required during workspace and MMU
setup so variant without need of mutex would be required as well.

Framebuffer setup code and other VideoCore calls check more
precisely for errors and do not proceed forward with incorrect
data now.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2016-07-31 11:33:06 +02:00
Gedare Bloom
842005e432 posix: nanosleep: optimize away a time conversion
updates #2732
2016-07-29 13:13:41 -04:00
Sebastian Huber
f383f4bf6e bsp/qoriq: Remove legacy U-Boot support 2016-07-28 12:05:28 +02:00
Sebastian Huber
cecc1097ff bsp/qoriq: Fix start stack setup 2016-07-28 10:50:12 +02:00
Sebastian Huber
6446773000 bsp/qoriq: Fix tlbwe synchronization 2016-07-28 10:50:12 +02:00
Sebastian Huber
b1ef3674c0 bsp/qoriq: Add QORIQ_HAS_WRITE_BACK_L1_CACHE
Fixes start via U-Boot on P1020.
2016-07-27 11:30:48 +02:00
Sebastian Huber
d79df38c2b score: Add deadlock detection
The mutex objects use the owner field of the thread queues for the mutex
owner.  Use this and add a deadlock detection to
_Thread_queue_Enqueue_critical() for thread queues with an owner.

Update #2412.
Update #2556.
Close #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
1fcac5adc5 score: Turn thread lock into thread wait lock
The _Thread_Lock_acquire() function had a potentially infinite run-time
due to the lack of fairness at atomic operations level.

Update #2412.
Update #2556.
Update #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
3a58dc8631 score: Priority inherit thread queue operations
Move the priority change due to priority interitance to the thread queue
enqueue operation to simplify the locking on SMP configurations.

Update #2412.
Update #2556.
Update #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
ac8402ddd6 score: Simplify _Thread_queue_Boost_priority()
Raise the priority under thread queue lock protection and omit the
superfluous thread queue priority change, since the thread is extracted
anyway.  The unblock operation will pick up the new priority.

Update #2412.
Update #2556.
Update #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
f4d1f30792 score: Split _Thread_Change_priority()
Update #2412.
Update #2556.
Update #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
0b83633729 score: Fix for RTEMS_DEBUG 2016-07-27 10:55:29 +02:00
Sebastian Huber
dfa2cdb15d posix: Fix error status 2016-07-27 09:09:53 +02:00
Gedare Bloom
39d97ab78c cpukit: refactor nanosleep and use 64-bit timeout for threadq
* Fixes a bug with elapsed time calculations misusing absolute time
  arguments in nanosleep_helper by passing the requested relative interval.
* Fixes a bug with truncation of absolute timeouts by passing the
  full 64-bit value to Thread_queue_Enqueue.
* Share yield logic between nanosleep and clock_nanosleep.

updates #2732
2016-07-26 14:13:36 -04:00
Alexander Krutwig
f6fdf2eb7b atsam: Add user defined RX/TX descriptor counts 2016-07-26 14:18:19 +02:00
Alexander Krutwig
c51e6d915c atsam: Use normal memory for DTCM
Avoids problems with unaligned data access.
2016-07-26 10:02:57 +02:00
Alexander Krutwig
84008f9e43 bsps/arm: Clear pending exceptions for ARMv7-M 2016-07-26 10:00:05 +02:00
Alexander Krutwig
6a174c024a Add Untar_FromGzChunk_Print() + Test 2016-07-26 10:00:04 +02:00
Alexander Krutwig
1a8fe67acf Add Untar_FromChunk_Print() + Test 2016-07-26 10:00:04 +02:00
Sebastian Huber
c1b815abe0 sptests/spextensions01: Avoid NULL pointer access 2016-07-26 09:57:11 +02:00
Sebastian Huber
ea9384425a score: Format 2016-07-26 08:01:58 +02:00
Sebastian Huber
75fc27ad39 score: Fix printk() format specifiers 2016-07-26 07:54:05 +02:00
Sebastian Huber
00c620c1a1 score: Format 2016-07-26 07:53:34 +02:00
Chris Johns
f78a5f55da score: Add a STATES_DEBUGGER for use by debugging agents to a thread's state. 2016-07-26 09:54:11 +10:00
Gedare Bloom
e0f17fcf6f posix: fix clock_nanosleep and nanosleep clock use
Sleeping with CLOCK_REALTIME should use the WATCHDOG_ABSOLUTE
clock discipline for the threadq so that the timeout interval
may change in case the clock source changes. Similarly,
CLOCK_MONOTONIC uses the WATCHDOG_RELATIVE threadq that will
only wakeup the thread after the requested count of ticks elapse.

updates #2732
2016-07-25 12:44:48 -04:00
Gedare Bloom
b5bfaaf9c2 posix: cond_timedwait remember and use clock from condattr
updates #2745
2016-07-25 12:44:47 -04:00
Gedare Bloom
127c20ebd7 posix: refactor cond wait support to defer abstime conversion
updates #2745
2016-07-25 12:44:47 -04:00
Gedare Bloom
10e4000221 cpukit/rtems: fix return type mismatch for _TOD_To_seconds 2016-07-25 12:44:47 -04:00
Gedare Bloom
6e98ea9157 posix: add clock_nanosleep and tests
updates #2732
2016-07-25 12:44:47 -04:00
Gedare Bloom
f23d470616 cpukit: Add and use Watchdog_Discipline.
Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE,
or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with
a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline
of WATCHDOG_NO_TIMEOUT.

updates #2732
2016-07-25 12:44:47 -04:00
Sebastian Huber
7f616dddcf score: Fix for RTEMS_DEBUG 2016-07-25 14:48:05 +02:00
Sebastian Huber
57a00bc6af smptests/smpmutex02: New test
Update #2765.
2016-07-25 14:18:34 +02:00
Sebastian Huber
ba5de7531a bsps: Fix shared polled console fatal error
Fatal errors must uniquely identify the source location.
2016-07-25 14:03:00 +02:00
Sebastian Huber
0fd6f25507 score: Relax thread begin extension environment
Update #2752.
2016-07-25 08:40:14 +02:00
Sebastian Huber
3ae199a553 score: Disable RTEMS_NO_RETURN for RTEMS_DEBUG
Do not use RTEMS_NO_RETURN hints for debug configurations to ease use of
stack traces in case of fatal errors.
2016-07-25 08:40:14 +02:00
Pavel Pisa
ba0471d9f5 arm/raspberrypi: add Secure Digital (SD) controller interrupt source ID from Mudit Jain'a tree. 2016-07-23 15:15:17 +02:00
Pavel Pisa
d216c5d6a2 arm/raspberrypi: change interrupt dispatch and enable to generic vector id based approach.
Using conditional branches to find bits is extremely inefficient
and for asynchronous delivery of different interrupt sources
lead to total confusion of branch prediction unit.
2016-07-23 12:10:34 +02:00
Pavel Pisa
d5483181a8 arm/raspberrypi: remove duplicate setup of IRQ handler in the main ARM exception table.
Exception table setup is processed by common CPU architecture support.
For ARM architecture, it can be found in the file

rtems/c/src/lib/libbsp/arm/shared/start/start.S

and ends by bsp_vector_table_copy_done label.
The actual tabel content can be found at

  bsp_start_vector_table_begin

For ARMv7-A and even other variant with hypervisor mode support,
it is even not necessary to copy table to address 0 at all
because CP15 register can be used to specify alternative
table start address

  arm_cp15_set_vector_base_address(&)bsp_start_vector_table_begin;

ARMv7-M have register to set exception table base as well.
2016-07-23 12:07:10 +02:00
Deval Shah
1c62f7ee2d Added USB interrupt handler. And defined some macros regarding USB. 2016-07-23 10:10:16 +02:00
Pavel Pisa
0055b65986 bsp/tms570: ensure that change of SCI baudrate is not applied in the middle of character Tx.
The rtems_monitor_task() setups/updates termios attributes
of the opened TTY and if there is ongoing some other output
it leads to the stuck.

It would be better to use some termios API function which
would call drainOutput() in rtems/cpukit/libcsupport/src/termios.c.
But functionality is not accessible outside of core termios
implementation.

The loop waiting for last character to be sent has to be there anyway
because hardware does not provide Tx machine/shift register empty
interrupt.
2016-07-22 21:15:55 +02:00
Sebastian Huber
992494e3dd score: Fix for RTEMS_DEBUG 2016-07-22 12:37:03 +02:00
Sebastian Huber
64ed0bb307 score: Assert proper seqlock writer state
Helps to detect invalid concurrent writes.
2016-07-22 11:24:53 +02:00
Sebastian Huber
059529e685 score: Add debug support to chains
This helps to detect

 * double insert, append, prepend errors, and
 * get from empty chain errors.
2016-07-22 09:13:07 +02:00
Sebastian Huber
3cdda03c5a posix: Fix double chain extract 2016-07-21 15:26:47 +02:00
Pavel Pisa
8709aa0459 libdl/rtl-obj.c: synchronize cache after code relocation.
Memory content changes caused by relocation has to be
propagated to memory/cache level which is used/snooped
during instruction cache fill.

Closes #2438
2016-07-21 02:35:00 +02:00
Pavel Pisa
dcf806ef51 arm/raspberrypi: reorder and update MMU config table to nor force RW section later to RO.
Enable even the first megabyte of SDRAM to be cache-able after
problems with stale cache content has been resolved by previous commit.
Because major part of application usually fits to the first
megabyte this speedups test dhrystone application by factor 40.
2016-07-20 16:46:04 +02:00
Pavel Pisa
bef2b737a2 arm/raspberrypi: use cache manager operations to flush/invalidate all cache levels.
This fix strange behavior where some stale content has been
stored in level 2 cache before RTEMS has been start from U-boot
which has reappeared after MMU enable and shadow vector
table at start of SDRAM.
2016-07-20 16:46:04 +02:00
Pavel Pisa
577e7fb337 arm/bsps: CP15 and basic cache support entire cache clean for more architecture variants now.
Next cache operations should work on most of cores now

  rtems_cache_flush_entire_data()
  rtems_cache_invalidate_entire_data()
  rtems_cache_invalidate_entire_instruction()

Instruction cache invalidate works on the first level for now only.
Data cacache operations are extended to ensure flush/invalidate
on all cache levels.

The CP15 arm_cp15_data_cache_clean_all_levels() function extended
to continue through unified levels too (ctype = 4).
2016-07-20 16:46:04 +02:00
Pavel Pisa
3338121832 bsps/arm: do not disable MMU during translation table management operations.
Disabling MMU requires complex cache flushing and invalidation
operations. There is almost no way how to do that right
on SMP system without stopping all other CPUs. On the other hand,
there is documented sequence of operations which should be used
according to ARM manual and it guarantees even distribution
of maintenance operations to other cores for last generation
of Cortex-A cores with multiprocessor extension.

This change could require addition of appropriate entry
to arm_cp15_start_mmu_config_table for some BSPs to ensure
that MMU table stays accessible after MMU is enabled

  {
    .begin = (uint32_t) bsp_translation_table_base,
    .end = (uint32_t) bsp_translation_table_base + 0x4000,
    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
  }
2016-07-20 16:46:04 +02:00
Pavel Pisa
a48c05226d arm/raspberrypi: cache manager can be used for mailbox synchronization now. Remove workarounds.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2016-07-20 16:46:04 +02:00