Commit Graph

52798 Commits

Author SHA1 Message Date
Jakub Janousek
3ce84d1ba0 arch and board esp32c3-legacy: Add optional iCE40 FPGA loading support
Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>
2024-04-12 10:19:58 -03:00
Jakub Janousek
23c6b5b07d drivers/spi: Add support for FPGA iCE40 bitstream loading.
Tested on ICE-V-Wireless board.

Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>
2024-04-12 10:19:58 -03:00
Zhe Weng
932c41debb net/nat: Remove unnecessary logic in inbound logic
Finish https://github.com/apache/nuttx/pull/12116#discussion_r1560880897

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-12 14:39:01 +02:00
Zhe Weng
17584eaa4f net/nat: Rename struct ipv*_nat_entry to ipv*_nat_entry_t
I found `struct ipv*_nat_entry` is missing `_s` suffix, but the name is too long in some cases, so maybe `ipv*_nat_entry_t` could be better.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-12 14:39:01 +02:00
jianglianfang
62a4799409 video/vnc: add vnc_fb_register
To optimize the initialization of vnc, change it to vnc_fb_register.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-04-12 17:42:49 +08:00
hujun5
82acf6e6a7 irq: All irq_cpu_locked is called in the critical_section, and the parameter is the current cpu id.
so it must return false, We can safely delete.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-12 17:40:23 +08:00
hujun5
1b068b0d4b sched/irq: remove scheduling check in csection
1. The critical section does not prevent task scheduling
2. If the critical section is in sched_lock, there is no need to check,
   scheduling is not going to happen
3. If sched_lock is in the critical section, sched_unlock will also
   trigger scheduling without waiting for the exit of the critical section
4. After exiting the critical section, if there is an interrupt,
   the scheduling will be automatically triggered

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-12 16:15:42 +08:00
Zhe Weng
e543a8086e net: Optimize TCP/UDP port selection
Optimize TCP/UDP port selection, and fix possibly dead loop.

Finish discussion in https://github.com/apache/nuttx/pull/12116#discussion_r1560851977

Note:
Linux also uses EADDRINUSE for failing in finding a portno, according to https://man7.org/linux/man-pages/man2/bind.2.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-12 15:46:29 +08:00
dependabot[bot]
b5f4e1a1ae build(deps): bump idna from 3.4 to 3.7 in /Documentation
Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.4...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 10:05:14 +08:00
Zhe Weng
4eddf84a76 net/nat: Optimize port selection
And fix possibly dead loop.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-11 22:23:29 +08:00
Zhe Weng
f3b34c84c2 net/nat: Support IPv6 Masquerading (NAT66)
Notes:
1. This version of NAT66 is a stateful one like NAT44, corresponding to Linux's MASQUERADE target of ip6tables.  We can support stateless NAT66 & NPTv6 later by slightly modify the address & port selection logic (maybe just match the rules and skip the entry find).
2. We're using same flag `IFF_NAT` for both NAT44 & NAT66 to make control easier.  Which means, if we enable NAT, both NAT44 & NAT66 will be enabled.  If we don't want one of them, we can just disable that one in Kconfig.
3. Maybe we can accelerate the checksum adjustment by pre-calculate a difference of checksum, and apply it to each packet, instead of calling `net_chksum_adjust` each time.  Just a thought, maybe do it later.
4. IP fragment segments on NAT66 connections are not supported yet.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-11 22:23:29 +08:00
Zhe Weng
676826cb7c net/utils: Add net_ipv6_payload to get IPv6 L4 payload
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-11 22:23:29 +08:00
Zhe Weng
f2ff5cee03 net/nat: Make some IPv4 NAT functions as common
To prepare for future IPv6 NAT functions.
- Rename common ipv4_nat_xxx to nat_xxx
- Move some common definitions into header

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-11 22:23:29 +08:00
Inochi Amaoto
412d2ce113 arch/riscv: add T-HEAD CSR mapping
Add T-HEAD CSR mapping file.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-11 22:20:39 +08:00
chao an
23e9489345 sched/mqueue: correct list parameter
1. correct list parameter
2. move global data to bss

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-11 22:19:34 +08:00
vela-mib
9a4afbcb62 add drivertest test cases on sim for CI
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-04-11 10:33:15 -03:00
Yanfeng Liu
24df2cc177 mm/map: minor reformating
This is for easier grep searching.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-11 14:15:57 +08:00
hujun5
638716504d fdcheck: update fdcheck impl
1 store fd in the high position
2 removing the pid information , as the tag information is sufficient.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-11 10:45:44 +08:00
hujun5
6c24ff95d4 timer: use spin_lock_irqsave protect g_alloctimers
all other g_alloctimers being protect by spin_lock_irqsave

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-11 10:45:34 +08:00
Inochi Amaoto
bae686e127 arch/riscv: force using encoding macro for CSR access
Using CSR name depends on compiler support heavily, but CSR
encoding does not have this problem. It also make it easy to
add new CSR support even if the compiler does not support.

Unify CSR access by using the CSR encoding macro.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-11 10:43:48 +08:00
Emmanuel Ferdman
4847587cf2 Documentation: update broken links 2024-04-10 15:17:53 -03:00
wangjianyu3
f0590eeaf0 drivers/power/pm: Fix warning of type cast
Env: sim (Ubuntu 22.04.3 LTS (x86_64 GNU/Linux)), enable PM
```
power/pm/pm_autoupdate.c: In function ‘pm_auto_updatestate’:
power/pm/pm_autoupdate.c:84:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   84 |                      pm_auto_updatestate_cb, (FAR void *)domain, 0);
      |                                              ^
power/pm/pm_autoupdate.c:89:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   89 |           pm_auto_updatestate_cb((FAR void *)domain);
      |                                  ^
```

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-04-10 22:51:28 +08:00
Huang Qi
9e78b235fe riscv: Add more debug related CSR definitions
This patch adds more debug related CSR definitions
to arch/risc-v/include/csr.h.

These definitions are from the RISC-V Debug Specification
Version 1.0 rc1 (https://github.com/riscv/riscv-debug-spec).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-04-10 21:10:39 +08:00
Omar
01aeeaeac6 ESP32S3 I2S GPIO selection master/slave hase same range for BCLK,WS pin 2024-04-10 15:00:45 +08:00
Omar
4c744f1c0e ESP32S3 configuring gpio pin 19 or 20 ( USB_D+/- ) for any purposes 2024-04-10 15:00:45 +08:00
Omar
b864522b65 ESP32S3 I2S BCLK, WSPIN, DINPIN, DOUTPIN pin range changed to 0 48 2024-04-10 15:00:45 +08:00
vela-mib
9847c6219d add libuv and cmocka test cases with file system on sim and qemu on CI
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-04-10 14:46:53 +08:00
Jukka Laitinen
729e9fc8e3 arch/arm64/src/Toolchain.defs: Add -mcpu=cortex-a55 if CONFIG_ARCH_CORTEX_A55 is defined
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-04-09 19:39:33 -03:00
Xiang Xiao
4ea2aeff6b arch: Remove xxx_intstack_top and xxx_intstack_alloc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-09 16:59:00 -03:00
ligd
4e725ecd44 arch: color the intstack for all the CPUs
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-04-09 16:59:00 -03:00
ligd
3844efb5b8 stack: update up_get_intstackbase API to support cpu id
For crash dump all the CPU intstack

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-04-09 16:59:00 -03:00
meijian
93beeeeab0 [tcp/udp] fix port generation not in range
(port % max + min)may overflow uint16

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-09 23:35:55 +08:00
wangchen
b446a002db net:add customizable default max & min port
add customizable default max & min port

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-04-09 23:35:55 +08:00
Zhe Weng
7f1e80f0de net/nat: Slightly optimize the IPv4 NAT
1. Reduce getting `old_ip` in `ipv4_nat_ip_adjust`.
2. Some format change.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-09 14:44:26 +08:00
chao an
09e5dca965 sched/pthread: detached thread should destroy the join info
In order to ensure the detached thread obtain the correct return
value from pthread_join()/pthread_cancel(), the detached thread
will create joininfo to save the detached status after thread
destroyed.  If there are too many of detached threads in the
process group, the joininfo will consume too much memory.
This is not friendly to embedded MCU devices.
This commit keep the semantics as #11898 was introduced,
will no longer save joininfo for detached threads to avoid wasting memory.

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-09 13:46:51 +08:00
simbit18
9967989b02 Fix Kconfig style
Remove spaces from Kconfig files
Remove TABs
Add comments
2024-04-09 10:49:23 +08:00
Eren Terzioglu
c0d7419d11 esp32[c3|h2|c6]: Bugfixes for filesystem errors 2024-04-09 10:48:40 +08:00
Alan Carvalho de Assis
67dbdb18e3 stm32f76xx77xx_rcc: Fix PLLI2S factor divisors
Value was set with PLLSAI factor divisors instead of
PLLI2S factor divisors.

Signed-off-by: Alan C Assis <acassis@gmail.com>
2024-04-09 10:45:13 +08:00
zhanghongyu
a9bff735e7 net/can: deliver data into multiple CAN conn bound to same dev
Because CAN is a broadcast protocol, each conn needs to be given independent data to avoid mutual interference.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-09 00:25:44 +08:00
Alin Jerpelea
589bb56bcb Documentation: add NuttX-12.5.1 release notes
Add release notes for 12.5.1 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-04-08 21:40:59 +08:00
chenrun1
48a399479c Fixed CI issues caused by moving OSPERF in https://github.com/apache/nuttx-apps/pull/2346
====================================================================================
Cmake in present: qemu-armv8a/nsh_smp
Configuration/Tool: qemu-armv8a/nsh_smp
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Building NuttX...
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/arm64/qemu/qemu-armv8a/configs/nsh_smp/defconfig

no changes added to commit (use "git add" and/or "git commit -a")

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-08 14:08:55 +08:00
Jukka Laitinen
5e5640992d arch/arm64/src/imx9/imx9_flexio_pwm.c: Fix wrong input scale and pulse width
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-04-08 03:02:42 +08:00
W-M-R
bbec17daff sim/kconfig: select ARCH_TOOLCHAIN_GNU
Missing ARCH_TOOLCHAIN_GNU option causes sim's kasan recursion

Signed-off-by: W-M-R <mike_0528@163.com>
2024-04-07 14:57:44 -03:00
Jorge Guzman
f7a98db234 stm32h7/fdcan: fixed kconfig and debug register
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-04-07 14:56:58 -03:00
Igor Mišić
510b6221ca stm32h7/stm32_i2c: fix sending large data over i2c
To trigger TC interrupt NBYTES needs to be set before RELOAD is disabled
2024-04-07 14:54:47 -03:00
Zhe Weng
a1a09f271f net/nat: Support Symmetric NAT
The symmetric NAT limits one external port to be used with only one peer ip:port.

Note:
1. To avoid using too much #ifdef, we're always passing peer_ip and peer_port as arguments, but won't use them under full cone NAT, let the compiler optimize them.
2. We need to find port binding without peer ip:port, so don't add peer ip:port into hash key.
3. Symmetric NAT needs to *select another external port if a port is used by any other NAT entry*, this behavior is exactly same as Full Cone NAT, so we don't need to change anything related to `ipv4_nat_port_inuse`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-07 23:57:55 +08:00
W-M-R
0ede3fc377 kasan: Implementing global variable out of bounds detection
Extracting global variable information using scripts:
kasan_global.py:
1. Extract the global variable information provided by the -- param asan globals=1 option
2. Generate shadow regions for global variable out of bounds detection
Makefile:
1. Implement multiple links, embed the shadow area into the program, and call it by the Kasan module

Signed-off-by: W-M-R <mike_0528@163.com>
2024-04-07 23:31:13 +08:00
Xiang Xiao
2fd73bd82f net: Fix max conn always one less than configured value
return NULL only when the total number is larger than configured value

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-07 10:42:56 -03:00
Zhe Weng
9ab0d8cce6 Documentation: Add docs for lower-half of netdriver
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-07 10:17:13 -03:00
chenrun1
d19486e1f8 driver/filemtd:support isbad & markbad
In this change, we can mount a filesystem on filemtd that works like Yaffs and works on the Nand driver

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-07 18:50:00 +08:00