Changed the LLVM architecture type from thumbv7 to thumbv7a in
Toolchain.defs to better match the ARMv7-A architecture specification.
This change ensures proper code generation and optimization for
Cortex-A series processors when using the Thumb instruction set.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Added LLVM-specific configuration variables to ARM architecture CMake files:
- LLVM_ARCHTYPE for architecture variant (thumbv6m, thumbv7a, etc)
- LLVM_CPUTYPE for CPU target (cortex-m0, cortex-a5, etc)
- LLVM_ABITYPE for ABI (eabi/eabihf)
These changes enable LLVM/Clang toolchain support while maintaining
compatibility with existing GCC configurations. The LLVM variables
are set based on the same architecture/CPU/FPU configurations used
for GCC flags.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Reformatted the FPU options table to use a clearer markdown-style table format
with proper alignment and column headers. Added visual separators (~~~) to make
the table stand out from surrounding code. Improved consistency in column widths
and fixed line wrapping for better readability.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Used the STM32H7 as a reference.
Removed APB enabling from stm32h5xx_rcc.c. This is done in timer initialization, like STM32H7.
Also removed LPTIM. Will add later.
tim_lowerhalf: Timers 9, 10, and 11 removed. Timers 15,16, and 17 added.
Removed low-power timers from Kconfig. Not implemented yet.
Style Updates
Added stm32_tim_enable and stm32_tim_disable to Timer operations.
The method is the same as the method of saving the current DAIF state of the thread
It will pave the way for the future implementation of hwasan's memory management
Allows each thread to independently control the mte switch function
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
- Replace direct string comparisons with regex pattern matching for ARCHCPUEXTFLAGS
- Change from using LLVM_CPUFLAGS list to setting LLVM_CPUTYPE directly
- Simplify CPU type detection logic while maintaining same functionality
- Use more consistent string variable naming convention
This change makes the CPU type detection more flexible and maintainable
while keeping the same behavior for supported RISC-V configurations.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit cleans up redundant header file includes throughout the codebase.
The changes include:
- Removing duplicate #include directives that were present in the same file
- Consolidating includes that were split across multiple lines unnecessarily
- Removing unused includes that were no longer needed
- Fixing some formatting issues with includes
The changes improve code organization and maintainability by:
- Reducing unnecessary dependencies
- Making include dependencies more explicit
- Following consistent include patterns
- Removing dead code
No functional changes are made - this is purely a code cleanup commit.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Raise compilation error when I2C configuration is invalid.
It's better to catch invalid clock configuration during compilation instead of
producing binary that doesn't work as expected anyway.
Signed-off-by: raiden00pl <raiden00@railab.me>
Use findstring instead of direct equality checks for LLVM_CPUTYPE
conditions to better handle ARCHCPUEXTFLAGS that may contain additional
ISA extensions. This makes the CPU type detection more robust when
dealing with extended instruction sets while still ensuring the required
base ISA extensions are present.
For example, ARCHCPUEXTFLAGS="imc_zicsr_zifencei" will now correctly
match as sifive-e20 rather than failing the exact match check.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This patch refactors the CPU index handling in the RISC-V architecture to be based on the ARCH_RV_CPUID_MAP configuration.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
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>
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
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>
By default in SMP, obtaining this_task requires disabling interrupts, obtaining the current CPU index, accessing a global variable, and re-enabling interrupts. Storing this_task in percpu makes retrieval faster.
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
1. Change the CONFIG_RPMSG_VIRTIO to CONFIG_RPMSG_VIRTIO_LITE
2. fix the error when modify the sim_rpmsg_virtio to port to
rpsmg_virtio_lite;
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>