Commit Graph

50533 Commits

Author SHA1 Message Date
zhanghongyu dd080773cc usrsock_server: coverity fix for access invalid index
req->usockid maybe < 0 or > CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS,
if so , priv->pfds[req->usockid] will access invalid memory.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-11 15:29:59 +08:00
zhanghongyu 0ead147841 rpmsgdev: support single read/write mode device
The default mode for Rpmsgdev is to read/write data as long as possible for
caller, this mode does not apply to tun devices, tun devices can read and
write only one complete ip packet at a time.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-11 15:29:32 +08:00
zhanghongyu 2b4cf41e14 tun: move tun related macro definitions out of CONFIG_NET_TUN
to support cross-core tun device operations via rpmsgdev

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-11 15:26:39 +08:00
zhanghu5 305c213d15 filter out control character in pty echo
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2023-08-11 13:58:54 +08:00
yinshengkai 67cb1d1650 note: simplify noteram logic
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
yinshengkai e69dd5f705 noteram: remove task_context
syscall cannot be called in syscall, if this happens, it should be fixed (interruption is similar)

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
yinshengkai 4aa13542d1 note: remove the name field of task_context
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
yinshengkai 4cb2d7dc25 note: directly returns the taskname pointer
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
yinshengkai 63252af054 sched: remove space in task name
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
yinshengkai 84799d15ac note: remove NOTERAM_GETTASKNAME
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
yinshengkai 39001e3705 drivers/noteram: move trace_dump to noteram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:27:17 +08:00
sunkun3 7ba9236c54 usbdev/composite: winusb devices are not automatically recognized by windows
Description bMS_VendorCode is incorrectly configured. Change it to
USB_REQ_GETMSFTOSDESCRIPTOR(0xee), which is the same as the request
processing logic for GET_MS_DESCRIPTOR in the code

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-11 13:19:13 +08:00
sunkun3 052d46c690 usbdev: a memory leak occurred when the usb uninitialize process was executed
In usbclass_unbind, DEV_FREEEP is called first, and later
usbclass_freereq does not free memory due to ep NULL

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-11 13:19:13 +08:00
liuhongchao 7dde402982 drivers/input:Fix setting the number of keyboard driver buffers fails
Buffer nums is not multiplied by the structure size

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-11 13:17:54 +08:00
zhanghu5 a69b6846e6 fix byte_block_count error in byte mode
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2023-08-11 13:15:57 +08:00
Zhe Weng d98bfc3e49 net/icmpv6: Fix `icmpv6_neighbor` for link-local address
The netdev of link-local address cannot be auto decided, and the link-local address should always be reguarded as address on local network.

The problem we met:
When using `icmpv6_autoconfig` with multiple netdev, the `icmpv6_neighbor` may take out wrong netdev with ip address already set, then it may send solicitation with wrong address (`dev->d_ipv6draddr`) on wrong device, and regard the link-local address as conflict (because `dev->d_ipv6draddr` exists on this network).

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-11 02:00:39 +08:00
liaoao dffab1e0c6 qemu: add devicetree support for arm64
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-11 00:46:50 +08:00
chenxiaoyi 6d6e1aea3b sim: Fix sim stack smashing problem
The reason is that the new created task receives signal while
it has not entered its stack frame.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2023-08-10 23:30:22 +08:00
xuxin19 b3678b1454 cmake:support nxlib cmake compilation
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-10 23:18:56 +08:00
xuxin19 4668b5fa22 cmake:fix cmake nxlib build break
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-10 23:18:56 +08:00
dulibo1 af60bf8213 regulator:optimize the lock to support call the interface in idle task by pm
support call api in idle task

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
dulibo1 1456919e58 regulator:support lp mode and auto pm register
1.add new intf regulator_set_mode to manual set rehulator lower power mode;
2.when add auto lp desc,the regulator lp mode is controlled by  pm framework;

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
dulibo1 935359fa3f regulator: support link to supply
when add supply desc,the regulator is linked to the parent regulator
1.if enable the regualtor, the parent regulator is enabled
2.if disable all child regulator, the parent regualtor is disabled

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
dulibo1 67aa12e762 regulator:support always on
when add always on desc,the regulator is always enabled

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
zhanghu5 5890fde1ed drivers/input: Implement the debounce in button_upper.c
use delay configurable watchdog to implement debounce

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2023-08-10 23:14:26 +08:00
yintao 26f996b927 nuttx/input: fix uinput_rpmsg_device_destroy crash
Signed-off-by: yintao <yintao@xiaomi.com>
2023-08-10 23:13:40 +08:00
ligd 324aa7d17f sim: rptun support panic & reset
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-10 23:13:40 +08:00
qinwei1 37e69cdeb0 arch/arm64: enable for arm64 virt to choice CPU core
Summary
    Qemu virt board can choice CPU core with boot parameter
and we need to add Konfig option for choice
    the change do this

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-10 20:48:19 +08:00
liaoao 74dddfe92b fdt: add libfdt support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-10 20:47:37 +08:00
hujun5 b185f8d889 binfmt: add enter_critical_section
adding enter_critical_section to ensure non preemption in smp
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-10 20:46:59 +08:00
anjiahao 6eabacf304 mempool:change mutex to rmutex avoid deadlock
If malloc chunk fails, and if malloc fails to dump all memory,
it will cause deadlock in multiple_mempool_info
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-10 13:43:32 +02:00
hujun5 b82ccd6621 arch/timer: frequency 0 should not be set
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-10 17:59:21 +08:00
qinwei1 d8e1022b6f arm64: add hostfs support
Sumary
   add hostfs support for arm64, it's a copy
from arm32.

Note:
   it's not support for opendir and readdir, command
like ls will not work.

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-10 17:58:34 +08:00
hujun5 34dcd1c50a net: remove [enter|leave]_critical_section and sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-10 12:24:30 +03:00
Xiang Xiao 6b4e5c0d15 binfmt: Change the default of BINFMT_DISABLE to DEFAULT_SMALL
to optimize the image size when and DEFAULT_SMALL is enabled
and refresh the defconfig in boards/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-10 11:35:41 +03:00
yinshengkai 541f600ab6 drivers/note: fix unknown type name bool
/home/baerg/code/NXOS/nuttx/include/nuttx/note/noteram_driver.h💯61: error: unknown type name ‘bool’
100 | noteram_initialize(FAR const char *devpath, size_t bufsize, bool overwrite);
| ^~~~
/home/baerg/code/NXOS/nuttx/include/nuttx/note/noteram_driver.h:31:1: note: ‘bool’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-10 15:58:35 +08:00
wangbowen6 cbb594dcbc sim: add set/get_power for sim_framebuffer.c
add set/get_power operation for sim_framebuffer to avoid assert
in fb_ioctl(cmd= FBIOSET_POWER/FBIOGET_POWER)

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-08-10 15:57:57 +08:00
wangbowen6 8db4abd5dd arm_backtrace_sp: check the addr after every operation to addr
Should check the addr every time it changed to avoid crash in
backtrace.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-08-10 15:52:23 +08:00
Zhe Weng 264283c5a2 net/icmpv6: Fix value of `SIZEOF_ICMPV6_ECHO_xxx_S`
The `SIZEOF_ICMPV6_ECHO_REQUEST_S` and `SIZEOF_ICMPV6_ECHO_REPLY_S`
macro are intended to be `8+n`, but actually becomes `10-1+n` and causes
the packet sent by `ping6` one byte more than expected.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-10 15:51:16 +08:00
liaoao c1eecd7c4f procfs:add armv6-m cpuinfo
signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-10 14:13:35 +08:00
makejian ac76a8fe0f crypto: export SHA224/SHA384 via /dev/crypto
(1)add sha224 algorithm in sha2.c
(2)export sha224/sha384
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-10 13:36:19 +08:00
wangming9 f4e33e488d arch/arm64: Fixed arm64 backtrace support for other processes
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-10 13:35:59 +08:00
anjiahao 319e8d66f6 crypto:fix typo for blake2s
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-10 13:35:44 +08:00
zhangyuan21 b705103f23 arm64: save and restore fpu regs in jmp when ARCH_FPU enabled
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-10 13:12:16 +08:00
zhangyuan21 b5f266d5af armv8-m: the FPSCR[18:16] LTPSIZE field in exception_common
In armv8m the FPSCR[18:16] LTPSIZE field must be set to 0b100 for
"Tail predication not applied" as it's reset value.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-10 13:11:45 +08:00
wangbowen6 9aa57b6c53 virtio: add virtio framework in NuttX
1. virtio devics/drivers match and probe/remote mechanism;
2. virtio mmio transport layer based on OpenAmp (Compatible with both
   virtio mmio version 1 and 2);
3. virtio-serial driver based on new virtio framework;
4. virtio-rng driver based on new virtio framework;
5. virtio-net driver based on new virtio framework
   (IOB Offload implementation);
6. virtio-blk driver based on new virtio framework;
7. Remove the old virtio mmio framework, the old framework only
   support mmio transport layer, and the new framwork support
   more transport layer and this commit has implemented all the
   old virtio drivers;
8. Refresh the the qemu-arm64 and qemu-riscv virtio related
   configs, and update its README.txt;

New virtio-net driver has better performance
Compared with previous virtio-mmio-net:
|                        | master/-c | master/-s | this/-c | this/-s |
| :--------------------: | :-------: | :-------: | :-----: | :-----: |
| qemu-armv8a:netnsh     |  539Mbps  |  524Mbps  | 906Mbps | 715Mbps |
| qemu-armv8a:netnsh_smp |  401Mbps  |  437Mbps  | 583Mbps | 505Mbps |
| rv-virt:netnsh         |  487Mbps  |  512Mbps  | 760Mbps | 634Mbps |
| rv-virt:netnsh_smp     |  387Mbps  |  455Mbps  | 447Mbps | 502Mbps |
| rv-virt:netnsh64       |  602Mbps  |  595Mbps  | 881Mbps | 769Mbps |
| rv-virt:netnsh64_smp   |  414Mbps  |  515Mbps  | 491Mbps | 525Mbps |
| rv-virt:knetnsh64      |  515Mbps  |  457Mbps  | 606Mbps | 540Mbps |
| rv-virt:knetnsh64_smp  |  308Mbps  |  389Mbps  | 415Mbps | 474Mbps |
Note: Both CONFIG_IOB_NBUFFERS=64, using iperf command, all in Mbits/sec
      Tested in QEMU 7.2.2

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-10 03:39:39 +08:00
chao an d010744582 drivers/pipes: use circbuf to refine buffer model
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-10 03:33:56 +08:00
yinshengkai 9f9076ed61 boards/arty_a7: fix ci compile failure
NETUTILS_IPERF and CONFIG_DEFAULT_SMALL conflict

Loaded configuration '.config'
Configuration saved to '.config'
warning: LIBC_FLOATINGPOINT (defined at libs/libc/stdio/Kconfig:55) has direct dependencies !LIBM_NONE with value n, but is currently being y-selected by the following symbols:
 - NETUTILS_IPERF (defined at /home/baerg/code/NXOS/apps/netutils/iperf/Kconfig:6), with value y, direct dependencies NET (value: y), and select condition NET (value: y)
make: *** [tools/Unix.mk:680: olddefconfig] Error 1
ERROR: failed to refresh

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-10 03:33:42 +08:00
jinxudong 571f52c9d3 feature: sensor: add force sensor
A sensor of this type measures the force on it, and additionally
compares the force with one or more specified thresholds. The sensor
can output the force value directly. Moreover, it's usually applied
as a press key. In that case, when it detects a force greater than
some given threshold, a corresponding event is reported.

Signed-off-by: jinxudong <jinxudong@xiaomi.com>
2023-08-09 21:57:58 +08:00
yangsen5 ce9f40aeb6 drivers/video: add nuttx goldfish camera driver
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-09 18:30:11 +08:00