In the file stm32g474xxxx_rcc.c, the enable PLL
code, according to the intent of the comment,
wants to keep the reserved bit, but the code
clears the reserved bit.
Signed-off-by: jerryslhao <jerryslhao@gmail.com>
CID 1309501: (#1 of 1): Overflow constant (INTEGER_OVERFLOW)
overflow_const: Expression upper->crefs, which is equal to 255, where enable ? 1 : -1 is known to be equal to -1, overflows the type that receives it, an unsigned integer 8 bits wide.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Adding source files to the fdcan branch based on identical register set. These files should mostly just work.
Removed references to FDCAN3. H5 only has 2 FDCAN interfaces.
Add basic FDCAN Kconfig
FDCAN Kconfig options
Added various options for FDCAN mode, FDCAN bitrate, clock selection and division, and timing.
Added bit timing config options (nominal and data). Added stm32h56xxx pin mappings.
Fixed Data Bit Timing. Pulled in STM32H5_FDCAN_PDIV_VALUE. Added stm32_fdcan.c to Make.defs. Added DBITRATE to Kconfig
Clock source changes to FDCAN
Moved the setting of the clock source to the stm32h5xx_rcc.c file. Added notes to stm32_fdcan.c that STM32_FDCAN_FREQUENCY and STM32_FDCAN_PDIV should be set in board.h
Change STM32H5_FDCAN_PDIV to STM32_FDCAN_PDIV
Updated Kconfig to match G4 implementation. Removed stm32_fdcan_sock for now.
Removed FDCAN3 from stm32_fdcan.h
incomplete changes for bit timning
Set NBRP and DBRP registers based on STM32H7 FDCAN socket algorithm.
Added board file for initializing 1 can device. Will update later to initialize second device.
Fixed ifdefs. Changed STM32 to STM32H5.
Add some can testing changes.
Added option to configure bit timing, with automatic bit timing set as default.
Style fixes
Fixed FDCAN2 and memory access issues
FDCAN2 msgram offset was wrong by 1 word (4 bytes). I removed the + 4 at the end of the definition. This fixed the issues with fdcan2. Also changed ifdefs when setting ESI, FDF, and BRS bits. When CAN FD was used, this resulted in the first command after the endif (the setting of dest at line 2325) being skipped because it was included in the else block when it shouldn't have. This resulted in exceptions. Adjust ifdefs fixes this problem. Other minor fixes.
Restoring board files to upstream versions. These files will be pulled in later in a separate pull request. stm32h5_fdcan_test branch created for this.
Fixed Queue Mode Transmit
The can driver checks the TFFL bits in the TXFQS register. In Queue mode, this always returns 0. As a result, fdcan_txempty was always returning false, which resulted in no transmissions. This code fixes that.
Add stm32h5 fdcan chardriver to Make.defs
Nxdiag examples scripts modified to print system information
without building and flashing nxdiag application to get report
about system without reflash or reconfigure.
Inline & inline_function both used make confuze, let's modify all inline
in irq.h to inline_function, also clear the always_inline_funcion
declaration.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
If CONFIG_BOARD_LATE_INITIALIZE is not selected, the userleds will
not be initialized. The userled initialization is not required to
be done within board_late_initialize(), thus this commit enables
initializing it in board_app_initialize() too.
Virtio RNG support (CONFIG_DRIVERS_VIRTIO_RNG=y) selects
CONFIG_ARCH_HAVE_RNG. On the other hand, if CONFIG_DEV_URANDOM=y,
it defaults to CONFIG_DEV_URANDOM_ARCH if CONFIG_ARCH_HAVE_RNG=y.
DEV_URANDOM_ARCH definition states that the implementation of the
/dev/urandom should be provided by the architecture-specifig logic,
including the function devurandom_register(). In this case, the
/dev/urandom may refer to the same driver as /dev/random that is
provided by the Virtio RNG driver, which is implemented by this
commit.