Commit Graph
38149 Commits
Author SHA1 Message Date
Avi Weiss adf8402fe4 bsps/arm/tms570: emacm.h comment typo corrections
Clean up some incorrect comments in the emacm.h header.
2026-06-18 16:47:47 +00:00
Avi Weiss bbaff81206 bsps/arm/tms570: Add missing EMACM RXMBPENABLE RXMULTCH macros
The RXMULTCH field (bits 2:0) is missing from the EMACM RXMBPENABLE
macros. It looks like the auto-gen did not pick it up, although the
field is present in the both the LC43x and LS31x TRMs.
2026-06-18 16:47:47 +00:00
Avi Weiss 4bb828edda bsps/arm/tms570: reg_sys.h ECPINSEL macros generated with wrong bits
Apparently the auto-gen read bit 6 isntead of bit 16.

Corrected here.
2026-06-18 16:46:48 +00:00
Avi Weiss 424e4957bb bsps/arm/tms570: fix SYS clock domain macro definitions
Correct a few generated SYS register macro definitions to match the TRM.

Bits 10 and 9 in the clock domain disable/set/clear registers are
reserved, and VCLKA4 is bit 11. Also fix the VCLKA2 set/clear macro
names and standardise the EFUSE_ABORT macro casing.
2026-06-18 16:46:04 +00:00
Avi Weiss b0d94ec1b9 bsps/arm/tms570: Remove invalid SYS1 PLLCTL3 macros
PLLCTL3 is part of the SYS2 register block, not SYS1.

Remove the invlid TMS570_SYS1_PLLCTL3_* macro block from reg_sys.h.
The valid SYS2 definitions already exist in reg_sys2.h.
2026-06-18 16:46:04 +00:00
Avi Weiss 76105bf701 bsps/arm/tms570: reg_dma.h comment typo fixes/updates
No code changes.
2026-06-18 16:45:11 +00:00
Avi Weiss 9aa14d7ba1 bsps/arm/tms570: Remove obsolete DMA BER mapping fields
Remove the obsolete BERMAP, BERAOFFSET, and BERBOFFSET struct members
and the corresponding TMS570_DMA_BERMAP, TMS570_DMA_BERAOFFSET, and
TMS570_DMA_BERBOFFSET access macros.
2026-06-18 16:45:11 +00:00
Cheng Mingming e73cb3ee2b cpukit/dev/can: Reject out-of-range CAN queue priority
can_bus_ioctl_create_queue() validates the priority supplied by user
space via the RTEMS_CAN_CREATE_QUEUE ioctl. The valid range is 0 to
RTEMS_CAN_QUEUE_PRIO_NR - 1, since RTEMS_CAN_QUEUE_PRIO_NR is the
number of available priority classes.

The previous check rejected only values greater than
RTEMS_CAN_QUEUE_PRIO_NR, so a priority equal to RTEMS_CAN_QUEUE_PRIO_NR
passed validation and was stored in edge_prio. Reject this value at
the ioctl boundary instead of accepting an out-of-range priority and
relying on later internal handling.

Use >= so that only priorities within the documented range are
accepted.
2026-06-18 16:30:42 +00:00
Sebastian Huber 141b39c1a4 cpukit: Format list items using -
The `mdformat` tool used for the documentation formatting uses `-`
instead of `*` for list items. Harmonize the format especially for the
files generated from specification items.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-18 13:31:39 +02: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
Avi Weiss bd60b8625d bsp/arm/tms570: Correct typos in hwinit files as part of SDRAM bug fix
Some typos are corrected in the files that are part of the SDRAM init
bug fix.
2026-06-17 14:48:51 -05:00
Avi Weiss c39026161a bsp/arm/tms570: Init SDRAM earlier while EMIF clock still on OSCIN
Move SDRAM init earlier for the 4357 variant, to comply with the
recommendation in EMIF#5 (TMS570LC4x Microcontroller Silicon Errata.

Due to a hardware fault, the 4357 SDRAM must be initialised while
the EMIF clock is still running on OSCIN.
2026-06-17 14:48:51 -05:00
Avi Weiss 8cb8b2c9e2 bsps/arm/tms570: rti header documentation typo fixes
No logic changes - comment updates only.
2026-06-17 17:52:14 +00:00
Avi Weiss a3f6922072 bsps/arm/tms570: Fix RTI DWDPRLD helper macro width
RTIDWDPRLD.DWDPRLD is a 12-bit field, but the generated helper
macros had it as bits 0..15 (16 bits).
2026-06-17 17:52:14 +00:00
Avi Weiss 2b34f4d35f bsp/arm/tms570: Use BSP_INTERRUPT_VECTOR_COUNT in place of magic number
- replaces the hard-coded VIM vector table initialization limit (magic
  number) with the already defined constant BSP_INTERRUPT_VECTOR_COUNT
2026-06-17 17:51:14 +00:00
Avi Weiss 0348f79b45 bsp/arm/tms570: Add VIM vector table ECC support for 4357x variants
- introduces a variant-aware tms570_vim_t struct so the ECC version
  (on the 4357 variants) can be represented and we can set the required
  flags
- adds the required LC4357 VIM ECC initialization sequence: set
  fallback vector (FBVECADDR), enable ECC and then clear ECC error
  flags after the for loop rewrites the vector table.

See TRM section 19.5.1 Interrupt Vector Table Operation which states:
It is recommended to restore the content of the VIM before clearing the ECCSTAT.
2026-06-17 17:51:14 +00:00
Avi Weiss 841954b1a5 bsp/arm/tms570: Make VIM vector table entries volatile
Mark the VIM vector table entries volatile so the compiler does
not try to optimise or re-order these. They can have side-effects
and should be explicitly forced as real hardware writes.
2026-06-17 17:51:14 +00:00
Avi Weiss 18136ff74e bps/arm/tms570: Add 4357x VIM ECC register definitions and macros
This commit adds ECC-related VIM Control Register definitions and
access macros for setting up and modifying the VIM ECC/SECDED
feature on the 4357x variants.
2026-06-17 17:51:14 +00:00
Avi Weiss bb31bd6aa5 bsps/arm/tms570: ADC Event Group RAM Write Address Register misnamed
TMS570_ADC_EVRAMWRADDR_G1_RAM_ADDR is somehow a combination of the
ADC Event Group RAM Write Address Register with the ADC Group1 RAM
Write Address Register.

This commit corrects it.
2026-06-17 17:49:30 +00:00
Avi Weiss 9db80210a0 bsps/arm/tms570: ADC_G1SRC Group 1 macro name fix
TMS570_ADC_G1SRC_GI_EDG_BOTH should be G1 (number one) not GI (letter 'i').
2026-06-17 17:49:30 +00:00
Avi Weiss afed8330df bsps/arm/tms570: reg_adc.h comment typo corrections
Comment typo corrections. No code changes.
2026-06-17 17:49:30 +00:00
Avi Weiss e596f58c9a bsps/arm/tms570: Add enhanced 4357 ADC register support
Some additional registers are available past PWRUPDLYCTRL
on the 4357 variant. This commit adds support for those
registers.
2026-06-17 17:49:30 +00:00
Avi Weiss 6cbdcd0e9d bsps/arm/tms570: htu.h register macro/mask comment cleanup
Fix some bugs and missing comments in htu.h
2026-06-17 17:48:41 +00:00
Avi Weiss a67cd76200 bsps/arm/tms570: Add missing HTU MPCS memory protection config macros
This adds the missing HTU MPCS memory protection config macros to
set the fields in TRM Table 24-39. Memory Protection Control and
Status Register (HTU MPCS) Field Descriptions.
2026-06-17 17:48:41 +00:00
Avi Weiss 4dc74d35e3 bsps/arm/tms570: Add missing HTU ACPE field macros
Adds the missing ACPE (Active Control Packet and Error Register)
status/diagnostic field macros so HTU error handling can decode
the active/error transfer context.

Previously we could just check ERRF true or not, now we can get the
full detail.
2026-06-17 17:48:41 +00:00
Avi Weiss 453c79547b bsps/arm/tms570: Add Interrupt Mapping Register to tms570_htu_t
Adds the INTMAP (Interrupt Mapping Register) to the tms570_htu_t
struct which was missing before inside a padding block. Adds the
access macros as well.
2026-06-17 17:48:41 +00:00
Avi Weiss a621cba19d bsps/arm/tms570: Fix HTU header mask bugs (reserved field accesses)
INTTYPE and CPOFF masks go 1 outside their bounds and access reserved
fields.
2026-06-17 17:48:41 +00:00
Avi Weiss da175144ed bsps/arm/tms570: iomm.h header documentation cleanup
Minor comment fixes in the IOMM header.
2026-06-17 17:48:00 +00:00
Avi Weiss 9a3bd050fe bsps/arm/tms570: Remove non-existent IOMM_PINMUX_FAULT_CLEAR register
This register does not appear to exist in either varient. See for
example TRM Table 6-12. IOMM Registers
2026-06-17 17:48:00 +00:00
Avi Weiss 235046ba17 bsps/arm/tms570: Add back the PINMMR30 register (off-by-one error)
Commit 4f6fa9746d removed the PINMMR30
register during a refactor.

This adds it back.
2026-06-17 17:48:00 +00:00
Yang Zhang 2a8ecbcb0d bsps/arm/imx: Fix GIC IRQ number calculation
Signed-off-by: Yang Zhang <zhangyang03@kylinos.cn>
2026-06-17 12:03:40 -05:00
Moksh Panicker 73ac0c9674 bsps/arm/stm32f4: Add SPI bus driver
Adds an interrupt-driven SPI bus driver for the STM32F4 SPI
peripheral implementing the RTEMS spi_bus API (dev/spi/spi.h).

The STM32F4 SPI has no hardware FIFO - the data register holds
a single byte - so the driver handles one byte per TXE/RXNE
interrupt pair. This is a hardware constraint, not an
implementation choice. DMA support can be added in a future
version.

Supports 8-bit full-duplex master mode, SPI modes 0-3 (all
CPOL/CPHA combinations), MSB/LSB-first, and automatic baud-rate
prescaler selection. Chip select is left to the application
via GPIO.

New files:
- stm32f4xxxx_spi.h: register definitions (RM0090 section 28.5)
- stm32f4-spi.h: public driver interface
- spi.c: driver implementation

stm32f4.h updated with STM32F4_SPI1/2/3 peripheral accessors.
SPI base addresses per RM0090 table 1: SPI1 on APB2 at
0x40013000, SPI2 and SPI3 on APB1 at 0x40003800 and 0x40003C00.

Verified to compile cleanly for arm/stm32f4 and
arm/realview_pbx_a9_qemu with GCC 15.2.0.
2026-06-17 00:45:02 +00:00
Sebastian Huber 2582a21ade build: Update GCC build key
This is required for matching bitset type definitions provided by
Newlib.

Update #4864.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-16 16:39:09 +02:00
Sebastian Huber 7bc1fefaa8 score: Use unsigned type for processor masks
Using signed integers for bit fields may result in undefined or
implementation-defined behaviour.  Use an unsigned type instead.

Requires a matching Newlib version.

Update #4864.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-11 17:52:59 -05:00
Yang Zhang ba0b035a21 posix: fix mmap boundary check
The inclusive comparison against st_size incorrectly rejects mappings
ending exactly at the file boundary.

This patch:
1.Changes >= to > to allow valid mappings up to the file size.
2.Uses subtraction-based logic to prevent potential integer overflow.
build/2026-03-04
2026-06-11 17:32:31 -05:00
Gedare Bloom 899e6a7ac3 libtests/fdt02: make test functions static 2026-06-11 17:27:34 -05:00
Gedare Bloom bea812233c libtests/fdt02: add get uint testing
Updates #5607
2026-06-11 17:27:34 -05:00
Gedare Bloom 9b815f7446 libtests/fdt02: add index entry testing
Updates #5607
2026-06-11 17:27:34 -05:00
Gedare Bloom 7d60e5681f libtests/fdt02: add memreserve testing
Updates #5607
2026-06-11 17:27:34 -05:00
Gedare Bloom e3dc884685 libtests/fdt01: make test functions static 2026-06-11 17:25:15 -05:00
Gedare Bloom 9aa0c138b6 cpukit/rtems-fdt: return offset 0 for the root node
Fixes #5612
2026-06-11 17:25:15 -05:00
Gedare Bloom fc29c5d1e8 cpukit/rtems-fdt: fix rtems_fdt_supernode_atdepth_offset
rtems_fdt_supernode_atdepth_offset() passes the handle instead of the
blob to fdt_supernode_atdepth_offset()
2026-06-11 17:25:15 -05:00
Gedare Bloom 9cc24daf62 testsuites/fdt01: add test for depth and supernode_depth
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom 8bfb4e3009 testsuites/fdt01: update doc file
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom e9101393dc testsuites/fdt01: add test for rtems_fdt_prop_map
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom 19c8a21678 testsuites/fdt01: add test for rtems_fdt_getprop_address_map
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom d08cf78230 testsuites/fdt01: add path and alias tests
Updates #4150
2026-06-11 17:25:15 -05:00
Cheng Mingming a241e49bda cpukit/dev/flash: Fix region bitmap clear size
rtems_flashdev_register() cleared the region allocator bitmap with
memset( table->bit_allocator, 0, alloc_array_len ) where alloc_array_len
held the number of uint32_t words.  Since bit_allocator is a uint32_t
array, only one byte per word was zeroed, leaving the rest of the bitmap
uninitialised.  Stale bits can make
rtems_flashdev_find_unallocated_region() report region slots as
allocated and fail REGION_SET with ENOMEM while slots are actually free.

Rename RTEMS_FLASHDEV_BITALLOC_LENGTH to RTEMS_FLASHDEV_BITALLOC_WORD_LENGTH
to make the word count explicit, add RTEMS_FLASHDEV_BITALLOC_BYTE_LENGTH for
the size in bytes, and clear the whole bitmap using the byte length.
2026-06-10 09:42:54 +08:00
Avi Weiss c207718440 bsps/arm/tms570: Add missing DCAN TIOC 'in' bit macro
The 'in' field (bit 0) is missing from the DCAN TIOC macros. It looks
like the auto-gen did not pick it up as it's broken onto the next page
in both the 3137 and 4357 TRMS.
2026-06-09 13:33:59 -05:00