Commit Graph
481 Commits
Author SHA1 Message Date
Sebastian Huber 43d18c66fe bsps/shared/acpi: Allow use before the subsystem
AcpiInitializeTables() runs from bsp_start(), long before there is a
heap for AcpiInitializeSubsystem() to create the mutex objects from.
The handle of a predefined mutex is a null pointer until then, so every
table which the table manager installs early reported that it could not
acquire the table mutex and then that it could not release it.

Treat a null handle as done rather than as a bad parameter.  There is a
single thread of execution at that point and nothing to serialize.

The errors were not visible so far because the ACPICA output goes to the
standard output, whose buffer is discarded at the end of a test run.
Routing it to printk() makes them appear, 19001 lines in one suite run.

Close #5705.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-21 09:00:39 +10:00
Sebastian Huber 8008d814b0 bsps/i386/pc386: Be quiet at startup
The four fatal validation suites open their test report at
RTEMS_SYSINIT_BSP_EARLY, so the report spans the whole system
initialization and every line the BSP prints during it lands inside the
report and breaks its hash.

Seven messages did, and each of them announces a normal outcome: no
video mode was requested, the interrupt controller has an ELCR, the PCI
BIOS interface works, the legacy UART ports exist, the machine has no
PCI to PCI bridge, and the console is the one which the command line
asked for.  The messages for a failure stay.

The last one read the in service and the interrupt request register of
the 8259A and printed both when they disagreed about the line being
unmasked.  A line which requests service and is not yet in service is
the normal state of a device with work pending, so it fired on the
clock and the console at every boot.

bootverbose is what a FreeBSD driver consults when the user asks for a
verbose boot.  The copy here defined it as one.

Close #5698.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:47:07 -05:00
Matteo Concas 021d96b86e bsps/irq: Add bsp_interrupt_vector_modify function 2026-08-13 17:55:57 -05:00
Pavel Pisa 818af27299 bsps/shared/dev/can/sja1000: option to enforce 32-bit access
On the ESP32C3, when registers are access by 8-bits
then writes to (at least some) registers are ignored.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-08-13 17:30:05 -05:00
Pavel Pisa 0ecd851ffb bsps/shared/dev/can/sja1000: reenable I/O mapped support for i386 target
The I/O mapped SJA1000 is required to support Kvaser CanS/D/Q boards
which have emulation in mainline QEMU.

The I/O space mapping is enabled by RTEMS_CAN_SJA1000_ARCH_WITH_IO_PORTS
option set in hw_options during initialization.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-08-13 17:30:05 -05:00
Avi Weiss 6eb8a4a2f0 bsps/shared/dev/flash: Fix JFFS2 flashdev file leaks
Close the flash file before returning from these 5 early setup failure
paths. Otherwise the file descriptor and selected flash region remain
allocated.
2026-08-02 20:24:23 +03:00
Avi Weiss f3536b2927 bsps/shared/dev/flash: Fix read-only JFFS2 mount option
Open works correclty with the read_only argument but mount
ignores and always uses READ_WRITE.

Use RTEMS_FILESYSTEM_READ_ONLY when read_only is true so the
filesystem rejects write operations and does not perform erase
operations when under a read-only mount.
2026-08-02 18:03:16 +03:00
Avi Weiss 67bd3ea530 bsps/shared/dev/can/sja1000/sja1000.c: Fix RX overflow error data byte
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
Avi Weiss 76575d65c3 bsps/shared/dev/can/sja1000/sja1000.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 8a41720437 bsps/shared/dev/can/sja1000/sja1000.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 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
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
Michal Lenc 7f98bd8469 i2c: move drivers from cpukit to bsps/shared
More i2c drivers from cpukit to bsps/shared to allow them use BSP
infrastructure if needed. The framework code i2c-bus.c and i2c-dev.c
kept at its original location.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-07-02 18:33:01 -05:00
Michal Lenc 5ebf57e2af can: move drivers from cpukit to bsps/shared
Move CAN controllers from cputik to bsps/shared directory. This will
allow to use BSP level interface which may be needed for some
controllers. Generic CAN stack implementation is still kept in the
original directory as this shoudl be independent from the low level
driver interface.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-07-02 18:33:01 -05:00
Sebastian Huber 385d322d81 bsps: Fix variable set but not used error
Fix this error:

xnandpsu_onfi.c: In function 'XNandPsu_OnfiParamPageCrc':
xnandpsu_onfi.c:62:13: error: variable 'DataByteCount' set but not used
[-Werror=unused-but-set-variable=]
   62 |         u32 DataByteCount = 0U;
      |             ^~~~~~~~~~~~~

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-22 14:45:34 -05:00
Joel Sherrill c0dcfb75d6 bsps/shared/dev/gpio/gpio-support.c: Address unused variable warning
release_sc was set but not used by anything other than _Assert()
statements. Added "(void) release_sc"
2026-06-22 10:49:12 -05:00
Yang Zhang 5661c6531f bsps/shared/gpio: Fix group define leaks
In rtems_gpio_define_pin_group(), several malloc() calls did not
check their return values. This could lead to NULL pointer
dereferences in later initialization steps.

The previous error handling also leaked memory and hardware pin
resources if an intermediate step.

This patch refactors the error handling path to address these issues.
2026-06-18 16:48:55 +00:00
Yang Zhang 7e68b06641 bsps/shared/gpio: Correct spelling
Rename the struct member bsp_speficifc_pins to bsp_specific_pins.
2026-06-18 16:48:55 +00:00
Matteo Concas 18e5aace1d grlib/tlib: Use correct IRQ(A)MP field names 2026-06-17 21:52:24 +02:00
Matteo Concas b236b3763b grlib: Fix warnings 2026-06-17 21:52:24 +02:00
Matteo Concas 344e05b0e0 grlib: Fix errors introduced by format changes
Closes #5609
2026-06-05 10:52:05 +02:00
Matteo Concas 7a2a99e0ef grlib: Reformat source with clang-format 2026-06-03 12:13:16 -05:00
Matteo Concas 0c6605b58b grlib: Add 64 bit compatibility
Work towards having GRLIB be a part of the NOEL BSPs
It is not "true" 64 bit as the devices themselves are still
on a 32bit bus.
2026-06-02 12:49:33 -05:00
Kinsey Moore 1f06311c79 bsps/shared/gpio: Resolve assert build issues
Change assert() to _Assert() to resolve build issues with the change of
header.

Closes #5569
2026-05-18 15:12:04 -05:00
Shivam Deolankar b41f83249a bsps/zynq-uart: fix parity configuration handling
Fix parity handling in zynq_uart_set_attributes() by clearing existing
parity bits before setting a new mode instead of always ORing PAR_NONE,
which caused incorrect or ignored parity; also fix inverted PARODD logic
and add ZYNQ_UART_MODE_PAR_MASK to manage the parity field correctly.

Fixes #5554
2026-05-18 14:13:59 -05:00
Sunil Hegde 02f00a9e3b bsps/shared: Fix formatting in z85c30.c and mc68681.c
Fix formatting as suggested by the pipeline, no functional
changes were made.
2026-05-08 15:04:59 +10:00
Sunil Hegde f8b023df3a bsps/shared: removed uses and prototypes of set_vector()
removed uses of set_vector() accross two shared files,
i.e. mc68681.c and z85c30.c
the shared/start/setvec.c has been deleted too.

Closes #5215
2026-05-08 15:04:59 +10:00
Joel Sherrill c65ea8e86f bsps/shared/.../gpio-support.c: Address maybe uninitialized warning
This code was flagged as maybe-uninitialized when compiling at -Og.
The underlying problem was functional code in an assert(). If
compiled with asserts disabled, there would have been no mutex
lock/unlock. Changed the macros to obtain and release the mutex
independent of assert() being enabled or not and switched to using
the RTEMS assert _Assert() which lets this check follow the
RTEMS_DEBUG setting.
2026-05-06 14:46:12 -05:00
Samuel Viegas 3889ed31d4 bsps: Fix input data type on irq-generic.c/.h
- Constify bsp_interrupt_entry_find()

- bsp_interrupt_entry_find does not modify
the object referenced by arg, it only compares
pointer values against it.

- changed the parameter type from void* to
const void* in both declaration and
definition to make it correct and safer.

Update #4816
2026-04-23 13:38:23 +00:00
Kinsey Moore 25d99a6e5e bsps/xqspipsu: Avoid function casting 2026-04-22 07:21:54 -05:00
Kinsey Moore 987fd6f834 bsps/xqspipsu: Fix sign mismatch 2026-04-22 07:21:54 -05:00
Sebastian Huber de8ef0424c dev/ns16550: Fix race condition in transmit path
In SMP systems, the interrupt handler may run concurrently with tasks
trying to transmit.  Properly protect the transmit state through the
device lock.  Simplify the transmit process.

Close #5552.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-04-17 01:16:09 +02:00
Joel Sherrill b346eedc1f acpica/namespace/nsaccess.c: Address set but unused warnings
GCC 16 flagged this while GCC 15 did not. Because the variable was
used only when ACPI_DEBUG_PRINT() was defined to print, there was
no way to conditionalize the presence of the variable.
Added the "(void) NumCarats" hint to avoid the warning.
2026-04-12 07:31:46 -05:00
82a4e3dfc2 cpukit: Support dates later than 2100
These changes eliminate the year 2100 as a limit for TOD. The new
limit is the year 4096. This limit is not due to any RTEMS limitation
but just before the year 4183 when the rounding error in the length
of the year adds up to an entire day. See
https://de.wikipedia.org/wiki/Schaltjahr for details.

There are still limits on Classic APIs which use the 32-bit rtems_interval
type. This corresponds to the Score Watchdog_Interval type. This impacts
delays, timeouts, and Classic API "after" timers.

Closes #5143

Co-authored-by: Joel Sherrill <joel@rtems.org>
Co-authored-by: Gedare Bloom <gedare@rtems.org>
2026-03-02 10:04:32 -06:00
Preetam Das 09343c8ff9 bsps/shared: Extract PSCI target_cpu calculation
This adds a BSP-level function that returns the calculated PSCI
target_cpu parameter for a given cpu_index. BSPs can override this
function to use the correct affinity level for the calculation.

Also updates _CPU_SMP_Start_processor() to make use of this
function and remove code duplication.
2026-02-24 22:14:32 +05:30
Bhuvan 314f38e8d4 bsps/shared/: fix pedantic warnings for SPIN_DECLARE
Fixes #5483
2026-02-13 13:32:11 +00:00
Kinsey Moore 8a776715fe shared/irq: Resolve function cast warning
The function cast from more parameters to fewer parameters is generally
unsafe as the additional parameters will be undefined values that happen
to be in the right registers if it is ever called. Instead of casting
the function pointer, provide a dummy function pointer when the original
function pointer is non-NULL since it is only ever used for a
NULL-check.
2026-02-06 13:29:20 -06:00
Joel Sherrill d78565bcdb bsps/shared: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one.
This addresses warnings that only occurred on 64-bit targets.  For the
ones which only appeared on 64-bit targets, the cause was frequently
a mismatch when comparing a combination off_t, ssize_t, and int.
2026-02-05 00:17:19 +00:00
Joel Sherrill b906181b15 bsps/shared/dev: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
2026-01-28 19:31:11 +00:00
Joel Sherrill 474c74efce bsps/shared/grlib: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
2026-01-28 19:31:11 +00:00
Joel Sherrill 5be6a2ea4f bsps/shared/.../spictrl.c: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
2026-01-28 10:13:21 -06:00
Joel Sherrill 3a61921132 mp misc: Address build failures and warnings
Changes required to build with RTEMS_MULTIPROCESSING and
associated tests without warnings.
2026-01-27 18:20:55 +00:00
Prakhar Kumar a5803cbc89 bsp/shared/grlib: Fixed missing semicolon
Fixes a typo where a '.' was placed instead of semicolon.
2026-01-23 13:37:25 +05:30