Commit Graph

1692 Commits

Author SHA1 Message Date
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
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
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
Sebastian Huber
8d785f72d9 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.

Close #2761.
2016-07-19 08:12:32 +02:00
Punit Vara
5e3096db5a Beaglebone: Update PWM driver imported from BBBIO
This patch adapts the previously added Beaglebone PWM code from BBBIO to RTEMS.
This work was done in the context of the Google Summer of Code 2016, and further
patches will follow to improve the code quality and documentation.
2016-07-04 15:09:06 -03:00
Pavel Pisa
06165554b6 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.
2016-07-04 15:55:58 +02:00
Pavel Pisa
d431653739 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
2016-07-04 15:55:57 +02:00
Pavel Pisa
0e507d5510 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.
2016-07-04 15:55:57 +02:00
Pavel Pisa
19a9090164 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).
2016-07-04 15:55:56 +02:00
Sebastian Huber
2471316321 score: Rename _ISR_Disable() and _ISR_Enable()
Rename _ISR_Disable() into _ISR_Local_disable().  Rename _ISR_Enable()
into _ISR_Local_enable().  Remove _Debug_Is_owner_of_giant().

This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:50:37 +02:00
Sebastian Huber
4b04cb6155 score: Rename _ISR_Disable_without_giant()
Rename _ISR_Disable_without_giant() into _ISR_Local_disable().  Rename
_ISR_Enable_without_giant() into _ISR_Local_enable().

This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:50:34 +02:00
Sebastian Huber
d2bacb6c38 score: _Thread_Dispatch_increment_disable_level()
Avoid _Thread_Dispatch_increment_disable_level() and
_Thread_Dispatch_decrement_disable_level() and thus the Giant
lock.

This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:49:41 +02:00
Pavel Pisa
6fbc692fe2 bsps/arm: CP15 support for flush prefetch buffer and table base control. 2016-05-19 13:21:39 +02:00
Joel Sherrill
9c7de43df9 libcpu/m68k/mcf5272/clock/ckinit.c: Fix warning by including <rtems/clockdrv.h> 2016-03-27 18:41:57 -05:00
Joel Sherrill
d0cffc73fc libcpu/m68k/mcf5206/clock/ckinit.c: Fix warning by including <rtems/clockdrv.h> 2016-03-27 18:41:51 -05:00
Joel Sherrill
6b597c397b libcpu/bfin/clock/clock.c: Fix warning by including <rtems/clockdrv.h> 2016-03-27 18:41:34 -05:00
Daniel Hellstrom
6c4aaf4f31 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.

Update #2651.
2016-03-17 11:09:08 +01:00
Joel Sherrill
328bd350aa i386: refactor libcpu/cpu.h into rtems/score/i386.h
Fixes #2515.
2016-03-03 16:36:30 -05:00
Martin Galvan
8c5c53f478 am335x irq handling improvement
This patch makes the following changes to the Beaglebone IRQ handling code:

- Disable support for nested interrupts.
- Detect spurious IRQs using the SPURIOUSIRQ field of the INTC_SIR_IRQ register.
- Acknowledge spurious IRQs by setting the NewIRQAgr bit of the INTC_CONTROL
  register. This cleans the SPURIOUSIRQ field and allows new interrupts
  to be generated.
- Improve the get_mir_reg function a bit.

Closes #2580.
2016-02-28 00:23:02 +01:00
Sebastian Huber
3bc12a8f5a Delete unused API extensions 2016-02-03 10:00:58 +01:00
Sebastian Huber
a8865f8b41 score: Introduce CPU_CACHE_LINE_BYTES
Add CPU_CACHE_LINE_BYTES for the maximum cache line size in bytes.  The
actual processor may use no cache or a smaller cache line size.
2016-01-26 09:07:30 +01:00
Sebastian Huber
76ac1ee3bb score: Fix simple timecounter support
Update #2502.
2016-01-19 08:36:14 +01:00
Sebastian Huber
ccd54344d9 score: Introduce Thread_Entry_information
This avoids potential dead code in _Thread_Handler().  It gets rid of
the dangerous function pointer casts.

Update #2514.
2016-01-11 08:47:01 +01:00
Sebastian Huber
5c7bfcf82e Fix interrupt epilogue for ARMv7-AR and PowerPC 2015-11-12 08:21:45 +01:00
Sebastian Huber
bc792bb3bd basdefs.h: Add and use RTEMS_PACKED 2015-10-26 09:13:19 +01:00
Sebastian Huber
258ad71e96 SMP: Fix and optimize thread dispatching
According to the C11 and C++11 memory models only a read-modify-write
operation guarantees that we read the last value written in modification
order.  Avoid the sequential consistent thread fence and instead use the
inter-processor interrupt to set the thread dispatch necessary
indicator.
2015-09-28 13:56:57 +02:00
Ketul Shah
151e53feab Beagle: GPIO support (for BBB)
GPIO Driver Development for BeagleBone Black based on the generic GPIO API
2015-08-18 17:05:55 +02:00
Sebastian Huber
e5a79e54d9 bsp/mpc83xx: Update due to header guard change
Close #2373.
2015-07-17 07:59:35 +02:00
Sebastian Huber
b171982439 bsps/powerpc: Provide debug and trace symbols 2015-07-08 10:07:59 +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
Sebastian Huber
335e5caa9a score: Add Thread_Control::is_fp
Store the floating-point unit property in the thread control block
regardless of the CPU_HARDWARE_FP and CPU_SOFTWARE_FP settings.  Make
sure the floating-point unit is only enabled for the corresponding
multilibs.  This helps targets which have a volatile only floating point
context like SPARC for example.
2015-06-09 09:05:50 +02:00
Sebastian Huber
aff220db7a bsps/powerpc: Fix potential integer overflow
Update #2356.
2015-05-29 08:59:59 +02:00
ragunath
d55d7a067f beagle bsp: RTC support for BBB 2015-05-28 14:41:37 +02:00
Joel Sherrill
60e4c0094a arm/s3c24xx/clock/clockdrv.c: Remove unused variable warning 2015-05-21 08:28:58 -07:00
Joel Sherrill
562c1b1b6d arm/lpc22xx/clock/clockdrv.c: Remove unused variable warning 2015-05-21 08:28:56 -07:00
Alexander Krutwig
75acd9e69f bsps: Convert clock drivers to use a timecounter
Update #2271.
2015-05-20 08:40:34 +02:00
Sebastian Huber
7f53035504 bsps/sparc: Use inline functions for cache manager 2015-04-27 10:11:47 +02:00
Sebastian Huber
4bf2a6aa09 bsps/cache: Clarify range functions support 2015-04-27 09:40:16 +02:00
Hesham ALMatary
1602bf3973 Fix broken BSPs due to a shared cache function declaration.
Get rid of _CPU_cache_invalidate_instruction_range declaration
as it doesn't make sense here.
2015-04-27 09:25:39 +02:00
Sebastian Huber
26c142e5ad score: Refactor SMP cache manager support 2015-04-20 08:23:25 +02:00
Sebastian Huber
d4edbdbcbf Replace www.rtems.com with www.rtems.org 2015-03-20 15:42:34 +01:00
Daniel Cederman
665928a9b5 rtems: Use atomic operation with correct type 2015-03-20 12:00:00 +01:00
Joel Sherrill
24868ecb92 libcpu/bfin/clock/rtc.c: Do not use rtems_clock_get() 2015-03-17 10:05:05 -05:00
Joel Sherrill
9cc1892650 libcpu/powerpc/mpc8260/console-generic/console-generic.c: Include bsp.h to fix warning 2015-03-09 16:14:18 -05:00
Gedare Bloom
9d090fb70a sparc64: fix copyright notices.
The sparc64 port had some incorrect copyright notices affixed to
source code files.
2015-02-23 15:42:59 -05:00
Nick Withers
d11b711b3e bsps/powerpc: Fix a clock driver
PowerPC Book E: Account for an extra tick period if a tick increment's
pending.

Close #2230.
2015-01-30 06:57:00 +01:00
Sebastian Huber
f63e9a3aa8 bsps/powerpc: Fix switch statement in CPU ident
Close #2237.
2015-01-23 11:31:54 +01:00
Sebastian Huber
60d39b66e0 powerpc: Fix AltiVec VSCR save/restore 2015-01-20 14:01:50 +01:00
Joel Sherrill
85dbf520f8 libcpu/powerpc/mpc6xx/mmu/bat.c: Now compiles with gcc 5.x 2015-01-13 15:41:32 -06:00