Commit Graph

14182 Commits

Author SHA1 Message Date
Sebastian Huber
275032b85a powerpc: Fix SMP context switch
We need the unmodified r4 for get_potential_new_heir.

This partially reverts commit 8d785f72d9.
2016-09-08 09:55:26 +02:00
Chris Johns
d416061846 testsuite: Add libdl/dl05 reloc test. 2016-09-08 16:52:39 +10:00
Sebastian Huber
531924df8b bsp/raspberrypi: Rename file 2016-09-08 07:43:02 +02:00
Pavel Pisa
5d369c8572 arm/raspberrypi: use GPU/system timer as clock source.
It has advantage that it is designed as free-running counter
with compare registers and can easily serve for for both
timecounter and tick interrupt.
2016-09-07 20:29:39 +02:00
Pavel Pisa
40f49d11cf arm/raspberrypi: correct and extend definitions for GPU timer. 2016-09-07 20:29:39 +02:00
Pavel Pisa
df2ee9d377 arm/raspberrypi: basic BCM2836 SMP implementation.
The BSP support is divided to startup/bspsmp_api.c file where
functions required by SuperCore are defined and BCM2836 hardware
initialization part in startup/bspsmp_init.c.

Separation is done to prevent smpfatal08 test build failure.
2016-09-07 20:29:39 +02:00
Pavel Pisa
38a5385bc0 arm/raspberrypi: propagate number of configured CPUs into linker script. 2016-09-07 20:29:39 +02:00
Pavel Pisa
dfbedf366d arm/raspberrypi: rename linkcmds to linkcmds.in to allow their configure processing. 2016-09-07 20:29:39 +02:00
Pavel Pisa
4c53be196d arm/raspberrypi: more definitions of BCM2836 core local peripherals. 2016-09-07 20:29:39 +02:00
Rohini Kulkarni
bf62c39021 arm/raspberrypi: include definitions of BCM2836 SMP mailboxes. 2016-09-07 20:29:39 +02:00
Pavel Pisa
6e6a77a690 bsps/arm: reorganize CP15 code to allow clean and invalidate ARMv7 cache by level.
New function arm_cp15_cache_invalidate_level and arm_cp15_cache_clean_level
can be used to maintain single cache level (instruction or data).
2016-09-07 20:29:39 +02:00
Pavel Pisa
5c49464108 bsps/arm: remove lock in arm_cp15_set_translation_table_entries().
Protection by rtems_interrupt_disable() is incompatible with SMP build.
Actual page table entries manipulation function does not need locking
and disabling cache and can be run concurrently even on multiple
CPUs as long as changes do not modify same region. If the function
is called from more threads/CPUs to modify same region with different
mapping options concurrently then there is problem at another level
of virtual address space management  and has to be solved by mutex
or other locking at that level.
2016-09-07 20:29:38 +02:00
Pavel Pisa
7ec689adc7 bsps/arm: use defines for cache type register format field.
The change documents meaning of codes and opens
well defined way to use cache type format for cache
examination/debugging outside of arm-cp15.h file.
2016-09-07 20:29:38 +02:00
Christian Mauderer
b9cc5aa9d3 bsp/atsam: Add SDRAM IS42S16320F-7BL. 2016-09-07 13:38:53 +02:00
Christian Mauderer
beb289eb5b bsp/atsam: Move ram init values to structure. 2016-09-07 13:38:53 +02:00
Sebastian Huber
cac586e6e8 bsp/xilinx-zynq: Avoid duplicate declaration 2016-09-06 10:56:27 +02:00
Chris Johns
caf2cbd813 arm/xilinx_zynq: Start the second core when an SMP build. 2016-09-01 11:11:09 +10:00
Pavel Pisa
13c985c4f4 arm/xilinx_zynq: ensure that cache is cleaned and MMU disabled when initialization starts.
The u-boot loader enables the MMU plus the data and instruction caches
in some versions which results in RTEMS boot failure.

Closes #2774.
2016-09-01 11:10:54 +10:00
Chris Johns
6deb41905a libdl: The dl04 is too big for some BSPs. Do not built it. 2016-08-30 18:03:52 +10:00
Mudit Jain
3c74f4aa4d arm/raspberrypi: Mailbox : Extending functionality
Adding functionality to get board serial,
power state & clock rate
2016-08-27 10:18:19 +02:00
Alexander Krutwig
8099e0ae86 bsp/atsam: Add missing break statement 2016-08-24 16:31:44 +02:00
Alexander Krutwig
8cf102dd6b bsp/atsam: Fix data cache flush 2016-08-24 16:08:16 +02:00
Chris Johns
89a319a0f8 libbsp/arm: Fix ARM BSPs missing the bsp_translation_table_end symbol.
Closes #2775.
2016-08-23 11:13:47 +10:00
Alexander Krutwig
fea392a350 bsp/atsam: Add timeout to QSPI send command 2016-08-18 08:56:45 +02:00
Chris Johns
01aa1ba34a libbsp/arm: Add the TTB table to the default MMU set up as read/write.
This lets the table be changed at runtime for dynamic loading and
debugger support.

Closes #2775.
2016-08-15 09:18:27 +10:00
Chris Johns
03c1038edb librtems++: Remove from RTEMS.
This is old and there are better design patterns for threading and C++.
We recommend you use the new C++ standards based support.

Closes #2777.
2016-08-11 17:24:06 +10:00
Chris Johns
9a4eca5843 build-system: Always enable C++ if the compiler is present.
We always build a C++ compiler and building with C++ does not effect
RTEMS or the runtime. This patch always enabled the support. There is
no need to manually enable it any more.

You can disable C++ with '--disable-cxx'.

If an architecture does not have a C++ compiler support is automatically
disabled.
2016-08-11 17:20:10 +10:00
Alexander Krutwig
5d0f0de4aa bsp/atsam: Add power support 2016-08-08 13:56:36 +02:00
Alexander Krutwig
e5fd901141 atsam: Add atsam_rtc_get_time() 2016-08-08 09:34:58 +02:00
Pavel Pisa
912a1a90ce arm/raspberrypi: framebuffer driver checks for initialization and tries runtime init if required.
Code works but there is problem how to setup caching for the regions
(arm_cp15_set_translation_table_entries arguments).

If ARMV7_MMU_DATA_READ_WRITE_CACHED is used then CPU
accesses are noncoherent with VideoCore and some
part of image update are not visible until pushed from
cache by other activities. If ARMV7_MMU_DATA_READ_WRITE
is used then access is extremely slow.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2016-07-31 13:10:28 +02:00
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
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
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
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
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
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
Sebastian Huber
c2a4b8bf37 bsps/powerpc: Fix shared console driver
The Termios modes are now an emum.  Do not use them in #if expressions.

Close #2762.
2016-07-19 09:42:26 +02:00