Summary:
- Updated `Rust.defs` to use `gnu` as the target for Linux systems and `darwin` for macOS systems
- This change aligns with Rust toolchain conventions, where `gnu` is used to declare the system environment rather than the actual ABI name (e.g., `sysv`)
Impact:
- No functional changes - the Rust toolchain interprets `gnu` correctly for Linux targets
- Improves consistency with Rust toolchain conventions and reduces potential confusion
- Maintains compatibility with existing Rust builds on Linux and macOS systems
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Summary:
- Unified the specification of LLVM architecture and ABI types across the CMake and Makefile configurations.
- Introduced `LLVM_ARCHTYPE` and `LLVM_CPUTYPE` variables in the CMake configuration to match the Makefile's approach.
- Standardized the ABI type (`LLVM_ABITYPE`) to `sysv` for both Linux and macOS host configurations.
Impact:
- Ensures consistent LLVM target definitions across build systems (CMake and Makefile).
- Simplifies future maintenance by avoiding divergence in LLVM-related configurations.
- No functional changes to the build output; only the internal representation of LLVM target information is aligned.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Progress in USB driver
Nothing is working yet. But just getting this in here so it is saved.
Minor changes with USB power enabled
Serial over USB is working now.
Removed stm32_usbdev.c, added stm32_usbfs.c. Still needs review before pull-request.
Rewrote VDDUSB valid check to use register definitions. Wait for USB33RDY before moving on. Also style updates.
Renamed stm32_usbdev files to stm32_usbfs. Renamed STM32H5 configuration options from STM32H5_USB to STM32H5_USBFS. Properly named REGDEBUG defines. Added STM32H5_USB_REGDEBUG to Kconfig and updated stm32_usbfs.c to use it. TRACE functionality still needs work.
Updated REGDEBUG for 32-bit register accesses.
More style updates.
Added usbnsh defconfig to nucleo-h563zi
Update to allow 16 buffers (max for 8 endpoints). Renamed lpinterrupt and lptransfer. Changed board.h to use SYNCSRC_USB only if USB is enabled.
Buffer size is still set to max packet size of 64 bytes, because we are using a full-speed peripheral. It is unclear to me whether having a buffer larger than the max packet size has any benefit. Double buffering is a way to increase throughput, though that still needs to be implemented.
Adapted USBFS Buffer table for 32-bit accesses.
Style updates
Build stm32_hsi48.c based on CONFIG_STM32H5_HAVE_HSI48.
Change LPMODE CNTR bit to SUSPRDY.
fix smp crash on sabre-6quad/smp, regression from:
|commit 1e49cb4828
|Author: hujun5 <hujun5@xiaomi.com>
|Date: Thu Dec 5 16:58:17 2024 +0800
|
| armv7-a/armv7-r/armv8-r: percpu reg store this_task
|
| This is continue work of https://github.com/apache/nuttx/pull/13726
|
| We can utilize percpu storage to hold information about the
| current running task. If we intend to implement this feature, we would
| need to define two macros that help us manage this percpu information
| effectively.
|
| up_this_task: This macro is designed to read the contents of the percpu
| register to retrieve information about the current
| running task.This allows us to quickly access
| task-specific data without having to disable interrupts,
| access global variables and obtain the current cpu index.
|
| up_update_task: This macro is responsible for updating the contents of
| the percpu register.It is typically called during
| initialization or when a context switch occurs to ensure
| that the percpu register reflects the information of the
| newly running task.
|
| Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
This revises qemu-armv7a:nsh sample config with the following changes:
- reduced memory size so that `-m 1024` is optional
- enables graceful shutdown from within NuttX
- enables more cases in `ostest`.
Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
Summary:
- Simplified `Make.defs` by including `Toolchain.defs` from the x86 common directory
- Removed redundant toolchain and flag definitions, consolidating them into a single shared file
Impact:
- Reduces code duplication and improves maintainability by centralizing toolchain configurations
- No functional changes - the build process remains the same, but the configuration is now more modular and reusable
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Summary:
- Added LLVM target definitions (`LLVM_ARCH`, `LLVM_CPU`, `LLVM_ABI`) to `arch/x86_64/src/cmake/Toolchain.cmake` and `arch/x86_64/src/common/Toolchain.defs`
- These definitions are necessary for compatibility with LLVM-based toolchains and ensure proper target architecture, CPU, and ABI settings
Impact:
- Enables support for LLVM-based toolchains when building for x86_64 architecture
- No functional changes for existing GNU-based toolchains
- Improves maintainability by centralizing LLVM-specific configurations in the toolchain files
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Summary:
- Added LLVM target definitions (`LLVM_ARCHTYPE`, `LLVM_CPUTYPE`, `LLVM_ABITYPE`) to the x86 toolchain configuration file
- These definitions are necessary for compatibility with LLVM-based toolchains
Impact:
- Enables support for LLVM toolchains when building for x86 targets
- No functional changes for existing GCC-based toolchains
- Improves cross-compilation flexibility by supporting additional toolchain options
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This stops exported LDELFFLAGS from referring to kernel folder
linkscripts because kernel folder might not be present in such
app building use cases.
Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
This adds LDMODULEFLAGS export so that kernel module can build
for kernel mode NuttX via `make import` approach.
Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
Summary:
- Added LLVM_ARCHTYPE, LLVM_CPUTYPE, and LLVM_ABITYPE to the exported build configuration in both `Export.mk` and `mkexport.sh`
- These flags are now included in the generated `makeinfo.sh`, `Make.defs`, and `target.cmake` files during the export process
Impact:
- Enables LLVM-specific build configurations to be properly exported and used in kernel builds
- Improves compatibility with LLVM-based toolchains by ensuring necessary architecture, CPU, and ABI information is available during the build process
- No functional changes for non-LLVM builds, as these flags are only used when LLVM toolchains are specified
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Summary:
- Moved the export of `ZIG` and `ZIGFLAGS` from `tools/Unix.mk` to `tools/Export.mk`
- Simplified the `export` target in `tools/Unix.mk` by removing redundant `ZIG` and `ZIGFLAGS` variables
Impact:
- No functional changes - the `ZIG` and `ZIGFLAGS` variables are still exported correctly
- Improves code maintainability by centralizing environment variable exports in `Export.mk`
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
config-testing-heap is changed to conofig-testing-heap, so the citest tools need to change.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
after below change merge to kernel, spin_lock() will turn off preemption by default,
but this change is not applicable to all scenarios. The locations in the kernel that
use spin_lock() extensively only require short critical sections and do not trigger
scheduling, which leads to serious performance degradation of NuttX in AMP mode.
In this PR, I try to expose similar problems and hope that each subsystem will carefully check the code coverage
https://github.com/apache/nuttx/pull/14578
|commit b69111d16a
|Author: hujun5 <hujun5@xiaomi.com>
|Date: Thu Jan 23 16:14:18 2025 +0800
|
| spinlock: add sched_lock to spin_lock_irqsave
|
| reason:
| We aim to replace big locks with smaller ones. So we will use spin_lock_irqsave extensively to
| replace enter_critical_section in the subsequent process. We imitate the implementation of Linux
| by adding sched_lock to spin_lock_irqsave in order to address scenarios where sem_post occurs
| within spin_lock_irqsave, which can lead to spinlock failures and deadlocks.
|
| Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
Coredump doens't need CONFIG_ELF to be enabled, but need elf.h to include correct elf32.h or elf64.h.
Select LIBC_ARCH_ELF in COREDUMP to allow LIBC_ARCH_ELF_64BIT to be
defined correctly.
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Firstly call arm_coredump_add_region in up_initialize to add nvic region, then call
coredump_set_memory_region to add board mem region, at this moment, an overlap occurs.
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
Add a custom note for NuttX information including magic and coredump
file data size, so when system reboots, we can check if the block device
contains valid coredump file, and save it to file system.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
ADC peripheral can be configured also for PWM trigger, so the ifdef
should depend only on CONFIG_SAMV7_AFEC_SWTRIG. Also handle the
situation when ANIOC_TRIGGER is called and the peripheral is not
configured for SW trigger (but the other one may be, so config option
is set).
Trigger values saved to the private structure are also changed to
enums for better code clarity.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
reason:
In x86_64, tcb->xcp.regs is always valid, and we obtain the location
where the context is saved through irq_xcp_regs every time an interrupt occurs.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason:
We aim to replace big locks with smaller ones. So we will use spin_lock_irqsave extensively to
replace enter_critical_section in the subsequent process. We imitate the implementation of Linux
by adding sched_lock to spin_lock_irqsave in order to address scenarios where sem_post occurs
within spin_lock_irqsave, which can lead to spinlock failures and deadlocks.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason:
1 Accelerated the implementation of sched_lock, remove enter_critical_section in sched_lock and
only enter_critical_section when task scheduling is required.
2 we add sched_lock_wo_note/sched_unlock_wo_note and it does not perform instrumentation logic
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Under apps/testing folder, the macro of CONFIG_TESTING_MM is changed to CONFIG_TESTING_HEAP.
So we need to update the defconfig containing CONFIG_TESTING_HEAP in the nuttx/boards folder.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
UART RAM will have probabilistic bubble time during continuous transmission.
Update the offset after sending to avoid this problem.
Signed-off-by: chao an <anchao.archer@bytedance.com>
add sim_rpmsg_port_uart.c to verify the rpmsg port uart wrapper layer,
The physical transport layer could be:
1. SIM_RAM_UART(current)
2. SIM_UART(through "socat" virtual "/dev/pts/*", "socat" could monitor the bus data)
Signed-off-by: chao an <anchao.archer@bytedance.com>
This forces the bch layer to read the sector from the physical device
instead of using the cached values. It is necessary to call when the
device is updated from the different source than bch, for example
erased by the MTD ioctl command.
It also has to invalidate readahead buffer from FTL if option
CONFIG_DRVR_READAHEAD is set.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>