Commit Graph
250 Commits
Author SHA1 Message Date
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
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
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
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
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 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
Remi Debord 0b2455f6f8 bsps/arm: Add BSP for Versal RPU 2026-01-15 11:43:59 +01:00
Remi Debord 126e19aa60 bsps/shared/dev/serial: Move Versal UART sources 2026-01-15 11:42:45 +01:00
M Mithilesh 6e4f134238 bsps/flash: Fix resource leak in flash_sim_flashdev_init (CID 1679602)
The allocation of ftable was not freed in error handling paths.
This patch ensures ftable is freed if subsequent allocations fail.

CID 1679602
2026-01-13 23:01:31 +05:30
Aaron Nyholm 0ee1c38aa6 bsps/shared/dev/nor: Added support for multiple CFI regions
CFI parser now returns largest block size when multiple regions
are present allowing for block erase to be used with returned size.
2025-12-04 18:52:00 -06:00
Kinsey Moore d82efbd7d1 bsps/shared/dev/nor: Add SFDP and CFI parsers
Fixed flashdev doxygen group
2025-12-04 18:52:00 -06:00
Kinsey Moore 20faa90860 bsps/shared/dev/flash: Add a flashdev simulation backend
This adds a backend for flashdev that simulates a flash device with
adjustable delays to simulate real flash devices and offers
configurable flash parameters. This also migrates the JFFS2
filesystem tests to the flashdev framework and eliminates the
purpose-built simulated flash in the testsuite in favor of a more
generic and widely usable solution.
2025-12-04 14:12:55 -06:00
Kinsey Moore ff52b009b5 bsps/shared: Add XNandPsu flashdev backend
Add a flashdev backend supporting the XNandPsu peripheral on ZynqMP
systems.
2025-12-03 08:25:50 -06:00
Kinsey Moore 54de3ac479 bsps/shared/xqspi_flash.c: Add support for sector information 2025-11-10 12:29:31 -06:00
Joel Sherrill a4333a4361 bsps/shared/dev/serial/*.c: Correct comparisons of different signedness
The GCC warning -Wsign-compare flagged these instances of comparing
signed and unsigned types. A common pair was size_t and int.
2025-11-06 10:22:51 -06:00
Joel Sherrill 9e8a8dff2e bsps/shared/dev/gpio/gpio-support.c: Address type limit warnings
GCC generates type limit warnings when comparison is always true or
always false due to the limited range of the data type, This was in a
termios structure. For most of the cases in RTEMS, this was when
a variable of an unsigned type was compared to be < or <= 0.
2025-10-28 19:33:35 +00:00
Aaron Nyholm 190899ee61 bsps/shared/jffs2_flashdev.c: Fixed fatal heap error on failed mount
Removed double free of mount_data and instance.
Closes #5381
2025-10-28 15:15:08 +11:00
Kinsey Moore 2cb47d2010 bsps/jffs2_flashdev: Return correct value for OOB size
Return the actual out of bounds size per page instead of the ioctl
return status. JFFS2 will happily operate with an OOB size of 0 and
instead put cleanmarkers in the normal page space of the flash.
2025-10-23 15:31:57 -05:00
Kinsey Moore 955d36ea47 bsps/qspi: Make flashdev control structure private
These structures are not required to be exposed to users for any
functionality and users of the API have no way to make use of them.
2025-10-16 11:26:52 -05:00
Joel Sherrill f63b5b6661 bsps shared arm: Address unused parameter warnings
Add "(void) param;" annotation to address unused parameter warnings.
Found with GCC's warning -Wunused-parameter.
2025-10-10 22:01:39 +00:00
Joel Sherrill bc959e983f bsps/shared/*: Address unused parameter warnings
Add "(void) param;" annotation to address unused parameter warnings.
Found with GCC's warning -Wunused-parameter.
2025-10-10 20:52:14 +00:00
Kinsey Moore ea7a756ea1 bsps/shared/dev/flash/jffs2: Add support for NAND
This adds support for NAND to the JFFS2 flashdev adapter.
2025-10-08 16:43:09 +00:00