Commit graph

7277 commits

Author SHA1 Message Date
wangchengdong
303bc7411f sched/sched: add hrtimer support to drive the scheduler
Add hrtimer support to drive the scheduler.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-20 06:55:15 +08:00
yangao1
9903b11656 drivers/rpmsg: remove unnecessary header files, revise make.def and cmake
Already copy the rpmsg_internal.h from openamp to the nuttx/include,
so do not need add the include patch for .c files.

Signed-off-by: yangao1 <yangao1@xiaomi.com>
Signed-off-by: wangshaoxin <wangshaoxin@xiaomi.com>
2026-01-19 23:14:53 +08:00
raiden00pl
1f8bb966c3 drivers/serial/Kconfig-16550: fix non-existent option
there is no SERIAL_DMA option, it was removed long time ago in:
0d203fd535

It should be SERIAL_TXDMA and SERIAL_RXDMA

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-19 16:12:25 +01:00
Bowen Wang
143c5715c0 drivers/rptun: it's not error when no carveout for virtio device
Because virtio device do not need manager the share memory heap
for now.

But later we will make the virtio device be able to manager a
standalone heap, so let this logic can be easily to extend.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Yongrong Wang
67ba360344 rptun.c: fix the problem of blocking the creation of virtio devices
If there are multiple virtio devices in rsc, it must wait for the previous
device to be created before creating the next one. In this case, if the
driver configuration of a device is not be set Y, the subsequent virtio
devices cannot be created.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-01-19 14:18:27 +08:00
pangzhen1
42bf54b24c rptun: add configuring the stack of rptun as static
Support use the drivers provided stack to initialize the rptun
kthread.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
e369bce787 drivers/rptun: add panic and reset method for new rptun framework
Use share memory to send PANIC and RESET command to peer if the rptun
driver do not support panic() and reset ops.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
ffb18cd25a drivers/rptun: should free the image buffer if open failed
Memleak Bug fix, when file_read() failed in rptun_store_open(),
memleak occur.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
c724618705 drivers/rptun: should use KRN_HEAP to intialize the carveout heap
Previous patch is not corrected:
5518135: mm/mm_heap: add nokasan flag in mm_heap_config_s structure |
https://gerrit.pt.mioffice.cn/c/vela/nuttx/+/5518135

Because rptun do not want part of the share memory is used by the
struct mm_heap_s to:
1. Save the share memory;
2. Some platfrom can't use atomic operation at the share memory,
and struct mm_heap_s contains a mutex.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
239130c1fd mm/mm_heap: add nokasan flag in mm_heap_config_s structure
Support enable/disable the kasan when initialize the heap.
This requirement is from rptun, because rptun use share memory init
the heap and share memory is precious, so we need disable the kasan
feature for rptun's heap to save the share memory.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
e686a3ac42 mm/mm_heap: use struct mm_heap_config_s to init the memory heap
To avoid add new parameters to the mm_initialize_heap() and
mm_initialize_pool()

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wnag
f456e0b637 drivers/rptun: move the heap out of the share memory
Because heap->lock will use atomic operation and may can't use in
share memory.

Signed-off-by: Bowen Wnag <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
2eaf5de3d9 drivers/vhost-rng: fix the vhost-rng compile error
1. Include the <nuttx/spinlock.h> beacause vhost-rng used spinlock
2. Remove the unused ret;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Yanfeng Liu
01b308a146 drivers/vhost: fix cmake typos
This fixes filename typos in drivers/vhost/CMakeLists.txt

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
4ded8df3d5 virtio and vhost-rpmsg: add virtio and vhost rpmsg device support
virtio and vhost rpmsg device as standalone device registered to
the virtio and vhost bus.

virtio-rpmsg and vhost-rpmsg use the common virtio_rpmsg_common.c
implementation in rpmsg dir.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
6003369ceb rptun/rptun_ivshmem: use dynamic local and remote cpu name in rsc table
the local cpuname and remote cpuname for rpmsg virtio device should
not be fixed.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
4326a8520d rptun/rptun_ivshmem: compaliable with linux remoteproc framework
1. modify the da to FW_RSC_U32_ADDR_ANY, linux support daynamic calculate
the da when da == FW_RSC_U32_ADDR_ANY;
2. modify the carveout name to vdev%dbuffer, linux remoteproc framework
use these fixed name to handle the craveout for virtio devices;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
ab8b6311ac drivers/rptun_ivshmem: port rptun_ivshmem to the new rptun framework
1. Use reserved[0] filed in struct fw_rsc_vdev and the driver
master/slave to judge the device role;
2. Use struct fw_rsc_carveout in resource table to provide the
share memory to virtio driver side;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Yongrong Wang
911ab7c55b drivers/rptun and rpmsg_virtio: remove cmd initialize
don't need initialize in sim

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
728a61437a drivers/rptun_bmp: port rptun_bmp to the new rptun framework
rptun_bmp can work with the new rptun framework

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
wangshaoxin
c962bb0f5d drivers/rptun: call rpmsg_virtio_probe() in rptun to save code size
Call rpmsg_virtio_probe() directly if device is is rpmsg virtio
and config CONFIG_DRIVERS_VIRTIO/VHOST are not enabled, so the
virtio/vhost frameworks related code do not need be compiled and
used, and can save the code size if user only want to use rpmsg
virtio device.

Signed-off-by: wangshaoxin <wangshaoxin@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Xiang Xiao
d7f3e41b13 Revert "rptun/rptun_ivshmem:add restart cmd to reboot slave"
This reverts commit 4fa1c460d3.
to reducing the complexity of rptun driver.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
109a3a090c drivers/rptun: do not reserve memory for vring when vring->da is specified
When vring->da is specified, do not need reserve the memory for the vring,
so do not need increase the shmbase and leave more share memory to the
carveout.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
7ba6425933 drivers/rptun: remove rpmsg virtio deivce in rptun
Now rptun only as remoteproc and remoteproc_virtio transport layer,
because the rpmsg virtio device should be a stand alone virtio/vhost
driver in the virtio bus

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
7c840bc405 drivers/rptun: remove the power managerment code in rptun
Preparation for the rptun framework refacator

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
a98dc94f93 rpmsg/rpmsg_virtio: add rpmsg virtio common implementation
This is the virtio-rpmsg and vhost-rpmsg common implementation for
VirtIO-Rpmsg: drivers/virtio/virtio-rpmsg.c
Vhost-Rpmsg: drivers/vhost/vhost-rpmsg.c

Later we will seperate the rpmsg virtio from the rptun framework to
make the rpmsg virtio can work with all the virtio transport layer.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
likun17
28661273a3 drivers/sensors: Added virtual sensor flag to prioritize reading
of driver information.

When the local core is a virtual sensor, attempt to retrieve
information from a remote core.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:46 +08:00
likun17
96647f0ed7 drivers/sensors: Fixed O_DIRECT flag triggering rpmsg cross-core.
Fixes the issue of cross-core IPC being triggered when using
O_DIRECT in non-cross-core scenarios.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:46 +08:00
dongjiuzhu1
8afca79359 drivers/sensors: add sensor_device_info when sensor_regsiter by usensor.
The logic for obtaining the info and configuring the user buffer
have been optimized.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:46 +08:00
Alan Carvalho de Assis
0e5323370f drivers/usbhost_hidkbd: Fix small typo in usbhost_hidkbd.c
There were missing quotes for key "backspace" for scancodes.
This issue was found by github user @StagiaireAbritek

He opened an PR in github to fix it:
https://github.com/apache/nuttx/pull/15917

However he decided to abandon and close the PR, but because it is
an important fix I decided submit it upstream.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-01-18 11:57:58 -05:00
wangchengdong
0ea686bc5b sched/signal: Add support for partially disabling signals
Signals in NuttX serve two primary purposes:

    1. Synchronization and wake-up:
    Signals can be used to block threads on specific signal sets and later
    wake them up by delivering the corresponding signals to those threads.

    2. Asynchronous notification:
    Signals can also be used to install callback handlers for specific signals, allowing threads to
    asynchronously invoke those handlers when the signals are delivered.

This change introduces the ability to partially disable signal functionality: to disable only signal functions for
Asynchronous notification, keeping functions for Synchronization and wake-up.
This enables finer-grained control over signal usage while preserving existing behavior for supported use cases.

Co-authored-by: Guo Shichao guoshichao@xiaomi.com
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2026-01-18 08:24:13 -03:00
xucheng5
724ad008ab ctucanfd: increase rwcnt bitfield width and fix structure alignment
The rwcnt (read word count) field in ctucanfd_frame_fmt_s was previously
limited to 4 bits, allowing a maximum value of 15. This is insufficient
to correctly represent the frame size (excluding the FRAME_FORMAT word)
for larger CAN FD frames as required by the CTU CAN FD hardware.

Increase the rwcnt bitfield width to support a larger range and adjust
the structure layout so that ctucanfd_frame_fmt_s has a size that is a
multiple of 4 bytes, as required by the hardware interface.

This change improves correctness and robustness when handling larger
CAN FD frames without affecting existing users.

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2026-01-17 12:43:48 +01:00
jingfei
9483df3571 driver/cfi-flash: Add a config option for the page size of CFI flash.
We have added a defconfig configuration to set the page size of the flash.
According to the CFI protocol, the flash supports a single write operation
with a data volume ranging from byte size up to the maximum number of bytes.
However, the MTD device structure requires defining a page size, which serves
as the minimum write unit of the flash. Hence, this configuration is introduced.
Any page size within the range of 1 to the maximum number of bytes is considered
valid.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-16 20:38:26 +08:00
lipengfei28
d369c92b17 drivers/pci: fix BAR size probing mask
Write 0xffffffff to the BAR when probing resource size, so the
returned mask is computed correctly.

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-01-16 20:36:45 +08:00
zhaoxingyu1
c4cf7ead30 bugfix: reading expired content need in expired range
By obtaining the erase value to set the nvs special ID
instead of using a fixed value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
61f4bd522c mtd/nvs: rename MTD_BLOCKSIZE_MULTIPLE
rename MTD_BLOCKSIZE_MULTIPLE to
CONFIG_MTD_CONFIG_BLOCKSIZE_MULTIPLE

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
Xiang Xiao
23e1066322 mtd/mtd_config_fs: Add NVS_ prefix to ADDR_XXX
and rename ret to rc for keeping the consistency with other macros

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
3fa0844da9 mtd/nvs: remove macro NVS_SPECIAL_ATE_ID
By obtaining the erase value to set the nvs
special ID instead of using a fixed value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
525a27b859 mtd/nvs: compatible with bread/bwrite
add MTD_BREAD/MTD_BWRITE in nvs when
CONFIG_MTD_BYTE_WRITE is n

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
2274f1aeb3 mtd/nvs: remove CONFIG_MTD_WRITE_ALIGN_SIZE kconfig
remove CONFIG_MTD_WRITE_ALIGN_SIZE kconfig instead of
using geo.blocksize directly

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
hujun5
5e03a56c8f drivers/misc/optee: add missing addrenv header include
Fix compilation error in optee_va_to_pa() caused by undefined 'struct addrenv_s'
type when CONFIG_ARCH_ADDRENV is enabled. Add the missing nuttx/addrenv.h header
to provide the required type definition.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 09:04:12 -03:00
zhanghongyu
be74eec727 rpmsgdrv.c: add spinlock to protect rxqueue
avoid race conditions when the rpmsg thread and network card thread
access the rxqueue simultaneously.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu
ba4361ccd8 drivers/net/rpmsgdrv.c: rename priv to drv and priv_ to priv
optimize variable naming to improve code readability

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu
be3ad13260 drivers/net/rpmsgdrv.c: add bidirectional data netdev support, server side
Server side: when ns_bind, create the netdev.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu
34b350e66e drivers/net/rpmsgdrv.c: add bidirectional data netdev support, clien side
It's the first simple version of rpmsg-net, include:
- Transfer command with data copy (maybe optimize later), no need to ack
- Control command with ack, but only ifup/ifdown no need to ack
- Client side: Another module can call `net_rpmsg_drv_alloc` to
  create netdev and register it.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu
f914bb8f03 drivers/net/rpmsgdrv.c: add response flag to distinguish message direction
control messages add a confirmation mechanism.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu
1f48d4d940 drivers/net/rpmsgdrv.c: adaptation netdev_upperhalf
simplify the code logic of rpmsgdrv.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
yintao
f671ec648e drivers/rpmsg: add signals router for rpmsg router
Now the rpmsg router transport also support get the signals, and
this signals value is modified by other physical rpmsg transport
(port, virtio) other routed by the rpmsg router.

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-15 16:13:24 -03:00
yintao
492abaa052 drivers/rpmsg: unitfy the rpmsg signals from transport to struct rpmsg_s
Now all the rpmsg transport use the signals in struct rpmsg_s instead
add element in its own private struct.

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-15 16:13:24 -03:00
shichunma
476b7684b7 drivers/mmcsd: fix typo, it should be "Byte" by spec
As subject, it's confusing if with "b".

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-01-16 01:38:29 +08:00