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.
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.
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.
Remove the obsolete BERMAP, BERAOFFSET, and BERBOFFSET struct members
and the corresponding TMS570_DMA_BERMAP, TMS570_DMA_BERAOFFSET, and
TMS570_DMA_BERBOFFSET access macros.
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.
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>
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
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>
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.
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.
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.