Commit Graph

13321 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Premysl Houdek
08a98f757b bsp/tms570: fixed sci driver freeze when closing terminal bug
tms570_sci_interrupt_last_close: do not wait for old data transmit.

Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-11-18 10:19:01 -05:00
Premysl Houdek
e73d93247e bsp/tms570: Pinmux support and EMAC pin definition added
Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-11-18 10:19:00 -05:00
Premysl Houdek
fb5d60dafb bsp/tms570: EMAC control header file corrected and EMAC interrupt vector added
Signed-off-by: Premysl Houdek <kom541000@gmail.com>
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2015-11-18 10:19:00 -05:00
Daniel Cederman
2d7aad73ea sparc: Fix context switch on SMP
We must not load registers (e.g. PSR) from the heir context area before
the heir stopped execution.

With this patch the write to PSR is divided into two steps. We first update
the current window pointer and then we restore the status registers and
enable traps. This allows us to move the first write to PSR to be before
the write to WIM, as there is now no risk that we get an interrupt where
the CWP and WIM would be inconsistent. We only need to make sure that we
do not use any of the non-global registers or instructions that affects
CWP for three instructions after the write.

In the earlier code the non-global %o1 register was used right after the
write to PSR, which required the use of three nop:s.

Close #2472.
2015-11-17 08:59:23 +01:00
Sebastian Huber
0c9bf40b89 Fix interrupt epilogue for ARMv7-AR and PowerPC
Close #2470.
2015-11-17 07:47:31 +01:00
Joel Sherrill
ec6f20fc80 moxiesim/configure.ac: Fix typo 2015-10-20 18:08:48 -05:00
Joel Sherrill
13e705cfcb h8sim-testsuite.tcfg: Add fsdosfsname01
closes #2432.
2015-10-20 16:49:51 -05:00
Sebastian Huber
9c96ea780f bsp/leon3: Fix Termios context usage
Only the context of the console device was used and this is wrong in
case more than one APBUART device is available.
2015-10-20 11:31:02 +02:00
Marcos Diaz
44eb9893b5 Beaglebone: fix missing clobber in inline assembly.
flush_data_cache uses R0 directly but doesn't list it as a clobbered
register. Compiling with -O3 made this code break, since the function
that calls flush_data_cache already uses r0.

closes #2416.
2015-09-10 13:30:43 -05:00
Martin Galvan
d781ad5086 various .h files: Add missing C++ extern wrappers
Updates #2405.
2015-09-03 11:27:42 -05:00
Joel Sherrill
652888c22d ada-tests/support/init.c: Fix compile errors and warnings
closes #2379.
2015-08-02 08:32:45 -07:00
Sebastian Huber
8b14cbd996 bsps/arm: Update due to API changes 2015-07-21 10:01:34 +02:00
Premysl Houdek
49c1d25dc2 bsp/tms570 Use bitfields instead of hard-coded values
Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-07-20 21:06:55 +10:00
Premysl Houdek
9a84f98372 bsp/tms570: skipped 32bit field definitions and corrected single bit fields
there is no need to define access macros for field covering
whole registers. In addition, BSP_FLD32 does not work right
for field 32bit length.

Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-07-20 21:06:42 +10:00
Sebastian Huber
e5a79e54d9 bsp/mpc83xx: Update due to header guard change
Close #2373.
2015-07-17 07:59:35 +02:00
Joel Sherrill
7e14385b46 sh/shared/startup/bspstart.c: Add include of percpu.h 2015-07-16 11:15:52 -07:00
Premysl Houdek
069560a5f9 bsp/tms570: source changes reflecting new headers.
Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-07-16 11:15:52 -07:00
Pavel Pisa
602e395b4d bsp/tms570: fix get time resolution after infrastructure change to timecounter.
The update fixes breakage of TMS570 support after Alexander Krutwig
switch of RTEMS time read to timecounter mechanism

bsps: Convert clock drivers to use a timecounter

Mechanism to specify odd (non 1 Mhz) time base update frequencies
implemented after objections of  Martin Galvan.

Code is adjusted to convert RTEMS configuration parameter
microseconds_per_tick to such odd base if
TMS570_PREFERRED_TC_FREQUENCY is specified appropriately.

Signed-off-by: Premysl Houdek <kom541000@gmail.com>
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2015-07-16 09:31:09 -07:00
Premysl Houdek
bea49c9477 bsp/tms570: New/generated header files for TMS570 SoC peripherals registers.
The header files are generated by script make_header.py.
Current script's version can be found at:

https://github.com/AoLaD/rtems-tms570-utils/tree/headers/headers/python

Registers offsets and fields have been extracted from reference manual.

Signed-off-by: Premysl Houdek <kom541000@gmail.com>
2015-07-16 09:31:09 -07:00
Joel Sherrill
4784214a6a remaining bsp.h: Fix by hand to LIBBSP_@CPU@_@BSP_FAMILY@_BSP_H
These files were left after running the script in the previous patch.
2015-07-16 08:43:51 -07:00
Joel Sherrill
9cff822a26 Most bsp.h: Switch to LIBBSP_@CPU@_@BSP_FAMILY@_H for guard
This was done by the following script run from libbsp:

find * -name bsp.h | xargs -e grep -l "#ifndef.*_BSP_H" | while read b
do
  echo $b
  cpu=`echo $b | cut -d'/' -f1 | tr '[:lower:]' '[:upper:]' `
  bsp=`echo $b | cut -d'/' -f2 | tr '[:lower:]' '[:upper:]' `
  g="LIBBSP_${cpu}_${bsp}_BSP_H"
  # echo $g
  sed -e "s/ifndef _BSP_H/ifndef ${g}/" \
      -e "s/define _BSP_H/define ${g}/" \
  -i $b

done
2015-07-16 08:40:05 -07:00
Sebastian Huber
93f5adb644 powerpc: Do not use the ATB for e500 multilib
The e500v1 has no support for the ATB.

Update #2369.
2015-07-15 10:52:40 +02:00
Sebastian Huber
c2596dfbd0 bsps/powerpc: Fix small-data area issue
Update #2369.
2015-07-09 10:00:26 +02:00
Sebastian Huber
b171982439 bsps/powerpc: Provide debug and trace symbols 2015-07-08 10:07:59 +02:00
Sebastian Huber
3e02a472ba bsp/qoriq: Enable branch prediction for T series 2015-07-08 10:07:59 +02:00
Sebastian Huber
994d7e12b5 bsp/qoriq: Use -O2 for T series 2015-07-08 10:07:59 +02:00
Jan Sommer
e77f625401 RaspberryPi: Use rtems_configuration_get_microseconds_per_tick to set clock counter
timer interrupt was hard coded to 10 ms per tick.
    Fix uses the setting of CONFIGURE_MICROSECONDS_PER_TICK to compute the correct start value for the counter
    See for more information: http://permalink.gmane.org/gmane.os.rtems.user/22691
2015-07-07 16:01:28 -05:00
Sebastian Huber
635ed82a12 bsp/qoriq: Update due to API changes 2015-07-01 11:13:50 +02:00
Sebastian Huber
32005a7284 bsp/mpc55xxevb: Fix configure script
This was the only configure.ac file with bspopts.h present in
AC_CONFIG_FILES().  This somehow prevented the generation of this file
leading to build errors for this BSP.
2015-06-26 09:40:24 +02:00
Sebastian Huber
27f08f5b72 bsps/arm: Update due to API changes 2015-06-26 09:40:03 +02:00
Sebastian Huber
48fed9a56e score: Simplify <rtems/system.h>
Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
2015-06-26 09:16:25 +02:00