Commit graph

61078 commits

Author SHA1 Message Date
aviralgarg05
637c3300a5 boards/esp32: parse MCUboot load header in board_boot_image
Read the MCUboot-Espressif load header at hdr_size and use it to populate entry point plus IROM/DROM mapping parameters.

This replaces the incorrect esp_image_header_t parsing path in board_boot_image() for this flow and aligns with the image layout used by MCUboot/nxboot on ESP32.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-02-10 17:56:59 +05:30
aviralgarg05
c065fd212f arch/esp32: Fix nxstyle errors and reset partition.c
This commit fixes the style issues in the ESP32 boot image implementation:

- Reset esp32_partition.c to upstream master to fix extensive formatting issues
- Add minimal OTA_IMG_GET_OFFSET ioctl case with correct NuttX style
- esp32_boot_image.c and partition.h already fixed in previous commits

Signed-off-by: Aviral Garg <aviral.garg.2023@gmail.com>
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-02-09 23:03:04 +05:30
aviralgarg05
151e36a0f0 arch/esp32: Fix nxstyle errors in partition.h
Fix coding style issues in partition.h reported by nxstyle, specifically correcting brace placement in enum definitions.

Signed-off-by: Aviral Garg <aviral.garg.2023@gmail.com>
2026-02-09 19:05:46 +05:30
aviralgarg05
38731ab840 boards/esp32: Fix checkpatch style errors in boot_image
Fix coding style issues in esp32_boot_image.c reported by checkpatch.sh and nxstyle, including brace alignment and blank line usage.

Signed-off-by: Aviral Garg <aviral.garg.2023@gmail.com>
2026-02-09 19:05:45 +05:30
aviralgarg05
ac40b2129f xtensa/esp32: Implement board_boot_image for mcuboot/nxboot support
This commit adds the board_boot_image() implementation for ESP32, enabling support for MCUboot and nxboot bootloaders. It includes parsing the image header and setting up the necessary MMU mappings.

Signed-off-by: Aviral Garg <aviral.garg.2023@gmail.com>
2026-02-09 19:05:45 +05:30
Andre Heinemans
e83606732d boards/arm: add nxp mr-navq95b support
- Add support for the MR-NAVQ95 which is an open-source development
  board designed for mobile robotics applications.
- Utilizes the NXP i.MX95 processor M7 core
- Configurations:
  'nsh'   A minimal configuration that only enables nsh shell
          on a UART
  'rpmsg' This configuration is similar to nsh but in addition
          it offers the Remote Processing Messaging (RPMsg) service to
          enable heterogeneous inter-core communication.

Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-02-06 15:28:12 -03:00
simbit18
99db09d050 boards/arm/s32k3xx: CMake added boards
CMake added boards:

  - mr-canhubk3

 -  s32k344evb

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-02-06 15:27:50 -03:00
simbit18
b4be9a495a arch/arm/src/s32K3xx: CMake build implemented for NXP S32K3 Family
- added NXP S32K3 Family

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-02-06 15:27:50 -03:00
Jiri Vlasak
65f8053305 lcd/ili9341: Improve putrun's checks
Improve checks for the position outside of the LCD's area. Fix the input
when possible.

Slightly improve the documentation.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-02-06 14:15:36 -03:00
liang.huang
64d191d32e mm/mm_gran: fix data truncation by using size_t for mask
Use size_t instead of unsigned int for 'mask' to avoid address truncation,
especially when memory addresses exceed 32 bits.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-02-06 08:16:33 -05:00
Matteo Golin
e8b3630224 docs/or1k: Migrate README.txt to RST format
Migrate the or1k documentation from legacy README.txt to RST.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-06 08:54:28 -03:00
Andre Heinemans
9ecfff0833 boards/imx95-evk: enable mpu by default
Enabling MPU will fix imx95-evk:rpmsg by making rsc-table and vrings
regions non-cachable. Since the rewrite of RpMsg these regions are not
invalidated anymore.

Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-02-05 11:17:47 -05:00
Adwait Godbole
83c11b29a9 tools: fix make host_info flag parsing and config string escaping
Fix incorrect flag handling and string escaping in the `make host_info`
diagnostic target.

Previously, CFLAGS, CXXFLAGS, and LDFLAGS were passed in a form that caused
improper splitting and quoting, which resulted in malformed output and
incorrectly escaped configuration values such as CONFIG_APPS_DIR.

This change ensures that:
- Compilation flags are passed as proper shell strings
- Flags are split correctly using shlex
- Configuration values are escaped exactly once when generating sysinfo.h
- Parsed output matches the contents of the .config file

This change affects diagnostic output only and does not modify the NuttX
build process or generated binaries.

Signed-off-by: Adwait Godbole <adwaitngodbole@gmail.com>
2026-02-05 14:23:19 +01:00
yangyalei
854cd0ca21 nuttx/audio: clear apb buffer when playback dequeue
memset apb buffer to zero when dequeue

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
fangyibo
b13defe9e4 nuttx/audio: ALLOCATE_BUFFER & BUFFERINFO support multiple calling
support multiple applications simultaneously calling ALLOCATE_BUFFER

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
904f391982 nuttx/audio: Add audio_try_enqueue
support upper driver check whether enqueue apb buffer to the lower
driver

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
928b9368b4 nuttx/audio: Add compress audio macros
add compress audio macors and some subfmt

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
8db9865a03 nuttx/audio: Add AUDIOIOC_RESETSTATUS ioctl
use AUDIOIOC_RESETSTATUS to reset application pointer

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
f8ab192285 nuttx/audio: Update app write head in enqueuebuffer
update aplication pointer in enqueuebuffer

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
374a102af7 nuttx/audio: support multiplexing and state machine management
support multiple applications using upper at the same time

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
7d55e26421 nuttx/audio: Direct return non-format configure operation
protect configure lower only once

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
d15f69cdb6 nuttx/audio: Add audio_stop/pause/resume
relayout the code for easy modification

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
bc718c605d nuttx/audio: Add audio_poll
support poll notify read/write enable

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
9c35b01cd8 nuttx/audio: Add audio_mmap
1. mmap hw_ptr_s,
2. mmap apb buffers;

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
06e233079f nuttx/audio: support record/release apb buffer in upper driver
support maintain apb buffer in upper half driver

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
d85c4db932 nuttx/audio: Add Hardware pointer
Add Hw pointer recored apb buffer read/write position

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
2cc624a4c4 nuttx/audio: add AUDIOIOC_GETSTATE ioctl
support get lower driver state

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
yangyalei
0af7c985b4 nuttx/audio: add AUDIOIOC_GETAUDIOINFO ioctl
use AUDIOIOC_GETAUDIOINFO get current audio format

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-05 08:22:18 -03:00
Bowen Wang
877a9af2d1 rpmsg_virtio/rptun: support fallback cpuname when VIRTIO_RPMSG_F_CPUNAME not set
When the VIRTIO_RPMSG_F_CPUNAME feature is not negotiated, the driver
previously would crash due to DEBUGASSERT. This commit adds support
for a fallback mechanism:

1. Add rpmsg_virtio_probe_cpuname() API that accepts an optional cpuname
   parameter to be used when VIRTIO_RPMSG_F_CPUNAME is not available.

2. Modify rptun driver to pass the cpuname from rptun device config
   to rpmsg_virtio_probe_cpuname().

3. Refactor rptun device register/unregister to prioritize RPMSG device
   handling before other virtio device types.

This ensures the system works correctly in scenarios where the remote
side does not support the VIRTIO_RPMSG_F_CPUNAME feature.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 20:01:13 -03:00
liang.huang
1653db7ddc riscv: Fix page table traversal for SV39
With CONFIG_PAGING enabled and the RISC-V SV39 MMU active, the page fault
handler incorrectly tracked page table levels: `ptprev` pointed to the L1
page table while `ptlevel` indicated L2. This inconsistency caused faulty
virtual address resolution.

This commit fixes the traversal logic to ensure consistent level tracking
across all three page table levels (L1–L3), enabling reliable page fault
handling and on-demand paging.

Additional changes:
- Set PGT_L3_SIZE to 2048 to enable mapping up to 8MB of address space.
- Update knsh_paging config to avoid crashes caused by excessive memory
  alignment requirements.
- Add knsh64_paging config to verify this commit works as expected.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-02-04 11:52:04 -03:00
hujun5
82a218cbf3 sched_waitpid.c: HIS_metric_violation: CCM
This commit refactors nxsched_waitpid() by extracting the core waiting logic
into a separate waittcb() helper function. This change significantly reduces
the cyclomatic complexity of the main function while preserving all original
functionality and improving code maintainability with better separation of
concerns between initialization and wait handling logic.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-02-04 03:04:44 +08:00
hujun5
5abba4f655 sched_waitpid.c: HIS_metric_violation(HIS_GOTO)
This commit eliminates the goto statement in nxsched_waitpid() function to
improve code quality metrics compliance. The control flow has been restructured
using nested if-else statements to achieve identical functionality while
maintaining MISRA/HIS coding standard compliance and improving code readability.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-02-04 03:04:44 +08:00
yinshengkai
87b317f965 Documentation: Add gprof profiling tool documentation and support.
Verified on qemu-armv7a and mps2-an500 platforms with
CoreMark benchmark and system profiling examples

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
2026-02-04 03:03:45 +08:00
yinshengkai
87be79efb3 boardss: add gprof examples
Two Examples of Incorporating gprof into QEMU

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
2026-02-04 03:03:45 +08:00
yinshengkai
54040c6888 libs/libc/machine/arm: add Cortex-M0/M23 support to arch_mcount
Add support for ARMv6-M and ARMv8-M Baseline architectures
(Cortex-M0/M0+/M23) in the mcount profiling function. These cores
only support limited Thumb-1 instruction set and require different
assembly instructions compared to ARMv7-M and higher.

Changes:
- Use MOVS+BICS instead of BIC for bit clearing on M0/M23
- Separate register restore for limited push/pop instructions
- Use BX instead of direct POP to PC on M0/M23

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
2026-02-04 03:03:45 +08:00
anjiahao
871a9b3261 libc_bsd:add missing SPDX-License
Just add SPDX-License, no code changes

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-02-04 03:02:04 +08:00
anjiahao
4db4252a7c libc/string: Add BSD-optimized memset implementation.
Add lib_bsdmemset.c from newlib (Red Hat BSD license) which provides
an optimized memset using word-aligned writes and loop unrolling for
improved performance on larger buffers.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-02-04 03:02:04 +08:00
wangmingrong1
6301af9a44 libbuitin/compiler-rt: Solve some compilation errors
1. remove_item It needs to use the full path to exclude the file, otherwise the exclusion will fail
2. No include path was added, resulting in the header file not being found

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-02-04 02:33:36 +08:00
wangmingrong1
5f7d4ddcad compiler-rt: Upgrade to version 18.1.3
Some files need to be included in a specific arch

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-02-04 02:33:36 +08:00
wangmingrong1
0832cdca1c toolchain/arm/clang:Update clang compilation specifications
Delete the specified --config, clang can automatically find the library file through the set -march, -mcpu, and -mfpu
Otherwise, different versions of clang support different special cfg settings.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-02-04 02:33:36 +08:00
Bowen Wang
c4e5ac00e3 Documentation/vhost: add Vhost framework documentation
Add comprehensive documentation for the Vhost framework, which serves
as the VirtIO backend implementation in NuttX for cross-core communication.

The documentation includes:
- Overview and comparison with Linux Vhost and QEMU VirtIO Device
- Three-layer architecture (Service, Framework, Transport)
- Driver/Device registration and matching workflow
- Source code directory structure
- Complete API reference (data structures, core APIs, macro APIs)

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 02:32:02 +08:00
Bowen Wang
8d6eaae3d7 include/nuttx/virtio: allow common virtio helpers to be used by vhost
Move common virtio inline functions (virtqueue_kick_lock, virtio_malloc_buf,
virtio_zalloc_buf, etc.) from CONFIG_DRIVERS_VIRTIO guard to CONFIG_OPENAMP
guard. This allows vhost drivers to reuse these helper functions without
requiring the full virtio driver framework.

The virtio_driver structure and driver registration APIs remain under
CONFIG_DRIVERS_VIRTIO as they are specific to virtio device drivers.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 02:32:02 +08:00
wangzhi16
2274c31950 drivers/vhost: add missing SCHED_WORKQUEUE dependency
The vhost driver uses work_queue() for deferred probe but was missing
the SCHED_WORKQUEUE Kconfig dependency, causing link errors on boards
that don't enable workqueue by default.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-02-04 02:32:02 +08:00
Yongrong Wang
b3314b3813 drivers/vhost: use MSEC2TICK for deferred probe period
Convert VHOST_DEFERED_PROBE_PERIOD from a raw value to use MSEC2TICK()
macro, ensuring the delay is correctly converted from milliseconds to
system ticks regardless of the configured tick rate.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-02-04 02:32:02 +08:00
Yongrong Wang
a286287f4e drivers/virtio and vhost: auto-select parent config from sub-drivers
Change DRIVERS_VIRTIO and DRIVERS_VHOST from menuconfig to hidden config
options. Each virtio/vhost sub-driver now automatically selects its parent
config, eliminating the need to manually enable DRIVERS_VIRTIO or
DRIVERS_VHOST in defconfig files.

This simplifies board configuration by removing redundant CONFIG_DRIVERS_VIRTIO
entries from affected defconfig files.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 02:32:02 +08:00
Bowen Wang
2fc2f44b61 drivers/vhost: add vhost_get_vq_buffers() to collect scatter-gather buffers
Add vhost_get_vq_buffers() API to retrieve all chained buffers from a
virtqueue in one call. This simplifies handling of scatter-gather I/O
where data spans multiple descriptors.

The function populates an array of virtqueue_buf structures with buffer
pointers and lengths, returning the descriptor head index on success.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-02-04 02:32:02 +08:00
Yongrong Wang
5051007bfa drivers/vhost: add vhost helper macros for feature and config access
Add vhost wrapper macros that map to the corresponding virtio helper
functions:
- vhost_has_feature: check if a feature is supported
- vhost_read_config_member: read a config structure member
- vhost_write_config_member: write a config structure member

Also include virtio-config.h header to support these macros.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-02-04 02:32:02 +08:00
anjiahao
af0eac7a9c sched/semaphore: Add debug assert to detect mutex recursion.
Add DEBUGASSERT in nxsem_wait_slow() to catch illegal mutex
recursion attempts. This helps identify bugs where a task tries
to lock a mutex it already holds, which is not allowed.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-02-03 11:56:24 -05:00
tengshuangshuang
ac36320158 arm64: Add kmalloc header for arch timer
Include nuttx/kmalloc.h in arm64_arch_timer.c to fix missing header
dependency. This ensures proper memory allocation functions are
available for the architecture timer implementation.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-02-03 11:45:31 -05:00
anjiahao
8ecbdf9164 cmake:add lib_psa_set/getstackaddr file to CMakeLists.txt
CMake forgot to compile these two files, so add them.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-02-03 14:40:00 +01:00