Commit Graph

1726 Commits

Author SHA1 Message Date
Joel Sherrill
0d01cdd68c sh/sh7750/sci/sh4uart.c: ix misleading indentation warning 2017-04-24 12:00:59 -05:00
Joel Sherrill
646df54c91 powerpc/new-exceptions/bspsupport/ppc_exc_print.c: Fix printf() format warnings 2017-04-24 12:00:58 -05:00
Joel Sherrill
2808c26266 powerpc/mpc5xx/console-generic/console-generic.c: Use updated struct termios format 2017-04-24 12:00:58 -05:00
Cillian O'Donnell
7acdb10cfe libcpu/../mpc5xx/.../vectors_init.c: Using inttype macros fixes 39 format warnings 2017-04-07 15:37:58 -05:00
Sebastian Huber
0a6a2a7bf0 bsps/arm: Add Performance Monitors Extension 2017-03-27 13:37:58 +02:00
Kevin Kirspel
1c6926c11f termios: Synchronize with latest FreeBSD headers
Adding modified FreeBSD headers to synchronize RTEMS termios with
FreeBSD.  Modify termios to support dedicated input and output baud for
termios structure.  Updated BSPs to use dedicated input and output baud
in termios structure.  Updated tools to use dedicated input and output
baud in termios structure.  Updated termios testsuites to use dedicated
input and output baud in termios structure.

Close #2897.
2017-03-22 11:55:04 +01:00
Sebastian Huber
a11e1ff576 powerpc: Optimize AltiVec context switch
Use r8 instead of r5 to slightly optimize _CPU_Context_switch().  It is
not a big deal, however, we already assume r12 is used by
_CPU_Context_switch().  Treat r5 the in same way.
2017-03-07 07:58:11 +01:00
Sebastian Huber
c6f7639250 powerpc: Fix AltiVec context switch
Update #2751.
2017-03-07 07:50:12 +01:00
Sebastian Huber
805d721304 powerpc: Fix warnings 2017-03-02 12:02:49 +01:00
Sebastian Huber
09dab28da0 powerpc: Fix interrupt thread dispatch
Update #2751.
2017-03-02 12:02:49 +01:00
Sebastian Huber
32292d5d7c bsps/powerpc: Fix warning 2017-02-15 13:14:40 +01:00
Sebastian Huber
444cb5cd23 bsps/arm: Fix prototype 2017-02-15 11:12:57 +01:00
Sebastian Huber
73f8d93847 bsps/powerpc: Fix warnings 2017-02-15 11:09:50 +01:00
Sebastian Huber
f65dcc712a score: Fix ARM and PowerPC context initialization
Update #2751.
2016-12-02 13:11:13 +01:00
Chris Johns
e629076003 libdebugger: Build for ARM's without a CP15. 2016-12-02 15:39:56 +11:00
Sebastian Huber
6a1b9e4152 sparc: Optimize _ISR_Handler()
Use _Thread_Do_dispatch() instead of _Thread_Dispatch().  Restore the
PSR[EF] state of the interrupted context via new system call
syscall_irqdis_fp in case floating-point support is enabled.
2016-11-28 16:08:43 +01:00
Martin Erik Werner
9bf9068bb8 or1k: Avoid multiple iterations over cache
Previously, if the cache range operations were called with a range that
was larger than the cache size, this would lead to multiple iterations
over the cache, which is unnecessary.

Limit this so that if the range is larger than the cache size, the
operations will only iterate over the whole cache once.
2016-11-28 07:30:44 +01:00
Martin Erik Werner
a59dd5cc6f or1k: Remove secondary functions in cache manager
Move the code of the _CPU_OR1K_Cache_{enable,disable}_* functions into the
equivalent exported _CPU_cache_{enable,disable}_* functions instead, and
then delete them, in order to reduce the code indirection and aid
readability.

This does not touch the currently unused prefetch, writeback, and lock
functions.
2016-11-28 07:30:44 +01:00
Martin Erik Werner
3b4ddafe99 or1k: Avoid excessive ISR toggle in cache manager
Previously _ISR_Local_{disable,enable}() was executed twice for each
cache line operation, and since operations over the entire cache were
implemented by calling the single-line operations in a loop, this made
those operations rather costly.

Fix the double-toggle by calling _OR1K_mtspr() directly, and removing
the now-unused corresponding _CPU_OR1K_Cache_* functions.

Fix the entire-operations by moving the ISR toggle outside of the
loop, and by calling _OR1K_mtspr() directly instead of the single-line
operations.

Also implement range functions, since otherwise the cache manager falls
back on looping over the single-line operations.
2016-11-28 07:30:44 +01:00
Martin Erik Werner
4dcaa48e4a or1k: Indent & comment fix in cache.c
* Fix indentation of variable declarations.

* Change commented-out asm -> __asm__ to meet c99 standard if
  uncommented.
2016-11-28 07:30:44 +01:00
Martin Erik Werner
e639c026b9 or1k: Add functions for entire cache operations
Add functions for flushing and invalidating whole cache.

Since we don't have system calls that can operate on anything more than
a single cache line, these simply retrieves the cache size and iterates
over the full size, invalidating each line.

The current implementation assumes that there's only one level of cache.

These changes were contributed by Antmicro under contract by ÅAC
Microtec AB.

Close #2602
2016-11-28 07:30:44 +01:00
Sebastian Huber
4b5ff47d15 score: Fix interrupt profiling
Callers of _Thread_Do_dispatch() must have a valid
Per_CPU_Control::Stats::thread_dispatch_disabled_instant.

Call _Profiling_Outer_most_interrupt_entry_and_exit() with the interrupt
stack to not exceed Per_CPU_Control::Interrupt_frame.

Update #2751.
2016-11-24 08:46:20 +01:00
Sebastian Huber
01ac1db824 powerpc: Fix interrupt profiling for e6500 2016-11-24 08:46:20 +01:00
Sebastian Huber
f730c25b70 powerpc/mpc5xx: Rename CPU_Interrupt_frame
The MPC5XX support uses a legacy interrupt/exception infrastructure.

Close #2819.
2016-11-21 11:19:37 +01:00
Sebastian Huber
7ce60b378d powerpc: Use Per_CPU_Control::isr_dispatch_disable
Update #2751.
2016-11-18 07:30:35 +01:00
Sebastian Huber
d5e073cde7 score: Allow interrupts during thread dispatch
Use a processor-specific interrupt frame during context switches in case
the executing thread is longer executes on the processor and the heir
thread is about to start execution.  During this period we must not use
a thread stack for interrupt processing.

Update #2809.
2016-11-18 07:30:34 +01:00
Sebastian Huber
2599c8e63e powerpc: Add up to date CPU_Interrupt_frame
Rename ppc_exc_min_frame to CPU_Interrupt_frame.  Move it and the
corresponding defines to <rtems/score/cpuimpl.h>.

Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
bf4fdb1f1d powerpc: Move legacy CPU_Interrupt_frame
The only remaining user of CPU_Interrupt_frame on PowerPC is the mpc5xx
support.  Move it to here.

Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
40d592eb3e bsps/powerpc: Avoid use of CPU_Interrupt_frame
This type is not relevant for the code since only a pointer is passed
around.

Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
d18560ae05 sparc64: Rename CPU_Minimum_stack_frame
Rename SPARC64-specific CPU_Minimum_stack_frame to
SPARC64_Minimum_stack_frame.  Rename SPARC64-specific
CPU_MINIMUM_STACK_FRAME_SIZE to SPARC64_MINIMUM_STACK_FRAME_SIZE.

Update #2809.
2016-11-18 07:30:32 +01:00
Sebastian Huber
8ef8a32d00 bsps/mips: Use <libcpu/isr_entries.h>
Avoid duplicate mips_vector_isr_handlers() declarations.
2016-11-18 07:30:32 +01:00
Sebastian Huber
38a1449fd4 powerpc: Add _CPU_Get_current_per_CPU_control()
Add _CPU_Get_current_per_CPU_control() on SMP configurations.  Use SPRG0
for the current per-CPU control.  This reduces the code size by three
instructions and is slightly faster.

Update #2805.
2016-11-10 09:58:37 +01:00
Sebastian Huber
1f5bee3d85 score: Add and use Thread_Control::is_idle
Update #2797.
2016-11-09 15:27:30 +01:00
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
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