Commit Graph

55002 Commits

Author SHA1 Message Date
yezhonghui 786dabfb13 QemuEPC multi function verify for pci
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-09-28 13:39:50 +08:00
yezhonghui db19d00e64 QemuEPC support multi function for pci device
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-09-28 13:39:50 +08:00
Tomashevskiy b5382234cc weact stm32h743vit6 usbconsole fix
fix previous problemc

added defconfig for weact-stm32h743:nshusb

board.h
Wrong column position or missing blank line before comment: FIX

hopefully last commit
2024-09-28 13:36:34 +08:00
Yongrong Wang fa6d41471f arm_gicv2.c: fix armv7a compile error
/vela/nuttx/drivers/pci/pci_ecam.c:432:(.text.pci_ecam_get_irq+0x16): undefined reference to `up_get_legacy_irq'

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-09-28 13:34:33 +08:00
lipengfei28 30be81add6 arm64 pci legacy irq do not support yet
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-28 13:34:33 +08:00
lipengfei28 39ec3291ee armv7a pci irq support
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-28 13:34:33 +08:00
Bowen Wang 0e3a96a398 include/pci.h: sync the subvendor/subdevice type in id table and pci_device_s
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-28 13:34:33 +08:00
Bowen Wang 6d4cab62fd pci/pci_ecam: add read_io/write_io for pci ecam
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-28 13:34:33 +08:00
yezhonghui f6db814804 pci: add pci endpoint test driver
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-09-28 13:13:37 +08:00
yangguangcai 9a84484df5 capture:add multiple register.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-28 13:11:52 +08:00
yangguangcai fd47add2a3 capture:add CAPIOC_ALL for ioctl.
When monitoring multiple capture channels, the `ioctl` function
is called three times, leading to significant overhead mainly due
to VFS and `nxmutex_lock/unlock`. Adding a new interface can save
the overhead of two `ioctl` calls.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-28 13:11:52 +08:00
makejian 5b1d910ec6 nuttx/crypto: export asynchronous calling process
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-28 13:05:28 +08:00
hujun5 f49d5f4451 armv7a/r: fix use arch-timer in SMP
reason:
Only one timer will be effective at a time.In the current
implementation of NuttX's timer handling, only a single global timer is necessary.
Having an excessive number of timers can lead to additional performance
overhead and logical errors, especially when operating in SMP
(Symmetric Multi-Processing) tickless mode.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-28 11:52:09 +08:00
Bowen Wang 23a4a23397 devicetree/fdt_pci: implement the fdt_pci_ecam_register()
So the borad level do not need implement the
pci_ecam_register_from_fdt() again and again.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-28 11:51:33 +08:00
nuttxs c0403ed768 1.xtensa/esp32s3: configure the number of universal management
(IEEE) MAC addresses when there are multipleinterfaces.
2.Optimize Lan9250 to adapt to ESP32S3 universalMAC address.
2024-09-28 11:47:24 +08:00
dongjiuzhu1 b5713fd7f4 drivers/sensor: remove frequent logs
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 d88e0eac02 drivers/sensors: Fixed the overflow problem of uint32_t subtracting large from small.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 a5729a81e3 driver/sensors: add flags O_DIRECT to watch sensor state to avoid rpmsg work
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 05f5517f4f drivers/sensors: clear pollpri events after get events
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 49b650e9db drivers/sensors: avoid using sre lock between rptun thread and hpwrok
When the system cannot obtain buffers for a long time, hpwork will hold
a lot of buffers. However, due to a deadlock between the rptun thread
and hpwork, hpwork cannot send the buffers in time, causing the system
to crash.

so, avoid hold sre lock in rptun thread.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 6b6666ee50 drivers/sensors: update nbuffer after initialization
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
yintao ef9a02f51c sensors/sensor_rpmsg.c: fix list_delete node is NULL
if remote not set CONFIG_SENSOR_RPMSG, local can't receive NS_ACK
so sensor_rpmsg_device_ns_bound won't be called, not add sre->node
when local stop remote, rpmsg_deinit_vdev will call sensor_rpmsg_ns_unbind_cb
if (ept && ept->ns_unbind_cb)
	ept->ns_unbind_cb(ept);
list_delete node is NULL at sensor_rpmsg_ns_unbind_cb

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 d72d9049e9 drivers/sensors: fix minor issue about sensor driver
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 7a8d58bf1b drivers/sensors: release rpmsg resource when register_driver failed
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dongjiuzhu1 fcf2eb8fcb drivers/sesnros: fix crash because ipc buffer pointer used after free
When the ipc buffer is obtained for the first time due to insufficient space,
it waits due to insufficient ipc buffer.
At this time, if rptun recursively operates the next ipc request, the ipc buffer
will be reused, but it has been released at this time.

0  file_read (filep=filep@entry=0x20596738, buf=buf@entry=0x205d4358, nbytes=1560) at vfs/fs_read.c:86
1  sensor_rpmsg_push_event_one (dev=0x20558f70, dev@entry=0x2058fc80, stub=stub@entry=0x20596720) at sensors/sensor_rpmsg.c:799
2  sensor_rpmsg_alloc_stub (dev=dev@entry=0x2058fc80, ept=ept@entry=0x20558f08, cookie=<optimized out>) at sensors/sensor_rpmsg.c:552
3  sensor_rpmsg_sub_handler (ept=0x20558f08, data=0x204849c0, len=51, src=<optimized out>, priv=0x20558f00) at sensors/sensor_rpmsg.c:993
4  sensor_rpmsg_ept_cb (ept=<optimized out>, data=<optimized out>, len=<optimized out>, src=<optimized out>, priv=0x20558f00) at sensors/sensor_rpmsg.c:1186
5  rpmsg_virtio_rx_callback (vq=<optimized out>) at open-amp/lib/rpmsg/rpmsg_virtio.c:605
6  virtqueue_notification (vq=<optimized out>) at open-amp/lib/virtio/virtqueue.c:711
7  rproc_virtio_notified (vdev=vdev@entry=0x20558c98, notifyid=notifyid@entry=4294967295) at open-amp/lib/remoteproc/remoteproc_virtio.c:433
8  remoteproc_get_notification (rproc=rproc@entry=0x2054ff34, notifyid=notifyid@entry=4294967295) at open-amp/lib/remoteproc/remoteproc.c:1002
9  rptun_worker (arg=0x2054ff30) at rptun/rptun.c:339
10 rptun_notify_wait (rproc=<optimized out>, id=<optimized out>) at rptun/rptun.c:543
11 remoteproc_virtio_notify_wait (priv=<optimized out>, id=<optimized out>) at open-amp/lib/remoteproc/remoteproc.c:907
12 rproc_virtio_notify_wait (vdev=<optimized out>, vq=<optimized out>) at open-amp/lib/remoteproc/remoteproc_virtio.c:176
13 rpmsg_virtio_notify_wait (vq=<optimized out>, rvdev=0x2054ff78) at nuttx/include/openamp/rpmsg_virtio.h:162
14 rpmsg_virtio_get_tx_payload_buffer (rdev=0x2054ff78, len=0x20558f90, wait=<optimized out>) at open-amp/lib/rpmsg/rpmsg_virtio.c:404
15 rpmsg_get_tx_payload_buffer (ept=ept@entry=0x20558f08, len=len@entry=0x20558f90, wait=wait@entry=1) at open-amp/lib/rpmsg/rpmsg.c:207
16 sensor_rpmsg_push_event_one (dev=0x0, dev@entry=0x20590d60, stub=stub@entry=0x20596720) at sensors/sensor_rpmsg.c:783
17 sensor_rpmsg_alloc_stub (dev=dev@entry=0x20590d60, ept=ept@entry=0x20558f08, cookie=<optimized out>) at sensors/sensor_rpmsg.c:552
18 sensor_rpmsg_sub_handler (ept=0x20558f08, data=0x20483700, len=49, src=<optimized out>, priv=0x20558f00) at sensors/sensor_rpmsg.c:993
19 sensor_rpmsg_ept_cb (ept=<optimized out>, data=<optimized out>, len=<optimized out>, src=<optimized out>, priv=0x20558f00) at sensors/sensor_rpmsg.c:1186
20 rpmsg_virtio_rx_callback (vq=<optimized out>) at open-amp/lib/rpmsg/rpmsg_virtio.c:605
21 virtqueue_notification (vq=<optimized out>) at open-amp/lib/virtio/virtqueue.c:711
22 rproc_virtio_notified (vdev=vdev@entry=0x20558c98, notifyid=notifyid@entry=4294967295) at open-amp/lib/remoteproc/remoteproc_virtio.c:433
23 remoteproc_get_notification (rproc=0x2054ff34, rproc, notifyid=notifyid@entry=4294967295)
24 rptun_worker (arg=0x2054ff30) at rptun/rptun.c:339
25 rptun_thread (argc=<optimized out>, argv=<optimized out>) at rptun/rptun.c:375

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 11:39:54 +08:00
dulibo1 9d8991dd29 power:add BATIO_OPRTN_CHARGER_STATE for gauge sync charger state.
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:25:17 +08:00
liangdongdong 5238f2c200 feature: charge: Add battery operate
Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
2024-09-28 11:25:17 +08:00
dulibo1 5a796dfbff power: fix BQ27426 driver compile error
power/battery/bq27426.c:331:17: error: ‘BATTERY_UNKNOWN’ undeclared (first use in this function)
  331 |       *status = BATTERY_UNKNOWN;
      |                 ^~~~~~~~~~~~~~~
power/battery/bq27426.c:331:17: note: each undeclared identifier is reported only once for each function it appears in
Makefile:108: recipe for target 'bq27426.o' failed

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-28 11:25:17 +08:00
dulibo1 797df22802 power:add default protocol for the driver which not impl get_protocol
add default protocol for the driver which not impl get_protocol

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:25:17 +08:00
dulibo1 b29d103ad3 ramlog:flush should reset the tail of the reader
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:08:39 +08:00
dulibo1 c055fc2f85 noteram:read noteram may cause crash
noteram_get may cause _read = ni_bufsize cause assert crash

[ 1493.627200] [79] [ EMERG] [ap] _assert: Assertion failed : at file: note/noteram_driver.c:370 task: trace process: trace 0x446f238a
[ 1493.627400] [79] [ EMERG] [ap] backtrace:
[ 1493.627500] [79] [ EMERG] [ap] [79] [<0xf7933c9d>] _fini+0xae0720b9/0xb673e41b
[ 1493.628400] [79] [ EMERG] [ap] [79] [<0x498b1b0c>] host_backtrace+0x42/0x72
[ 1493.629300] [79] [ EMERG] [ap] [79] [<0x48bef3d1>] up_backtrace+0x127/0x2d2
[ 1493.630200] [79] [ EMERG] [ap] [79] [<0x48b86bed>] sched_backtrace+0x71/0x8a
[ 1493.631100] [79] [ EMERG] [ap] [79] [<0x44676273>] sched_dumpstack+0xed/0x486
[ 1493.631600] [79] [ EMERG] [ap] [79] [<0x445c61ff>] _assert+0x9f0/0xb38
[ 1493.632200] [79] [ EMERG] [ap] [79] [<0x4420dd07>] __assert+0x3f/0x4c
[ 1493.632800] [79] [ EMERG] [ap] [79] [<0x44151648>] noteram_get+0x1b0/0x5fe
[ 1493.633600] [79] [ EMERG] [ap] [79] [<0x44152370>] noteram_read+0x331/0x4f7
[ 1493.634200] [79] [ EMERG] [ap] [79] [<0x444c66f9>] file_read+0x38b/0x3c0
[ 1493.634700] [79] [ EMERG] [ap] [79] [<0x444c6840>] nx_read+0x112/0x170
[ 1493.635300] [79] [ EMERG] [ap] [79] [<0x444c68e5>] NXread+0x47/0xfa
[ 1493.635800] [79] [ EMERG] [ap] [79] [<0x446f2c70>] trace_dump+0x148/0x2f4
[ 1493.636400] [79] [ EMERG] [ap] [79] [<0x446f110b>] trace_cmd_dump+0x41b/0x4b9
[ 1493.636900] [79] [ EMERG] [ap] [79] [<0x446f2723>] trace_main+0x399/0x6e2
[ 1493.637500] [79] [ EMERG] [ap] [79] [<0x44217fc9>] nxtask_startup+0x69/0x7c
[ 1493.638000] [79] [ EMERG] [ap] [79] [<0x440f9b78>] nxtask_start+0x8a5/0x8b8

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:08:39 +08:00
yinshengkai d888df9673 note: add ringbuffer aligned access handle
Fix ubsan warning that writes need to be aligned to memory boundaries when writing data

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-28 11:08:39 +08:00
dulibo1 98482d429b noteram:overflow may discard all the trace message
noteram_add may cause head = tail when remain == NOTE_ALIGN(notelen)
log:
nsh_main-14  [0]   2.132127493: tracing_mark_write: B|14|trace dump -c

nsh_main-14  [0]   2.143322780: tracing_mark_write: E|14|trace dump -c

nsh_main-14  [0]   2.513023895: tracing_mark_write: B|14|trace dump -c

nsh_main-14  [0]   2.524060048: tracing_mark_write: E|14|trace dump -c

nsh_main-14  [0]   2.897055341: tracing_mark_write: B|14|trace dump -c

ap> trace dump -c
nsh_main-14  [0]   3.270037241: tracing_mark_write: B|14|trace dump -c

ap> trace dump -c

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:08:39 +08:00
dulibo1 e5e4e3030e power:add extern for public function prototypes
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-28 11:03:48 +08:00
dulibo1 b4b07ce6bd PM:use CONFIG_SERIAL_PM_ACTIVITY_PRIORITY == 0 disable pm_activity which need by bl616
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:03:48 +08:00
dulibo1 5a57aa0af8 pm:CMakeLists update for pm runtime
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 11:03:48 +08:00
dongjiuzhu1 29e7b00c4e fs/epoll: add error log when epoll wait return failed
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 10:44:59 +08:00
dongjiuzhu1 580bdda624 fs/poll: ouput error log about poll failed
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-28 10:44:59 +08:00
Filipe Cavalcanti a64171f059 arch/xtensa/esp32s3: fix timer initialization 2024-09-28 10:43:49 +08:00
dulibo1 14f278ab89 sim:fix oneshot sim_cancel assert
when CONFIG_PM and CONFIG_CPULOAD_ONESHOT are defined
sim_cancel may assert:
[429492.185400] [ 0] [ EMERG] [ap] _assert: Current Version: NuttX ap 12.3.0 5ffeb16111-dirty Dec  4 2023 14:32:27 sim
[429492.185400] [ 0] [ EMERG] [ap] _assert: Assertion failed : at file: sim/sim_oneshot.c:367 task: Idle_Task process: Kernel 0x323254d
[429492.185400] [ 0] [ EMERG] [ap] backtrace:
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0xf7941ad5>] _fini+0xf0753010/0xf8e1155b
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x71def50>] host_backtrace+0x41/0x72
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x65b68bd>] up_backtrace+0x126/0x2f8
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x6554ceb>] sched_backtrace+0x70/0x8a
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x37585d2>] sched_dumpstack+0xed/0x494
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x3694d8e>] _assert+0x93b/0xa82
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x33223eb>] __assert+0x3e/0x4c
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x336b6d5>] sim_cancel+0xde/0x392
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x36a4301>] nxsched_oneshot_pmnotify+0x2aa/0x2ee
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x36bce77>] pm_changeall+0x478/0x526
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x36bd71f>] pm_changestate+0x380/0x82c
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x336297b>] up_idle+0x54/0xa6
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x32347b8>] nx_start+0x226b/0x226e
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x31d49f5>] main+0x54/0x70
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0xf6bbcfa1>] _fini+0xef9ce4dc/0xf8e1155b
[429492.185400] [ 0] [ EMERG] [ap] [ 0] [<0x31914ac>] _start+0x31/0x46

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 10:43:09 +08:00
yanghuatao 7cd38dca6a nuttx/libm: Fix powf wrong if first parameter is negative
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-28 10:42:36 +08:00
dulibo1 347154c01e clk:optimized the clk_set_rate for mux
clk_mux_determine_rate->clk_get_parent_by_index

this path consume time too much

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 10:38:55 +08:00
dulibo1 a6cf57dbac clk:change lock to recursive lock
case:
clk_set_rate ->
clk->ops->round_rate ->
divider_round_rate ->
clk_divider_bestdiv->
clk_round_rate

this path casue  recursive clk_list_lock

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 10:38:55 +08:00
dulibo1 d5fdeffd06 clk:add critical protection for api
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-28 10:38:55 +08:00
dulibo1 15833a3cbd regualtor: use regulator_enable in idle task may casue assert
if regulator_get the supply which call kmm_zalloc

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-28 10:38:55 +08:00
dulibo1 f53ae757b8 regualtor:adjust the critical area protected
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-28 10:38:55 +08:00
Tomasz 'CeDeROM' CEDRO 54c93dd43a DOC: STM32F4 add example flash/reset/debug information.
* Information on how to flash NuttX firmware to STM32F4 target was missing
  in the documentation and asked by new users on the dev@ list.
* Example on how to Flash, Reset, Debug with OpenOCD is now added to docs.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-09-28 10:04:08 +08:00
Tomasz 'CeDeROM' CEDRO d949f569ab DOC: STM32F7 add example flash/reset/debug information.
* Information on how to flash NuttX firmware to STM32F7 target was missing
  in the documentation and asked by new users on the dev@ list.
* Example on how to Flash, Reset, Debug with OpenOCD is now added to docs.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-09-28 10:04:08 +08:00
Tomasz 'CeDeROM' CEDRO 736e0ac34f DOC: STM32F3 add example flash/reset/debug information.
* Information on how to flash NuttX firmware to STM32F3 target was missing
  in the documentation and asked by new users on the dev@ list.
* Example on how to Flash, Reset, Debug with OpenOCD is now added to docs.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-09-28 10:04:08 +08:00
zhuanglin 07507669ba libc.csv: Add more missing interface
libc.csv adds the strlcpy, getrandom, task_tls_alloc, and fork interfaces

Signed-off-by: zhuanglin <zhuanglin@xiaomi.com>
2024-09-28 09:11:10 +08:00