Commit Graph

28320 Commits

Author SHA1 Message Date
Chris Johns
8add2b6c6f libbsp/arm: Fix ARM BSPs missing the bsp_translation_table_end symbol.
Closes #2775.
2016-10-02 10:40:34 +02:00
Chris Johns
197d0343a2 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-10-02 10:40:34 +02:00
Sebastian Huber
be62c0b02c bsps/arm: Fix basic cache support for SMP
Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
28eeb6a86f 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).

Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
00dfdd6b08 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.

Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
6f4e903cf0 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.

Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
22cc80783b 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-10-02 10:40:34 +02:00
Pavel Pisa
d3a428cafa 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.

Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
8c5c8b2700 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).

Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
ae3578a2c9 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
  }

Updates #2782
Updates #2783
2016-10-02 10:40:34 +02:00
Pavel Pisa
0d77c4f281 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
Updates #2782
2016-10-02 10:40:33 +02:00
Pavel Pisa
fd6cd36b09 bsps/arm: basic on core cache support changed to use l1 functions.
The basic data and instruction rage functions should be compatible
for all ARMv4,5,6,7 functions. On the other hand, some functions
are not portable, for example arm_cp15_data_cache_test_and_clean()
and arm_cp15_data_cache_invalidate() for all versions and there
has to be specialized version for newer cores.
arm_cache_l1_properties_for_level uses CCSIDR which is not present
on older chips.

Actual version is only experimental, needs more changes
and problem has been found on RPi1 with dlopen so there seems
to be real problem.

Updates #2783
Updates #2782
2016-10-02 10:40:33 +02:00
Pavel Pisa
a114f99bd2 bsps/arm: Change code to explicit selection of cache implementation for ARM BSPs.
The original ARM architecture wide cache_.h is changed to dummy version
for targets not implementing/enablig cache at all.

The ARM targets equipped by cache should include
appropriate implementation.

Next options are available for now

c/src/lib/libbsp/arm/shared/armv467ar-basic-cache/cache_.h
  basic ARM cache integrated on the CPU core directly
  which requires only CP15 oparations

c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h
  support for case where ARM L2C-310 cache controller
  is used. It is accessible as mmaped peripheral.

c/src/lib/libbsp/arm/shared/armv7m/include/cache_.h
  Cortex-M specific cache support

Updates #2782
Updates #2783
2016-10-02 10:40:33 +02:00
Pavel Pisa
886b962e7b bsp/arm: Report correct maximal cache line length for ARM Cortex-A + L2C-310.
Updates #2782
Updates #2783
2016-10-02 10:40:33 +02:00
Pavel Pisa
eb3af275ea rtems+bsps/cache: Define cache manager operations for code synchronization and maximal alignment.
There is need for unambiguous named and defined cache function
which should be called when code is updated, loaded
or is self-modifying.

There should be function to obtain maximal cache line length
as well. This function can and should be used for allocations
which can be used for data and or code and ensures that
there are no partial cache lines overlaps on start and
end of allocated region.

Updates #2782
2016-10-02 10:40:33 +02:00
Pavel Pisa
9aaf8f2b0b score/arm: Ensure that copile time alignment is 64 bytes for Cortex-A multilib.
Some/many Cortex-A cores have data cache line length 64 bytes and maximum
value has to be used for system structures alignment.

Updates #2782
Updates #2783
2016-10-02 10:40:33 +02:00
Pavel Pisa
d5ff46bd52 arm/score and shared: define ARM hypervisor mode and alternate vector table base access.
The main reason for inclusion of minimum hypervisor related defines
is that current ARM boards firmware and loaders (U-boot for example)
start loaded operating system kernel in HYP mode to allow it take
control of virtualization (Linux/KVM for example).

Updates #2783
2016-10-02 10:40:33 +02:00
Pavel Pisa
c6e0201443 arm/raspberrypi: ensure that RTEMS application image can be started by U-boot.
The current versions of U-boot start kernel/RTEMS application image
with instruction and data caches enabled and it sets exception
base register to new address after its self-relocation.

        ldr     r0, [r9, #GD_RELOCADDR] /* r0 = gd->relocaddr */
        mcr     p15, 0, r0, c12, c0, 0  /* Set VBAR */

Included changes in bsp_start_hook_0 restore default state to
allow RTEMS image to run after startup from newer U-boot version
on Raspberry Pi.

Clear interrupt enable registers in interrupt controller
to ensure that RTEMS starts from well defined state.

Updates #2783
2016-10-02 10:40:33 +02:00
Pavel Pisa
be5cf032c5 bsps/arm: CP15 support for flush prefetch buffer and table base control.
Updates #2782
Updates #2783
2016-10-02 10:40:33 +02:00
Sebastian Huber
75a6584a43 score: Fix C/C++ compatibility issue
Only use CPU_Per_CPU_control if it contains at least one filed.  In GNU
C empty structures have a size of zero.  In C++ structures have a
non-zero size.  In case CPU_PER_CPU_CONTROL_SIZE is defined to zero,
then this structure is not used anymore.

Close #2789.
2016-09-23 06:59:59 +02:00
Chris Johns
35edf82463 libdl: Fix cache corruption bugs.
This patch fixes a number of bugs in the cache when requests are
made to read close to the end of the file and the data is copied
from the top of the cache buffer to the bottom of the buffer. This
was compounded by attempting to read past the end of the file.

Closes #2754.
2016-08-15 15:46:39 +10:00
Chris Johns
25c5583f92 libdl: Add trace output when reading section headers. 2016-08-15 15:46:31 +10:00
Sebastian Huber
7b24946c2b bsps/powerpc: Fix shared console driver
The Termios modes are now an emum.  Do not use them in #if expressions.

Update #2762.
2016-07-19 09:44:16 +02:00
Sebastian Huber
dc0f537b27 bsps/powerpc: Fix AtliVec context switch
Properly pass the stack aligned context to _CPU_Context_switch_altivec()
since _CPU_altivec_ctxt_off defined via ppc_context.

Update #2761.
2016-07-19 08:15:01 +02:00
Sebastian Huber
c6c4fce942 bsps/powerpc: Fix AltiVec enable
There must be an isync after the mtmsr to ensure that the AltiVec is
enabled for subsequent instructions.

Close #2760.
2016-07-19 07:40:40 +02:00
Sebastian Huber
3f72dda6ee posix: Fix pthread_spin_unlock() error status
Update #2719.
2016-05-25 12:48:00 +02:00
Sebastian Huber
276dfd9f3d fat: Fix for invalid cluster sizes
A cluster size > 32KiB resulted in an infinite loop in
fat_init_volume_info() due to an integer overflow.

Update #2717.
2016-05-20 08:14:34 +02:00
Sebastian Huber
f502882ef5 posix: Fix return states of pthread_kill()
POSIX mandates that an error code is returned and not -1 plus errno.

Update #2715.
2016-05-17 13:43:55 +02:00
Sebastian Huber
94b1ba5aed posix: Fix return status of pthread_cancel()
POSIX recommends ESRCH in case no thread exists for the specified
identifier.

Update #2713.
2016-05-17 08:40:43 +02:00
Daniel Hellstrom
33de2037f6 sparc: Fix window underflow trap handler
The window underflow trap handler used %i5 which destroyed the %o5 of
the calling context.  Bug introduced by
0d3b5d4742.

Go back to the pre 0d3b5d4742 behaviour
and use the two unused instructions in the trap vector to optimize a
bit.

Close #2651.
2016-03-24 07:41:01 +01:00
Sebastian Huber
d85db176e7 Filesystem: Export most generic path eval function
Add path length parameter to
rtems_filesystem_eval_path_start_with_root_and_current() so that users
may pass paths without a '\0' termination.

Update #2558.
2016-02-02 08:00:34 +01:00
Sebastian Huber
2145853b00 score: Fix simple timecounter support
Close #2502.
2016-01-27 08:09:05 +01:00
Sebastian Huber
d4520c1900 bsps/arm: Fix broken switch statement
Close #2530.
2016-01-18 08:14:11 +01:00
Sebastian Huber
1bdf578e52 Clearly mark SMP support as experimental in 4.11 2016-01-11 08:29:08 +01:00
Sebastian Huber
cb7c6f53f7 smptests/README: Delete obsolete information 2016-01-11 07:58:09 +01:00
Sebastian Huber
9c615b7835 score: Fix watchdog insert
Under certain conditions a new watchdog was inserted with a wrong
and very large delta interval due to a wrong iterator update.

Bug was introduced by 1ccbd05291.

Close #2507.
2016-01-05 07:09:56 +01:00
Joel Sherrill
b4350d18e7 LICENSE.WEBSERVER: GoAhead server removed before 4.11 branched. Obsolete.
closes #2508.
2016-01-04 11:46:14 -06:00
Sebastian Huber
2cc001a15a score: Fix watchdog removal
Under certain conditions a new watchdog was inserted with a wrong and
very large delta interval due to an incomplete iterator update.

Bug was introduced by 1ccbd05291.

Close #2501.
2015-12-21 08:40:29 +01:00
Sebastian Huber
93b959581c doc: SMP status of RTEMS 4.11 2015-12-16 08:20:38 +01:00
Sebastian Huber
8839cf674e doc: SMP introduction 2015-12-16 08:16:15 +01:00
Chris Johns
51de51dafe Fix rtems-bsps for GNU find hosts.
Fixed as reported by Pavel:

 https://lists.rtems.org/pipermail/devel/2015-December/013189.html

Closes #2498.
2015-12-16 12:04:47 +11:00
Chris Johns
431140aef3 Display only valid BSPs, ignore other .cfg files.
Show the architecture and BSP count.

Closes #2491.
2015-12-13 23:22:53 +11:00
Pavel Pisa
2a9db262a2 bsp/tms570: ensure that linker symbol comparison to NULL is not optimized out.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2015-12-01 21:09:25 -05:00
Sebastian Huber
7828f1c3aa Fix _Assert() statement 2015-11-25 08:36:04 +01:00
Pavel Pisa
a6d176f25e untar: do not exit with error when created directory already exists.
The problem exists for both RTEMS untar implementations and their
variants: Untar_FromMemory(), Untar_FromFile() and rtems_tarfs_load().

If filesystem object already exists at extracted directory path
then if it is directory, creation is ignored. Attempt
to delete/unlink object and make directory is tried for other cases.

This simple approach problem reported in ticket fixes #2413.
Behavior follows GNU tar and BSD tar practice for directories
but much more work is required to achieve full semantics
of the full featured tar implementation still.
2015-11-23 10:40:06 -05:00
Premysl Houdek
f8bbbdd531 bsp/tms570: unite code duplication in pinmux and clean SCI close per review remarks.
Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-11-18 13:12:18 -05:00
Pavel Pisa
dec479be26 bsp/tms570: use common tms570ls3137.inc file for all board ling variants.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2015-11-18 10:19:01 -05:00
Premysl Houdek
85750d169e bsp/tms570: separate Flash variants to one which boots directly and one for boot loader.
The default tms570ls3137_hdk variant is for building RTEMS
application image starting directly from start of Flash.

Variant tms570ls3137_hdk_with_loader skips 256kB at start
of Flash to allow use with application loader.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2015-11-18 10:19:01 -05:00
Pavel Pisa
416cd88ac0 bsp/tms570: use POM only when application image does not start at address 0.
Parameters overlay module is initialized and cleared first.
It is used later to replace exception target vectors
only if that is required.

The application loader code with CPU and SDRAM setup
code has to provide well defined pattern of instructions
at addresses 0x00000000 and 0x0000001f, because only data
read accesses can be processed reliably by POM. The expected
instruction pattern can be seen in the next example

  https://github.com/hornmich/tms570ls3137-hdk-sdram/blob/master/SDRAM_SCI_configuration/source/sys_intvecs.asm

Comments with detailed description of code, background
and reasons for selected approach have been included
in TMS570 bsp startup code.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-11-18 10:19:01 -05:00
Premysl Houdek
572f5df6f9 bsp/tms570: updated reserved space for vector overlay in internal RAM 2015-11-18 10:19:01 -05:00