Commit Graph

60802 Commits

Author SHA1 Message Date
yukangzhi 9bda244be8 tools/parsetrace.py: Fix get_typesize bug in parsetrace.py
Build Documentation / build-html (push) Has been cancelled
For the following code, we need to check 'type_attr.form'.
type_attr = DIE.attributes["DW_AT_type"]
base_type_die = dwarfinfo.get_DIE_from_refaddr(xxx)

When type_attr.form==DW_FORM_ref_addr, 'type_attr.value' means
global reference (across compilation units).

When type_attr.form==DW_FORM_ref4, 'type_attr.value' means
local reference (within the same compilation unit).

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-26 23:22:41 +01:00
nuttxs fa2d2b8898 boards/xtensa: fixes for compilation and start-up issues when legacy
boot mode is configured

1. Explicitly define the .rtc_reserved section to ensure RTC data
that requires fixed address is correctly placed and does not
conflict with other sections
2. When legacy boot is configured, vecbase must also be set and
clear the BSS section
3. Cache must be disabled during Flash operations, so all
Flash-operation-related functions must be placed in IRAM
(internal RAM). Update the linker script for legacy boot mode

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2026-01-26 19:22:14 -03:00
Alexey Matveev d57899847a arch/stm32: Add counter reset function
Added stm32_cap_rstcounter() function to reset the capture counter
by generating an update event. The function is integrated into the
capture operations structure and exposed via STM32_CAP_RSTCOUNTER
macro. Also added TI3 and TI4 input mappings for extended capture
channel support.

Signed-off-by: Alexey Matveev <tippet@yandex.ru>
2026-01-26 19:13:22 -03:00
Yongrong Wang f56ea30479 drivers/rpmsg: refactor internal APIs to private header
Move rpmsg internal APIs from public header include/nuttx/rpmsg/rpmsg.h
to private header drivers/rpmsg/rpmsg.h. These APIs are only used within
the rpmsg driver implementation and should not be exposed to external
modules.

Moved APIs:
- rpmsg_modify_signals()
- rpmsg_ns_bind() / rpmsg_ns_unbind()
- rpmsg_device_created() / rpmsg_device_destory()
- rpmsg_register() / rpmsg_unregister()

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-26 17:23:31 -03:00
yukangzhi 8226e8e8fe driver/noteram: Support poll threshold
The noteram driver supports setting the poll threshold.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-27 03:18:38 +08:00
yukangzhi 890f2e4625 sched: add trace points during system startup and board initialization
Add trace points to record transitions of g_nx_initstate and to mark
board early/late initialization boundaries. Also add trace marks for
RESET and PANIC to improve boot-time diagnostics and failure analysis.

Add OSINIT_RESET to indicate system is in reset process.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-27 03:18:11 +08:00
yukangzhi 6ccc2fc7c8 driver/ramlog: Implement the rate limiting function for ramlog driver.
Limit the maximum number of log entries allowed within
the specified time interval in seconds.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-27 03:17:05 +08:00
jklincn 6538477fa5 drivers/sensors/dhtxx: Fix read return values to be POSIX compliant
The dhtxx driver previously returned 0 on success, which violates standard
character device behavior where the number of bytes read should be returned.
It also used non-standard error codes like -1 or -ENOSYS for operational
errors.

This commit fixes the following behavior to comply with POSIX standards:
* Return sizeof(struct dhtxx_sensor_data_s) on success instead of 0.
* Return -EINVAL instead of -ENOSYS/-1 for invalid buffer arguments.
* Return -ETIMEDOUT instead of -1 for sensor timeouts.
* Return -EIO instead of -1 for checksum or parsing errors.

Signed-off-by: jklincn <jklincn@foxmail.com>
2026-01-27 03:11:25 +08:00
Eren Terzioglu e0401ae18b Docs/platforms/espressif: Add SPI docs for esp32s2
Add SPI defconfig docs for esp32s2-saola-1

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-01-27 03:09:34 +08:00
Eren Terzioglu 9f83dda366 boards/xtensa/esp32s2: Add SPI defconfig
Add spi defconfig and SPI3 initializer for esp32s2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-01-27 03:09:34 +08:00
Eren Terzioglu 2dbdcd603f arch/xtensa: Fix esp32s2 SPI errors
Fix esp32s2 SPI DMA and SPI3 errors

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-01-27 03:09:34 +08:00
hujun5 226443fb81 tricore: support SYSCALL_HOOKS
Build Documentation / build-html (push) Has been cancelled
Enable SYSCALL_HOOKS architecture capability for TriCore platform.
This allows runtime interception and hooking of system calls on
TriCore architecture, enabling profiling, tracing, and debugging features.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 21:22:34 +08:00
liaoao ae6ad9c193 drivers/rpmsg_port_spi_slave: add getrecvbuf callback for zero-copy receive
Add a new getrecvbuf callback to the SPI slave device operations
that allows the slave device to provide a pre-allocated receive
buffer directly to the controller. This enables zero-copy data
transfer by allowing the controller to receive data directly into
the device's buffer instead of copying.

Changes:
- Add SPIS_DEV_GETRECVBUF macro and getrecvbuf callback to
  spi_slave_devops_s structure in include/nuttx/spi/slave.h
- Implement getrecvbuf in rpmsg_port_spi_slave driver
- Update getdata to return 0 as it's no longer used for this path

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao fd6ab20362 drivers/rpmsg_port_spi: fix SPI exchange length calculation
The cmdhdr->len was uninitialized before being used in SPI exchange
operations. This caused incorrect transfer lengths.

Changes:
- Initialize cmdhdr->len to sizeof(struct rpmsg_port_header_s) during
  initialization for both SPI master and slave drivers
- Use port.txq.len instead of cmdhdr->len for TX exchange length
- Use port.rxq.len instead of cmdhdr->len for RX getdata length

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao ba81948741 drivers/rpmsg_port_spi/slave: update type of pin number to pinset_t
Correct the gpio pin number type

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 9f4708f643 drivers/rpmsg_port_spi: fix build error
CC:  vfs/fs_unlink.c rpmsg/rpmsg_port_spi.c: In function ‘rpmsg_port_spi_complete_handler’:
rpmsg/rpmsg_port_spi.c:415:11: warning: implicit declaration of function ‘rpmsg_port_spi_drop_packets’; did you mean ‘rpmsg_port_drop_packets’? [-Wimplicit-function-declaration]
  415 |           rpmsg_port_spi_drop_packets(rpspi, RPMSG_PORT_SPI_DROP_ALL);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           rpmsg_port_drop_packets
rpmsg/rpmsg_port_spi.c:415:46: error: ‘RPMSG_PORT_SPI_DROP_ALL’ undeclared (first use in this function); did you mean ‘RPMSG_PORT_DROP_ALL’?
  415 |           rpmsg_port_spi_drop_packets(rpspi, RPMSG_PORT_SPI_DROP_ALL);
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~
      |                                              RPMSG_PORT_DROP_ALL

rpmsg/rpmsg_port_spi_slave.c:292:5: warning: implicit declaration of function ‘container_of’; did you mean ‘list_container_of’? [-Wimplicit-function-declaration]
  292 |     container_of(port, struct rpmsg_port_spi_s, port);
      |     ^~~~~~~~~~~~
      |     list_container_of

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 986a1f38a6 drivers/rpmsg_port_spi/slave: increase rx thread default stack size
The default stack size should be large enough to avoid the stack
overflow:

0x18551ad8      1968      1968   100.0%!    24.2%   rpmsg-spi

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 49d95aa0d1 drivers/rpmsg_port_spi/slave: remove the pm prepare ops
Use pm wakelock is enough to make sure system will not suspend
when there is a transfer in process, and it can actually sleep when
there is buffer to send but peer side not response in 1ms which is
the timeout we set.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao a52dc0e785 drivers/rpmsg_port_spi_slave: unbind spictrl when peer shutdown
Unbind the spictrl to close the spi controller, and bind it again
when peer boots.
This can help to reduce the leak current caused by the spi gpio.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
Xiang Xiao fa947f95ee drivers/rpmsg_port_spi/slave: add RPMSG_PORT_SPI_ prefix to BYTES2WORDS
Code format optimization

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:17:27 +08:00
Xiang Xiao 8981810e96 drivers/rpmsg_port_spi: call rpmsg_port_spi_pm_action(false) in inactive path
Only call rpmsg_port_spi_pm_action(false) when no more data to
transfer to avoid unnecessary pm unlock/lock operations.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 6ca67e4061 drivers/rpmsg_port_spi: check crc value only when crc is enabled
Allow one side enables crc check while the other side not enabled.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao de5ec3be6c drivers/rpmsg_port_spi/slave: notify remote core when reboot
Now rpmsg_port_spi/slave support send shutdown command to remote
core to notify then local core will reboot, so remote core can
notify all the rpmsg services to do the unregister.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao abe28e1bcf drivers/rpmsg_port_spi/slave: add pm ops support for rpmsg port spi
Add low power support for the rpmsg port spi/slave transport, now
the rpmsg port spi/slave transport will not allow enter into the
low power state when there are still tx data to sent or rx data
to processed.

Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-26 21:17:27 +08:00
hujun5 a89b7f7add clock: remove 64-bit perf support for 32-bit systems
Remove atomic64-based 64-bit perf counter support for 32-bit systems
where atomic64 operations are unavailable, simplifying userspace perf
implementation to avoid unsupported atomic operations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 21:14:38 +08:00
Yanfeng Liu 8f0e30b07c libc/perf: userspace PMU access
Add ARCH_HAVE_PERF_EVENTS_USER_ACCESS capability to allow applications
to directly access hardware perf counters via perf_gettime() from
userspace, enabling performance monitoring and profiling without syscalls.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2026-01-26 21:14:38 +08:00
Xiang Xiao b76a8408c1 sched/clock: Refine the code structure for userspace access
Reorganize perf_gettime implementation to eliminate duplicate functions
and improve code structure for userspace library integration,
consolidating logic flow for better maintainability.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:14:38 +08:00
Xiang Xiao 277626870d sched/clock: Remove perf_init to simplify the code
Remove perf_init() function and automatic initialization call, relying
on static initialization instead to reduce code complexity and avoid
global variable access in perf_update callback.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:14:38 +08:00
zhangyuan29 197ed9fc94 sched/clock: add perf overflow offset for clock perf
dd ARCH_PERF_COUNT_BITWIDTH configuration to support architectures
with different perf counter bit widths (TriCore 31-bit, others 32-bit),
enabling proper overflow correction across diverse platforms.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-26 21:14:38 +08:00
yinshengkai 633014b6b1 clock: fix perf_gettime race condition
Move hardware perf counter read after spinlock acquisition to prevent
reading stale values due to concurrent overflow updates.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-01-26 21:14:38 +08:00
wangzhi16 03ca455066 sched/sched: Modify the critical section interface name.
replace _wo_note to _notrace.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-26 21:13:05 +08:00
Yongrong Wang aa567d43f6 drivers/rpmsg: fix struct alignment issue by removing zero array member
This commit fixes a memory alignment issue in the rpmsg subsystem.
The previous implementation used a flexible array member (rdev[0])
in struct rpmsg_s, but due to automatic 8-byte padding, rpmsg->rdev
could differ from the transport layer's rdev address (e.g.,
rpmsg_virtio->rvdev.rdev), causing potential memory corruption.

Changes:
- Remove rdev[0] flexible array member from struct rpmsg_s
- Add rpmsg_get_rdev_by_rpmsg() inline helper to calculate rdev
  address as (rpmsg + 1), ensuring correct pointer arithmetic
- Update all rpmsg->rdev references to use the new helper function
- Fix rpmsg_virtio_notify_wait() to use correct container_of macro

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-01-26 21:12:34 +08:00
anjiahao fea492cf6f libc/spawn:support get/set priority
support get/set priority

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-26 21:01:01 +08:00
hujun5 6c18cfd472 fvp: change memory map and Optimize MPU configuration
Extract fixed MPU region configuration into arm64_mpu_init_regiions() function to
allow board-specific initialization. Refactor memory layout to minimize fixed region
requirements and improve dynamic MPU configuration flexibility for FVP platform.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
hujun5 4d956952c1 arch/arm64/src/common/arm64_mpu.h: simplified macro definition
Reduce macro definition duplication by consolidating REGION_*_ATTR macros into a unified
SHAREABLE_MSK definition. This improves code maintainability and reduces configuration
complexity while preserving all attribute functionality.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
hujun5 41847b7445 arm64_mpu: Make the MPU interface of cortex-r82 consistent with other archs.
Refactor mpu_modify_region() and mpu_configure_region() functions to use direct parameters
(base, size, flags) instead of struct pointers. This ensures consistent interface across
all ARM64 MPU implementations including Cortex-R82, improving code uniformity.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
hujun5 386457440a arm64_mpu.h: rename some MPU ATTR
Rename MPU region attribute macros (REGION_RAM_ATTR → REGION_RW_NA_ATTR,
REGION_URAM_ATTR → REGION_RW_RW_ATTR) to explicitly indicate access permissions.
Add new REGION_RO_RO_ATTR and REGION_RO_NA_ATTR macros for read-only region definitions.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
yukangzhi a6e15f6fbd driver/note: Add tag to note_event_s and note_printf_s
Record the tag in note_event_s and note_printf_s for log filtering.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-26 20:56:45 +08:00
hujun5 6e8ae12ef1 pthread: make PTHREAD_MUTEX_DEFAULT_UNSAFE default true
Change the default pthread mutex robustness from ROBUST to UNSAFE when
CONFIG_PTHREAD_MUTEX_BOTH is enabled. This reflects the practical default
and allows removal of tracking code for non-robust mutexes, improving
performance and reducing memory overhead.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:56:12 +08:00
hujun5 082a3d3085 pthread: remove tl_lock
This lock is currently used in three places,
mainly to protect tls->tl_mhead. Among them,
pthread_mutex_add and pthread_mutex_remove involve
writing to tls->tl_mhead, and there is
certainly no conflict within the same thread.
As for pthread_mutex_inconsistent, it involves reading. Currently,
it can only be called when the TCB task corresponding to
this tls exits, and the TCB corresponding to the
tls can no longer continue to run.
It seems that adding the lock serves no real purpose.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:56:12 +08:00
hujun5 f4c23eb88b boards/boardctl.c: use spinlock IRQ-safe interfaces for consistency
Replace direct up_irq_save/up_irq_restore calls with spinlock IRQ-safe
interfaces (spin_lock_irqsave, spin_trylock_irqsave, spin_unlock_irqrestore)
to maintain semantic consistency when both spinlock and IRQ flags are used together.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:54:03 +08:00
hujun5 0383808b32 arm64/gic: remove GIC single security state configuration check
According to ARM GIC documentation, GICD_CTLR.DS bit is read-only and cannot be
modified by software. Remove the unnecessary runtime check that attempts to set this bit
for CONFIG_ARCH_SINGLE_SECURITY_STATE configuration, simplifying the GIC initialization flow.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 19:43:54 +08:00
hujun5 e9c33195a3 arm64: add mpu_usedregion interface
Add mpu_usedregion() function to query the number of MPU regions currently in use.
This interface complements existing mpu_allocregion() and mpu_freeregion() functions,
allowing callers to determine the occupancy of the MPU region pool.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 19:43:54 +08:00
hujun5 7d30afa589 arm64: enable mpu background region
Enable SCTLR_EL1.BR bit to activate MPU background region support. This simplifies MPU
configuration by providing a default MAIR attribute for unmapped regions, reducing the
need for exhaustive region coverage and improving MPU flexibility.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 19:43:54 +08:00
Gao Jiawei 564c9d7dcd arm: systick: fix off-by-one in SysTick RELOAD programming
ARM specifies that SysTick RELOAD must be programmed with N-1 to get a period of N CPU cycles.
Adjust the timeout/reload conversions accordingly: subtract 1 when writing RELOAD and add 1 back when converting RELOAD to a timeout/interval.
Also clamp RELOAD to the valid 24-bit range (1..0x00ffffff) for Armv7-M/Armv8-M to avoid invalid values.
Reference: https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/System-timer--SysTick/SysTick-Reload-Value-Register

Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2026-01-26 19:34:00 +08:00
ouyangxiangzhen 281f9fc0c0 sched/hrtimer: Rename the HRTIMER_CANCEL_SYNC_DELAY timeout.
This commit renamed the HRTIMER_CANCEL_SYNC_DELAY_MS to
HRTIMER_CANCEL_SYNC_DELAY_US.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-26 16:37:10 +08:00
ouyangxiangzhen f1b355f118 sched/hrtimer: Update the comments.
This commit updated the comments.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-26 16:37:10 +08:00
ouyangxiangzhen fdf3eb0d56 sched/hrtimer: Update the documentation.
This commit updated the documentation for hrtimer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-26 16:37:10 +08:00
ouyangxiangzhen 0048a5c21b sched/hrtimer: Fix the functional correctness issue in hrtimer_start.
This commit fixed the functional correctness issue in hrtimer_start by
adding HRTIMER_MAX_DELAY fr the HRTIMER_MODE_REL.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-26 16:37:10 +08:00
ouyangxiangzhen a6d64a1a83 sched/hrtimer: Simplify the hrtimer_cancel.
This commit simplified the hrtimer_cancel.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-26 16:37:10 +08:00