Commit Graph

29578 Commits

Author SHA1 Message Date
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
Sebastian Huber
992494e3dd score: Fix for RTEMS_DEBUG 2016-07-22 12:37:03 +02:00
Sebastian Huber
64ed0bb307 score: Assert proper seqlock writer state
Helps to detect invalid concurrent writes.
2016-07-22 11:24:53 +02:00
Sebastian Huber
059529e685 score: Add debug support to chains
This helps to detect

 * double insert, append, prepend errors, and
 * get from empty chain errors.
2016-07-22 09:13:07 +02:00
Sebastian Huber
3cdda03c5a posix: Fix double chain extract 2016-07-21 15:26:47 +02:00
Pavel Pisa
8709aa0459 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
2016-07-21 02:35:00 +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
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
55bde66ff8 beagle: pwm polishing
. added a README to pwm
	. added select_pwmss() to select pwmss-generic registers, as opposed
	  to PWM-specific registers
	. added pwmss_clock_en_status(), beagle_pwmss_is_running() and pwmss_tb_clock_check()
	. other API improvements
	. style improvements
2016-07-17 16:48:18 +02:00
Joel Sherrill
612297e813 Misc: Spell length correctly 2016-07-12 05:44:17 -05:00
Joel Sherrill
665f03acb3 DOSFS - LENGHT -> LENGTH
closes #2756,
2016-07-12 05:43:06 -05:00
Sebastian Huber
814bd6e3ba bsps/powerpc: Fix AltiVec enable
There must be an isync after the mtmsr to ensure that the AltiVec is
enabled for subsequent instructions.
2016-07-12 10:13:01 +02:00
Sebastian Huber
6f6cf78501 score: Postpone SMP shutdown in _Terminate()
This enables fatal extensions to continue program execution after some
fatal errors.
2016-07-06 09:33:32 +02:00
Sebastian Huber
008efaff7f score: Do not disable ISR in _Terminate()
This partially reverts 38ee75853f.  Let
the calling context decide if interrupts must be disabled or not.  The
goal is to enable fatal extensions to continue program execution after
some fatal errors.
2016-07-06 09:33:20 +02:00
Chris Johns
8aa75d0cb1 Config (.cfg) files are only valid if deeper than 5. 2016-07-06 13:01:39 +10:00
Joel Sherrill
5df74991bf rtems-bsps: Update 4.11 to 4.12 2016-07-05 10:43:33 -05:00
Joel Sherrill
116370c647 shared/console-polled.c: Use standard fatal error codes 2016-07-05 10:42:29 -05:00
Sebastian Huber
c30584738f bsps/arm: Fix basic cache support for SMP 2016-07-05 08:02:24 +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
Punit Vara
6dc5c03fad Beaglebone: Add original BBBIO PWM driver
This patch adds the PWM driver code for the Beaglebone Black from BBBIO:

https://github.com/VegetableAvenger/BBBIOlib/blob/master/BBBio_lib/BBBiolib_PWMSS.c

This commit is for tracking purposes only; the next commit will adapt the code for
RTEMS.
2016-07-04 15:08:54 -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
2b885d6084 libdl/rtl-obj.c: ensure that loaded code is synchronized through caches.
Synchronize each cluster of sections of the same type separately
to support even cases where text and data are allocated from different
areas (for example due allocation from different MPU protection regions).

rtems_cache_instruction_sync_after_code_change is called even to data
sections. Propagation of data only changes should not require cache
maintenance operation on sane SMP mutithread capable systems if barrier
instruction is added but be on safe side even for case where self
modifying code uses data sections initial values etc.
2016-07-04 15:55:57 +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
abea02a832 bsp/arm: Report correct maximal cache line length for ARM Cortex-A + L2C-310. 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
2d5902d6ae arm/raspberrypi: update VideoCore cache flush workaround to work on RPi2.
The arm_cp15_data_cache_clean_and_invalidate leads to hang on RPi2,
clean by individual lines works on RPi1 and RPi2.
2016-07-04 15:55:57 +02:00
Pavel Pisa
0cb50ab25b 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.
2016-07-04 15:55:57 +02:00
Pavel Pisa
fe106ad5e2 arm/raspberrypi: Enable HYP to SVC switch for this BSP.
This support is required when newer firmware is used on
Raspberry Pi 2 boards.
2016-07-04 15:55:57 +02:00
Pavel Pisa
5812df8f52 bsps/arm: Support recent bootloaders starting kernel in HYP mode
When HYP mode is detected at startup then setup HYP mode
vectors table (for future extensions) clean exceptions
switching to HYP mode and switch CPU to ARM SVC mode.

BSPs which want to use this support need to include next option
in their configure.ac

  RTEMS_BSPOPTS_SET([BSP_START_IN_HYP_SUPPORT],[*],[1])
  RTEMS_BSPOPTS_HELP([BSP_START_IN_HYP_SUPPORT], [Support start of BSP in ARM HYP mode])
  AM_CONDITIONAL(BSP_START_IN_HYP_SUPPORT,test "$BSP_START_IN_HYP_SUPPORT" = "1")

and need to include next lines in corresponding Makefile.am

  if BSP_START_IN_HYP_SUPPORT
  libbsp_a_SOURCES += ../shared/startup/bsp-start-in-hyp-support.S
  endif
2016-07-04 15:55:56 +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
Alexander Krutwig
137bd3747e bsp/atsam: Add RTC driver 2016-07-04 14:10:34 +02:00
Sebastian Huber
0057e38f9d libchip: Simplify RTC driver 2016-07-04 11:06:53 +02:00
Sebastian Huber
2e3ba71256 net: Fix byte order issue for getnameinfo() 2016-07-01 15:16:10 +02:00
Sebastian Huber
df2177ab5e score: Change scheduler node init and destroy
Provide the scheduler node to initialize or destroy to the corresponding
operations.  This makes it possible to have more than one scheduler node
per thread.
2016-07-01 14:47:07 +02:00
Sebastian Huber
4cb13c3998 score: Fix MPCI message layout
Restore the 32-bit priority field in MP_packet_Prefix.

Bug introduced by 254dc82daf.

Close #2750.
2016-07-01 11:55:23 +02:00
Sebastian Huber
c0bd0064ac rtems: Fix rtems_task_set_scheduler() API
Task priorities are only valid within a scheduler instance. The
rtems_task_set_scheduler() directive moves a task from one scheduler
instance to another using the current priority of the thread. However,
the current task priority of the source scheduler instance is undefined
in the target scheduler instance. Add a third parameter to specify the
priority.

Close #2749.
2016-07-01 11:51:49 +02:00
Sebastian Huber
8d5b03802e score: Workaround for #2751
The ARM and PowerPC interrupt epilogues call _Thread_Dispatch() with
interrupts disabled (counter example: SPARC).

On SMP configurations, since inter-processor interrupts set the thread
dispatch necessary indicator this prevents a thread dispatch
notification in post-switch handlers (which all run with interrupts
disabled).

On all configurations, this is a serious issue for the interrupt
latency.

Update #2751
2016-07-01 11:51:49 +02:00
Sebastian Huber
23dedc448e score: Next try to fix thread lock on SMP 2016-07-01 11:51:49 +02:00
Sebastian Huber
4142f73762 score: Fix priority affinity SMP scheduler
Bug introduced by 9bfad8cd51.
2016-07-01 11:51:48 +02:00
Sebastian Huber
4280dff7cf smptests/smpstrongapa01: Simplify 2016-06-30 11:01:05 +02:00
Sebastian Huber
4fe0e97f91 smptests/smpstrongapa01: Add test cases 2016-06-30 09:54:41 +02:00
Sebastian Huber
729cf694e8 bsps: Do not use fast idle clock for SMP
We may have more than one idle thread.  Thus, the clock driver fast idle
logic would be a bit more complicated.
2016-06-30 09:51:19 +02:00
Sebastian Huber
09c87fb06b score: Strong APA scheduler processor allocation
Use _Scheduler_SMP_Allocate_processor_exact() to prevent unexpected
migrations.
2016-06-30 09:51:18 +02:00
Sebastian Huber
029877282e score: Avoid atomic fences for thread wait flags
The use of atomic fences is brittle and may break due to changes in
different areas which is hard to manage.
2016-06-30 07:57:44 +02:00
Sebastian Huber
b6b25a9e68 score: Fix thread lock on SMP configurations 2016-06-30 07:57:33 +02:00