Commit Graph
38236 Commits
Author SHA1 Message Date
Avi Weiss d8dee2c2ff bsps/shared/dev/can/ctucanfd/ctucanfd_txb.h: Fix TXB_MASK undef typo
TXB_M apparently intended as TXB_MASK.
2026-07-29 02:57:58 +00:00
Avi Weiss fbcc85b7cb bsps/shared/dev/can/ctucanfd/ctucanfd.c: Mark error counters valid
The Error Active frame populates the TX and RX error counter bytes
but does not set CAN_ERR_ID_CNT.

Set CAN_ERR_ID_CNT so consumers know the counter fields are valid.
2026-07-29 02:57:58 +00:00
Avi Weiss 93262b33bb bsps/shared/dev/can/ctucanfd/ctucanfd.c: Set error frame payload length
Set dlen to CAN_FRAME_STANDARD_DLEN so diagnostic data is actually delivered.
Upstream Linux initializes this in alloc_can_err_skb().
2026-07-29 02:57:58 +00:00
Avi Weiss a0b9ae2f56 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Remove duplicate command
TXT_CMD_SET_READY command issued twice apparently without need.
Remove one.
2026-07-29 02:57:58 +00:00
Avi Weiss 88b801f7f5 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Fix documentation typos
Typos and swapped comments corrected.
2026-07-29 02:57:58 +00:00
Avi Weiss cfeb26fa90 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Update error frame comments
Add clarifying comments to avoid regression after some subtle
error frame bugs were corrected.
2026-07-29 02:57:58 +00:00
Avi Weiss fbd871f851 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Fix RX overflow register bug
The RX overflow handling writes REG_COMMAND_CDO to CTUCANFD_TX_COMMAND
instead of CTUCANFD_COMMAND.

This writes the CDO bit to the transmit-command register (which is
reserved) so the data-overrun condition is not actually cleared.

Use CTUCANFD_COMMAND instead.
2026-07-29 02:57:58 +00:00
Avi Weiss 0e70ff3bd3 bsps/shared/dev/can/ctucanfd/ctucanfd.c: correct CAN error frame bug
The RX overflow handling uses CAN_ERR_ID_LOSTARB, which is an
err_frame.header.can_id mask, as an err_frame.data index.

Correct it to use CAN_ERR_DATA_BYTE_TRX_CTRL as intended.
2026-07-29 02:57:58 +00:00
Joel Sherrill 99c9f78d39 bsps/powerpc/.../uboot_getenv.c: Address missing prototype warning
This patch reverts the deletion of the static method which is
intended to compute CRC32 on the U-Boot environment variables.
The function bsp_uboot_environ_check_crc() should be made functional,
not deleted.

Updates #5660.
2026-07-29 02:24:09 +00:00
Avi Weiss a5963cecdd bsp/arm/tms570: Clear up pinmux doc typos and unclear comments 2026-07-28 08:45:00 -05:00
Avi Weiss 5a03c93610 bsp/arm/tms570: apply RTEMS clang format preferences to pinmux.c
Formatting to preferred style as part of pinmux set/clear refactor.

The formatting makes future maintenance easier.
2026-07-28 08:45:00 -05:00
Avi Weiss 4d9c000f12 bsp/arm/tms570: unlock IOMM and disable interrupts before setting pins
Added the tms570_pin_config_prepare and tms570_pin_config_complete helper
calls to tms570_bsp_pin_set_function and tms570_bsp_pin_clear_function
which are required to unlock the IOMM and enable write access.

Added comment next to IOMM kick register unlock codes to make the source
and purpose of the magic numbers clear.

Also disabled interrupts during the operation for this small critical
section, as does the similar function tms570_bsp_pin_config_one.
2026-07-28 08:45:00 -05:00
Avi Weiss 5fe4dea4f4 bsp/arm/tms570: use unsigned constants for pin register shifts
Protect against left-shifting too far into the signed bit which
would be undefined behavior.
2026-07-28 08:45:00 -05:00
Kinsey Moore 098ba8472d cpukit/flashdev: Clarify interface and update consumers
This clarifies the flashdev out of band read and write interfaces and
updates any consumers of those interfaces. This was partially refactored
at one point and the refactoring didn't extend to the consumers as it
should have.
2026-07-27 12:15:22 +10:00
Shaunak Datar baeeb5db18 bsps/aarch64/raspberrypi: Update framebuffer interface to use new macros
Update the framebuffer interface to use the new tag specific offset
macros.
2026-07-24 18:06:11 +00:00
Shaunak Datar f01ecf0d2d bsps/aarch64/raspberrypi: Add offset macros for property tags
Add tag specific offset macros to the property tag interface.
2026-07-24 18:06:11 +00:00
Shaunak Datar 916ae1e223 bsps/aarch64/raspberrypi: Update the framebuffer interface to new macros
Update the framebuffer interface to use the new macros added to the
mailbox.h for the property tags.
2026-07-24 18:06:11 +00:00
Shaunak Datar 626034a530 bsps/aarch64/raspberrypi: Add size macros for the property tag interface
Update the mailbox header to include macros for the size of each
property tag.
2026-07-24 18:06:11 +00:00
Shaunak Datar 7e9b5d7d9d bsps/aarch64/raspberrypi: Add framebuffer driver
Add a framebuffer driver for the Raspberry Pi 4 BSP using the VideoCore
mailbox property tags interface.
2026-07-24 18:06:11 +00:00
Shaunak Datar 140dc98f71 bsps/aarch64/raspberrypi: Add framebuffer specific mailbox property tags
Add the mailbox property tags required by the framebuffer driver.
2026-07-24 18:06:11 +00:00
Shaunak Datar 5ffebbf757 bsps/aarch64/raspberrypi: Add mailbox property tag iterator helper
The mailbox property interface frequently needs to walk variable-sized
property tags contained within a mailbox property message. Add
rpi_get_next_tag() to encapsulate the required pointer arithmetic.
2026-07-24 18:06:11 +00:00
Wayne Thornton 2eba833517 cpukit/score/.../cpu.h: Add _CPU_Spin_wait to i386
Added _CPU_Spin_wait() assembly function to i386 architecture
and updated smpspinwait01.yaml to build test for i386
2026-07-24 08:13:39 -06:00
Wayne Thornton b562938eeb cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.

Closes rtems/rtos/rtems#5643
2026-07-23 17:09:23 -06:00
Wayne Thornton a1635abadd cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.

Closes rtems/rtos/rtems#5644
2026-07-23 16:40:26 -06:00
Wayne Thornton 95b8aa4b10 [arm] cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.

Closes rtems/rtos/rtems#5642
2026-07-23 16:25:04 -06:00
Wayne Thornton 33205ab2ef testsuites/smptests: Modify smpspinwait01 test to use Classic API
As a result of review comments, changes made to test in order
to utilize RTEMS_BARRIER_CREATE and other Classic API functions
2026-07-23 16:09:49 -06:00
Wayne Thornton 8e7ba95423 testsuites/smptests: Add smpspinwait01 test
Add smpspinwait01 to thoroughly exercise the new _CPU_Spin_wait()
architectural hint and compiler memory barrier in concurrent SMP
environments.

The test validates:

- Read-Shared bus contention: Verifies that a master core broadcast
  wake to secondary cores spinning on a shared cache line cleanly
  transitions to exclusive ownership without bus lockups.

- Compiler memory barrier enforcement: Spins on a non-volatile
  shared flag to prove RTEMS_COMPILER_MEMORY_BARRIER() prevents
  compiler optimization levels >= -O2 from hoisting loads into
  core-local registers, avoiding SMP deadlocks.

- MESI cache-line bouncing: Executes a multi-core ring token pass
  for 5,000 iterations per core. This forces continuous Modified-to-
  Invalid cache invalidation traffic across the interconnect while
  cores execute the architecture-specific spin-wait hint.
2026-07-23 08:12:13 -06:00
Wayne Thornton 286d1a039d score/cpu: Add _CPU_Spin_wait() to no_cpu template
This patch introduces the `_CPU_Spin_wait()` function to the `no_cpu`
architecture template and adds the corresponding Doxygen documentation
for the CPU Architecture Supplement.
2026-07-23 08:12:13 -06:00
Wayne Thornton 4e9ee786f6 cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load. This
function is part of the Deterministic Hedged Read Library API.
2026-07-23 08:12:13 -06:00
Avi Weiss 2731c65d39 cpukit/contrib/inlude/sys/exec_elf.h: add missing macro parentheses
Missing parentheses from macro defintion.

Note: the upstream (NetBSD) is already corrected.
2026-07-23 08:55:59 -05:00
Yang Zhang 51f2c6757b dosfs: Avoid NULL pointer dereference UB
When creating utf8 or default converters, if memory allocation or
initialization fails, 'self' becomes NULL. Returning '&self->super'
results in a NULL pointer dereference, which is Undefined Behavior
in C. This updates the code to explicitly check for NULL before
returning.
2026-07-23 13:51:31 +00:00
Pavel Pisa edb1a8bdcd bsps/arm/tms570: fix self-test to work when internal SRAM is tested
The previous fix has exposed more breakage if internal
SRAM self-tests is run when code starts from Flash
or external memory. The previous negated option has
disabled SRAM self-test in these cases and enabled
it for code running from SRAM which lead to code
self-clear.

But when code is running from Flash and full safety
should be achieved then then SRAM test run through
nested function

  /* ESRAM Single Port PBIST */
  tms570_pbist_run_and_check( 0x08300020U,
       (uint32_t) PBIST_March13N_SP )

lead to situation when lr and r3 could not be
restored in return from this function.
Memory content has been overwritten by tests.

When this problem has been solved then next
problem is that memory with enabled  ECC has
been unsynchronized and attempt to load already
overwritten lr and r3 in tms570_start_hook_0
has led to data-abort and fatal error with error
pin set till next power cycle.

The solution is to synchronize, reinitialize
internal SRAM after PBIST test.

Yer another problem is run of ECC failure detection

  tms570_check_tcram_ecc

It fails with unrecoverable data abort as well
because for proper function it requires special
support in data-abort exception handler which
is not present on RTEMS.

Closes rtems/rtos/rtems#5547

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-07-22 17:31:59 +02:00
Vijay Banerjee 4840472319 shared/u-boot: Cleanup unused function
This commit adds 'HAS_UBOOT' conditional to 'bsp_uboot_getenv' to match
the bsp.h file.

This fixes the following errors:
     error: home/tester/bsps/powerpc/shared/u-boot/uboot_getenv.c:73:13:
            error: no previous prototype for 'bsp_uboot_getenv'
            [-Werror=missing-prototypes]

Updates #5481
2026-07-20 10:36:24 -05:00
Avi Weiss cad4022a15 bsps/arm/tms570: selftest.c file comment typo correction
No code changes.
2026-07-15 15:42:36 +00:00
Avi Weiss 705cff7a90 bsps/arm/tms570: fix misnamed PBIST RINFOU register
Minor fix for clarity - the actual register name is RINFOU, not
RINFOUL.
2026-07-15 15:42:36 +00:00
Avi Weiss 08b4006896 bsps/arm/tms570: update pbist header comment typos
Comment fixes only.
2026-07-15 15:42:36 +00:00
Avi Weiss f03c755152 bsps/arm/tms570: use PBIST PACT enable macro in selftest
Previous commit removed the stale reserved PACT1 macro and added
TMS570_PBIST_PACT_ENABLE for enabling the PBIST internal clocks.

Use the new macro in tms570_selftest.c instead of raw writes.
2026-07-15 15:42:36 +00:00
Avi Weiss a9a381a38a bsps/arm/tms570: remove reserved PBIST PACT bit macro
The supported LS31x and LC43x variants define only PACT0 in the
PBIST PACT register. Bits 31:1 are reserved.

Remove the stale TMS570_PBIST_PACT_PACT1 macro. Add
TMS570_PBIST_PACT_ENABLE so callers can enable the PBIST
internal clocks without using a raw literal.
2026-07-15 15:42:36 +00:00
Avi Weiss 305224bb62 bsp/arm/tms570: documentation updates (out-of-date @retvals)
Some retval's have come out of date after refactors. Correct them.

No code/logic changes, doxygen only.
2026-07-12 15:46:17 +03:00
Avi Weiss 3d5a8ed674 bsp/arm/tms570: apply snake_case to variable names in irq.c
Apply snake_case formatting to names in irq.c for clarity, to
align with RTEMS style guide and to ease future maintenance.
2026-07-12 15:46:17 +03:00
Avi Weiss 8244f83e3d bsp/arm/tms570: add leading underscore to CPP macro paramaters
Add leading underscore to preprocessor macro paramater names
as per RTEMS style guide.
2026-07-12 15:46:17 +03:00
Avi Weiss 34510f3ec2 bsp/arm/tms570: apply RTEMS clang_format to irq.c
Ease future maintenance by standardising the formatting
according to RTEMS guidelines.

No logic changes in this commit, only clang-format applied.
2026-07-12 15:46:14 +03:00
Avi Weiss e07f69641b bsp/arm/tms570: protect against vector < 2 in irq_set_priority
calls to tms570_irq_set_priority protect against requesting a
priority < 2, but not against inputs with vector < 2.

for example calling tms570_irq_set_priority(ESM_HIGH, 10)
will not only get through the guard, it will attempt to write
to CHANCTRL0 (which gets blocked by hardware), puts whatever
was there (apparently hardcoded INT-REQ0) into channel 10,
and returns success.

So the channel 10 request dissappeared from the VIM channel
map completely - yet this call returns RTEMS_SUCCESSFUL

TRM (for both TMS570LS31x and TMS570LC43x) states:
NOTE: CHAN0 and CHAN1 are hard wired to INT_REQ0 and
INT_REQ1, so they cannot be remapped.

This commit puts a guard to fail on requests with vector < 2.
2026-07-12 15:45:29 +03:00
Chris Johns 155f798c0a libdebugger: Add TCB to extra thread info
Closes #5639
2026-07-09 16:43:02 +00:00
Ran Hong b4e6231d23 bsps/powerpc: Update and add the u-boot support
uboot_environment and uboot_environment_size are configured through
 build options UBOOT_ENV_BASE and UBOOT_ENV_SIZE.

 Support for powerpc/qoriq is added.

 For qoriq boards with u-boot, user can use the same environment
 access fuctions shared with other bsps like gen83xx.

 Closes #5481
2026-07-09 13:43:33 +00:00
Chris Johns 020b094c5f libmisc/cpuuse: Fix thread names in top
- Show classic and POSIX thread names working around the mess we now
  have with the name management in threads

Closes #5637
2026-07-09 09:22:33 +10:00
Yang Zhang 0c6821f020 bsps/pc386: Fix RTC diagnostic format
The RTC driver used the unsupported BSD-style %b conversion with
only the diagnostic register value. This did not provide the
intended bitmask decoding.

Print the diagnostic register as a two-digit hexadecimal value
instead and remove the unused RTCDG_BITS definition.
2026-07-08 20:32:25 +00:00
Chris Johns 11d1425d3f libdebugger: Format AARCH64 supportin the libdebugger style
Fix some of the spelling.
2026-07-08 02:08:20 -04:00
Chris Johns c98f9f6ce4 libdebugger: Align the warning formatting with libdeugger
Fix some of the spelling.
2026-07-08 02:08:20 -04:00
Chris Johns 3b0de038c7 libdebugger: Fix corruption of thread registers with 32 or more threads
The block logic uses realloc to resize memory used by libdebugger
when creating a snapshot of threads. Thread registers take a
reference to the block and if a realloc changes the base address
any references are invalid. Add rebase handler support to blocks
that is called when the block base changes and add a handler to
thread register blocks to rebase a thread's registers.

Exclude threads using both types of names they can have. This lets
all names be reported in extra thread info packets.

Closes #5635
2026-07-08 02:08:20 -04:00