Commit Graph

55173 Commits

Author SHA1 Message Date
Matteo Golin e959e0062e Create a documentation folder to list sensor drivers that are available. This way each sensor added/implemented can have its own space to define any unique ioctl commands that it uses, unique error codes and programming examples. 2024-10-03 15:36:10 -03:00
p-szafonimateusz ce61347ddf arch/x86_64/intel64/intel64_schedulesigaction.c: properly align signal handler stack for vector operations
signal handler stack must be properly aligned, otherwise vector instructions doesn't work in signal handler

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 21:07:19 +08:00
p-szafonimateusz ed4acb20cc arch/x86_64/intel64/intel64_cpuidlestack.c: stack_alloc should point to stack base not stack top
stack_alloc should point to stack base not stack top

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 21:07:19 +08:00
p-szafonimateusz 6b8d0c6a16 arch/x86_64/intel64/intel64_head.S: move initial RSP for AP cores below regs area
move initial RSP for AP cores below regs area.
otherwise IDLE thread for AP cores can be corrupted

XCP region now match regs allocation in up_initial_state()

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 21:07:19 +08:00
p-szafonimateusz 026e1b4b5e arch/intel64: colorize IDLE stack for AP cores
colorize IDLE stack for AP cores in x86_64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 21:07:11 +08:00
p-szafonimateusz 4a6e6563cb arch/x86_64/addrenv.h: fix MMU flags for USER region
fix typo in MMU flags for USER region

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 21:06:52 +08:00
p-szafonimateusz b47839b9c2 arch/intel64: fix IRQ conflict with GOLDFISH
Also move MSI IRQ definition to place where other IRQ definitions are.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 20:55:19 +08:00
p-szafonimateusz 76bfb994a7 arch/x86_64/src/intel64: use legacy method to map memory <4GB
the new mapping method may not work when we have to map memory at the early boot stage

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-03 20:54:59 +08:00
Bowen Wang 51d6e8f49e virtio/vhost: assign the virtio/vhost_drvier to device->priv before probe
So the driver can get the driver pointer by vdev/hdev->priv,
and later vdev/hdev->priv can be used to store other data such as the
virtio/vhost drivers' private data.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-03 17:37:40 +08:00
Bowen Wang c42576e87b drivers/vhost-rng: add vhost rng driver support for NuttX
vhost-rng is a simple virtio device implementation, it receives
the buffer receviced from the virtio-rng driver and fill the random
number to this buffer and return to virtio-rng.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-03 17:37:40 +08:00
Bowen Wang 7afbcc1a62 drivers/vhost: add vhost framework for NuttX
virtio is a framework to implement the virtio drivers
vhost (Virtual Host) is a framework to implement the virtio devices
With the virtio and vhost framework, we can use the virtio drivers
and vhost drivers to implement the cross-core communication.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-03 17:37:40 +08:00
Lup Yuen Lee 089b5e07c7 build.yml: Check out the correct branch of nuttx-apps
When building a branch like `releases/12.7`, the CI Workflow incorrectly checks out the `master` branch of `nuttx-apps`, instead of `releases/12.7`. This PR fixes a typo in `apps_ref`, to check out the correct branch.
2024-10-03 14:29:12 +08:00
SPRESENSE c38b4494be arch: cxd56xx: update loader and gnssfw version
Update loader and gnssfw to version 2.2.20596
2024-10-03 14:25:09 +08:00
SPRESENSE cc6306a559 boards: cxd56xx: Fix an issue not to enter cold sleep
Fix an issue not to enter cold sleep by SD Card detection interrupt.
2024-10-03 14:24:55 +08:00
SPRESENSE fb7c429504 arch: cxd56xx: Fix gnss compile error
Fix a compile error when CONFIG_CXD56_GNSS_CEP_ON_SPIFLASH is enabled.
2024-10-03 14:24:15 +08:00
zhengyu9 70a91289dd fs: fdcheck can't assert
while running fdcheck_test_common there should be assertion failed

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2024-10-03 14:22:55 +08:00
zhangyuan29 34d247fb5f group: change pthread_kill to tkill in kernel mode
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-03 09:39:33 +08:00
Lup Yuen Lee abe2f4baa2 build.yml: Skip the CI Builds that don't match the Arch Label
This PR proposes to enhance the CI Workflow, to skip the unnecessary NuttX Builds. Currently, NuttX Devs wait for the CI Builds to complete across All Architectures (Arm32, Arm64, RISC-V, Xtensa), even though they modified a Single Architecture. With this PR, the CI Workflow will build only the Modified Architecture.

The solution uses the Arch Labels for PRs. We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- If "Arch: arm / arm64" is the only non-size label, then we build `other`, `arm-01`, `arm-02`, ...
- If "Arch: risc-v" is the only non-size label, then build `risc-v-01`, `risc-v-02`
- If "Arch: xtensa" is the only non-size label, then build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built

The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-03 09:38:48 +08:00
Yongrong Wang d0e4c4436e rpmsg_virtio: move rpmsg virtio cmd definition before the resource table
use reserved[2] in struct resource_table as the command, avoid the
resource table format do not follow the standard.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-03 09:37:24 +08:00
Ville Juven 30aa947b95 arm64_fpu: Remove fpu_regs from the TCB
Since FPU is now always saved into the current process stack location
upon exception entry, there is no need to keep fpu_regs (or saved_fpu_regs)
in the TCB.
2024-10-03 09:08:26 +08:00
simbit18 b3107a1f1b tools/testbuild.sh: Improved speed in the skipping phase 2024-10-03 08:59:04 +08:00
Bowen Wang af6eb7226e drivers/rptun: add cmake support for rptun_secure
1. Add cmake support for rptun_serure;
2. Move rptun_secure.c before rptun_ivshmem.c in Make.defs to follow
   the order in Kconfig.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-03 08:57:46 +08:00
Jukka Laitinen a88693f519 drivers/usbdev/cdcacm.c: Fix compilation issues
Add #ifdef CONFIG_SERIAL_TXDMA/RXDMA in g_uartops init

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-03 08:55:13 +08:00
Jukka Laitinen 5d4d2cbbc8 drivers/usbdev/pl2303.c: Don't let maximum number of bytes in request exceed CONFIG_PL2303_BULKIN_REQLEN
The request length may not exceed CONFIG_PL2303_BULKIN_REQLEN, otherwise buffer overflow will occur

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-03 08:55:13 +08:00
Jukka Laitinen 18526d78eb drivers/usbdev/cdcacm.c: Set reqlen properly according to ep->maxpacket and CONFIG_CDCACM_BULKIN/OUT_REQLEN
The request length may not exceed CONFIG_CDCACM_BULKIN_ lenghts, otherwise buffer overflow will occur

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-03 08:55:13 +08:00
Jouni Ukkonen 9ea098558a arch/arm64/src/imx9/imx9_usbdev.c: Clean up cache operations, add DEBUGASSERTS
Correct some of the cache operations:

- EP0 request length was handled incorrectly
- Received data cache invalidate was exceeding the received buffer
- writedtd is also called with no data (EP0 ACK/NACK). Don't touch cache in that case.

Fix trip wire handling to conform with the IMX93 reference manual

Also add DEBUGASSERTS for future to check the validity of pointers and sizes

Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-03 08:55:13 +08:00
zhaohaiyang1 534114395e char driver CAN: add tx_confirm function in upperCAN driver.
add tx_confirm function in upperCAN driver1

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-02 21:22:07 +08:00
Neo Xu e2e0706009 espressif/spi: fix missing SPI setup
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-02 21:17:38 +08:00
Neo Xu 3636495f39 espressif/spi: fix crash when rx buffer is NULL
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-02 21:17:38 +08:00
zhangyuan29 c75d9565b2 dlsym: add more header to fixed protected build issue
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-02 21:16:28 +08:00
guoshichao 415bd57c50 greenhills: fix the pow() function calculate error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-10-02 21:16:03 +08:00
liaoao 0e2bf8ce2c assert:read content of undefinedinsn address
read content of undefinedinsn address, and compare it with what it is in elf  to check if there is a ram bit flip

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-10-02 21:15:26 +08:00
W-M-R eb2f661170 make/kasan: Added cmake toolchain compilation options about kasan for arm64 architecture
Signed-off-by: W-M-R <Mike_0528@163.com>
2024-10-02 21:09:31 +08:00
W-M-R 5febd80efe cmake: add_compile_options recognizes parameter exception
add_compile_options(--param asan-globals=1) is recognized as
--param-lasan-globals=1, which causes compilation exception:

Signed-off-by: W-M-R <Mike_0528@163.com>
2024-10-02 21:09:31 +08:00
zhangyuan29 dcae65f504 sched: Disable the scheduling when send SIGCHLD signal
Disable the scheduling to prevent other tasks from being
deleted after they are awakened

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-02 20:59:01 +08:00
Neo Xu b6d2dc6c54 lcd/st7735: add option to invert display color
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-02 20:52:55 +08:00
zhangyuan29 38ddf7d59f sched: process scheduler before wd_timer handler
wd_timer handler will change current task, so need process
scheduler before wd timer handler, Ensure that the current
task is not updated before the RR process

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-02 10:30:48 +02:00
Ville Juven 24c931c220 arm64_task/pthread_start: Set sp_el0 upon starting user process
As the handling of sp_el0 was moved from the context switch routine
to exception entry/exit, we must set sp_el0 explicitly when the user
process is first started.
2024-10-02 14:09:22 +08:00
lipengfei28 8e200e69d4 Kernel build: enter exception save sp_sl0,exit exception restroe sp_el0
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-02 14:09:22 +08:00
ligd c3da7c29e8 arm64: simply the vectors
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-02 14:09:22 +08:00
ligd 007399dd75 arm64: save FPU regs every time
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-02 14:09:22 +08:00
dongjiuzhu1 b2e69b86ad fs/inode: remove unnecessary return value for inode_addrefs
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
dongjiuzhu1 09a9611ae9 fs/inode: using rwsem lock as inode_lock to avoid deadlock
Example:
When executing "df -h" on Core A to view mount information, this
process will traverse inode nodes, thereby holding the inode_lock.
Since the inode type of the mount point may be rpmsgfs, it will fetch statfs
information from another Core B.

Meanwhile, rcS on Core B needs to obtain file information from Core A,
which will be achieved by fetching stat information through rpmsgfs.
When this message arrives at Core A, a deadlock can occur between Core A's
rptun ap and nsh task.

However, both of these places involve read operations only, thus a reader-writer lock
can be utilized to prevent such a deadlock.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
dongjiuzhu1 a367657d2d sched/semaphore: support recursive write for same process in sem_rw lock
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
dongjiuzhu1 0de9d4ba6a sched/semaphore: add sem_rw source file to CMakeLists
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
zhaohaiyang1 2ebfdf737c add the ability that control CAN transceiver state.
add the ability that control CAN transceiver state in nuttx.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-01 21:48:50 +08:00
zhaohaiyang1 3382752b40 nuttx/can: add can controller state setting and getting in uppercan.
add can controller state setting and getting in uppercan.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-01 21:48:50 +08:00
xuxin19 18b6b72240 cmake:fix windows build break
-U_WIN32 will cause windows host source such as sim_hostirq.c hearder windows.h exception

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-01 21:34:26 +08:00
xuxin19 b9dc9fb0fc cmake:refine SIM platform CMake Toolchain file
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-01 21:34:26 +08:00
cuiziwei 394a967263 nuttx/arch: Remove GCCVER and add compilation options directly.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-01 20:41:02 +08:00