Commit graph

57331 commits

Author SHA1 Message Date
Yanfeng Liu
5f1a2696b3 board/qemu-armv7a: add board_power_off
This allows to power off qemu-armv7a target via NSH `quit` command.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-06 22:11:54 +08:00
Ritvik
3e6649856b Fix Overlap Handling in sim_copyfullstate to Prevent Undefined Behavior 2025-01-06 08:19:04 +08:00
hujun5
4d63921f0a use atomic operation for g_system_ticks
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-05 12:01:16 +08:00
wangzhi16
bbaf1ff9fd use small lock in following files:
arch/arm64/src/a64/a64_twi.c
arch/arm64/src/imx9/imx9_gpioirq.c
arch/arm64/src/imx9/imx9_lpi2c.c
arch/arm64/src/imx9/imx9_usbdev.c
arch/arm64/src/imx9/imx9_usdhc.c

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-04 22:43:20 -03:00
Tiago Medicci Serrano
7c24ef438e risc-v/qemu-rv: Initialize the userleds without late initialization
If CONFIG_BOARD_LATE_INITIALIZE is not selected, the userleds will
not be initialized. The userled initialization is not required to
be done within board_late_initialize(), thus this commit enables
initializing it in board_app_initialize() too.
2025-01-04 01:30:41 +08:00
wangmingrong1
2c5d849e01 gcov.py: Supports parsing multiple sets of gcov outputs at the same time and merging the results
Use the "-a" parameter to pass in gcda files exported by multiple devices

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-03 21:15:28 +08:00
wangmingrong1
66e074ed97 gcov: add reboot gcov storage coverage info
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-03 21:15:04 +08:00
cuiziwei
781c27a98e sim/oneshot: Remove redundant variables.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2025-01-03 21:12:41 +08:00
wangjianyu3
6020cdb816 esp32s3-devkit/adb: ADB shell service depends on SCHED_CHILD_STATUS
Log

  $ adb -s 1234 shell
  error: closed

  # BULK out
  0000   4f 50 45 4e cb 71 06 00 00 00 00 00 07 00 00 00   OPEN.q..........
  0010   52 02 00 00 b0 af ba b1                           R.......

  # BULK out
  0000   73 68 65 6c 6c 3a 00                              shell:.

  # BULK in
  0000   43 4c 53 45 00 00 00 00 cb 71 06 00 00 00 00 00   CLSE.....q......
  0010   00 00 00 00 bc b3 ac ba                           ........

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-03 21:12:20 +08:00
p-szafonimateusz
f0137d51a3 drivers/serial: simplify 16550_PCI_UARTx_CLOCK config
drivers/serial: simplify 16550_PCI_UARTx_CLOCK config

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-03 08:52:43 +08:00
p-szafonimateusz
9f93621b90 libs/libc/gdbstub/lib_gdbstub.c: fix warning
libs/libc/gdbstub/lib_gdbstub.c: fix warning

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-03 08:52:32 +08:00
p-szafonimateusz
6f9d0c97d2 libs/libc/gdbstub/lib_gdbstub.c: fix format for trap response
fix gdb crash after a few step breakpoints because trap is not correctly reported

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-03 08:52:32 +08:00
Tiago Medicci Serrano
6b1be7c66c virtio-rng: Register /dev/urandom driver if CONFIG_DEV_URANDOM=y
Virtio RNG support (CONFIG_DRIVERS_VIRTIO_RNG=y) selects
CONFIG_ARCH_HAVE_RNG. On the other hand, if CONFIG_DEV_URANDOM=y,
it defaults to CONFIG_DEV_URANDOM_ARCH if CONFIG_ARCH_HAVE_RNG=y.
DEV_URANDOM_ARCH definition states that the implementation of the
/dev/urandom should be provided by the architecture-specifig logic,
including the function devurandom_register(). In this case, the
/dev/urandom may refer to the same driver as /dev/random that is
provided by the Virtio RNG driver, which is implemented by this
commit.
2025-01-03 08:52:20 +08:00
wangzhi16
893c5e92c2 Reduce the size of tcb by four bytes.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-02 23:18:42 +08:00
Zhe Weng
3b26c6df51 net/udp: Let cansend return EWOULDBLOCK when send buffer is full
Notes:
1. This commit do the same thing as TCP did: https://github.com/apache/nuttx/pull/10627
2. UDP uses `iob_navail(false)` but TCP uses `iob_navail(true)`, this is because of a problem related to TCP recv window (https://github.com/apache/nuttx/pull/4142), so we don't need to change UDP now.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-02 23:13:39 +08:00
Yanfeng Liu
6fb12b0284 arch/qemu-armv7a: kernel mode cmake support
This allows to build kernel mode NuttX with cmake.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-02 23:13:07 +08:00
Filipe Cavalcanti
75aa80dba8 arch/xtensa: enable SPIRAM test during boot of ESP32|S3 2025-01-02 23:12:39 +08:00
p-szafonimateusz
eeef185558 arch/x86_64/include/intel64/irq.h: align definitions
align all definitions in intel64/irq.h

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-02 23:11:38 +08:00
p-szafonimateusz
cfaeb74dd3 arch/intel64: allow to attach handlers to ISR
arch/intel64: allow to attach handlers to ISR

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-02 23:10:14 +08:00
chenrun1
6f4f50e2fe v9fs/client.c:Use int ret as the return value to avoid uint32_t not supporting negative values
Summary:
 iModify the return variable in the v9fs_client_walk

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
chenrun1
1f540a93d2 v9fs/client.c:add check response.nwqid == nwname
Summary:
  There are differences in different server implementations, so it is necessary to check whether the returned nwqid satisfies the requested number.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
chenrun1
2ac2d5d511 v9fs/client.c:fix struct attach wrong parameter size
Summary:
  Change uint16_t afid -> uint32_t afid in struct v9fs_attach_s
  See: https://github.com/chaos/diod/blob/master/protocol.md

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
chenrun1
928656f3cb v9fs/client.c:count should be assigned a value before being used
Summary:
  move request.count = buflen > fidp->iounit ? fidp->iounit : buflen
before request.header.size

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
liwenxiang1
1fad0f1654 arch/x86_64: this_task is stored in the CPU private data
By default in SMP, obtaining this_task requires disabling interrupts, obtaining the current CPU index, accessing a global variable, and re-enabling interrupts. Storing this_task in percpu makes retrieval faster.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2025-01-02 15:19:25 +08:00
Bowen Wang
6485093277 rpproxy_virtio/rpserver_virtio: fix the compile error
Some checks failed
Build Documentation / build-html (push) Has been cancelled
1. Change the CONFIG_RPMSG_VIRTIO to CONFIG_RPMSG_VIRTIO_LITE
2. fix the error when modify the sim_rpmsg_virtio to port to
rpsmg_virtio_lite;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-12-31 18:01:47 +08:00
Huang Qi
6eb2f33278 arch/risc-v: inline up_cpu_index if RISCV_PERCPU_SCRATCH is not enabled
Inline the short function to provide better performance.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-12-31 04:02:22 -03:00
cd92e2d6e7 boards/risc-v, xtensa: Remove CONFIG_DEV_ZERO
CONFIG_DEV_ZERO is no longer needed in some defconfig files due to
- https://github.com/apache/nuttx/pull/15223

This PR removes CONFIG_DEV_ZERO from the affected defconfig files:
```bash
make distclean ; tools/refresh.sh --silent canmv230:knsh
make distclean ; tools/refresh.sh --silent canmv230:master
make distclean ; tools/refresh.sh --silent canmv230:nsbi
...
```

The failed builds above were extracted from [nuttx-prometheus-to-mastodon.json](https://lupyuen.org/articles/mastodon.html#appendix-post-nuttx-builds-to-mastodon)
2024-12-31 04:01:32 -03:00
liwenxiang1
c748047e25 arch/x86_64: The interrupt context flag is stored in the CPU private data
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-12-31 13:43:38 +08:00
zhanghongyu
f344a422e8 tcp_input: remove tcp_callback(ABORT) when accept conn recv TCP_RESET
when accept conn receives TCP_RESET, only accept conn itself should handle
the event, and there is no need to notify the listening conn. otherwise,
the server's poll will return with POLLERR and POLLHUP. this may cause
some applications to execute incorrect logic in the future.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-12-31 09:43:35 +08:00
Tiago Medicci Serrano
a4fd1b3a6a netpacket/sockaddr_ll: Add valid packet types for sll_pkttype
Add valid packet types for the sll_pkttype member of the struct
sockaddr_ll. These definitions are commonly used by third-party
libraries.
2024-12-31 09:41:39 +08:00
liwenxiang1
4612185cd6 arch/x86_64:g_current_regs is only used to determine if we are in irq,
with other functionalities removed.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-12-30 22:59:15 +08:00
ce920f9e93 arm/gd32f4: Remove extra lock from gd32f4xx_serial
An extra `lock` appears in gd32f4xx_serial due to 2 conflicting PRs:
- https://github.com/apache/nuttx/pull/7011
- https://github.com/apache/nuttx/pull/15352

This PR removes the extra `lock` in gd32f4xx_serial.
2024-12-30 22:57:10 +08:00
9b9869158a arm/imxrt: Remove extra lock from imxrt_edma
An extra `lock` appears in imxrt_edma due to 2 conflicting PRs:
- https://github.com/apache/nuttx/pull/15352
- https://github.com/apache/nuttx/pull/15353

This PR removes the extra `lock` in imxrt_edma.
2024-12-30 22:56:51 +08:00
mazhuang
60683d7495 nuttx/boards/XXX/defconfig:DEV_ZERO is not set
Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2024-12-30 22:22:29 +08:00
Bowen Wang
812613fabc drivers/misc/Kconfig: change DEV_ZERO deafult to !DEFAULT_SMALL.
/dev/zero is a very commonly used config, for example use
/dev/zero to test the filesystem, mtd or block devices performance.
So let's default enable it when not enable DEFAULT_SMALL

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-12-30 22:22:29 +08:00
wangmingrong1
b27dc9ee7f mm: Unified memory management alignment length
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-30 19:49:00 +08:00
Gao Feng
da845163a3 xtensa/esp32: add lock for async operation work
g_work as singleton can be changed by context switching,
but previous one async operation have not finished yet.

adapt based on: 10a1d17a85
2024-12-30 18:14:32 +08:00
Ludovic Vanasse
c55c2511ad Doc: improve and add documentations for the guide section of the wiki
* Add a migration warning to the update release system and the elf
programs documentation pages. This is just to add a papertrail from
where the documentation originate in case of error during the migration
process.
* Improve the building nuttx with app out of source tree
* Add new guide pages
	* Building uclibc++
	* Custom app directories
	* Debugging ELF loadable modules
	* Multiple NSH sessions
	* NSH network link management
	* RAM & ROM disks
	* Reading CAN messages
	* Remove device drivers with NSH
2024-12-30 12:32:42 +08:00
chao an
dc82a296f7 libc/semaphore: remove unused hander file
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-30 12:02:34 +08:00
chao an
27a03b8278 sched/semaphore: tick wait 0 timeout should be safe in interrupt context
1. remove up_interrupt_context() check, which should be safe in interrupt context
2. remove sem instance check will be handle in nxsem_trywait()

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-30 12:02:34 +08:00
YAMAMOTO Takashi
a393f7fbd3 littlefs: fix EINVAL on path operations with littlefs 2.10.0
littlefs 2.10.0 and later rejects empty paths.  use "/" instead.

tested with esp32s3-devkit:toywasm.
2024-12-29 20:43:33 -03:00
Ludovic Vanasse
b02a0758a7 Doc: add migration warning to updating release system and elf programs
Add a migration warning to the update release system and the elf
programs documentation pages. This is just to add a papertrail from
where the documentation originate in case of error during the migration
process. Also fix a bit of formatting in the pages
2024-12-29 23:40:57 +08:00
Ludovic Vanasse
04c7391162 Doc: loading ELF program
Migrate the Updating a release System with ELF programs with child pages
to official wiki
2024-12-29 14:23:27 +08:00
Bowen Wang
f0a3c43a54 rpmsg/rpmsg_virtio_lite: rename rpmsg_virtio to rpmsg_virtio_lite
Because rpmsg_virtio_lite is a better name to inform user that the
rpmsg virtio (original name) is a lite implementation of rpmsg virtio.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-12-28 22:43:20 -03:00
Alin Jerpelea
db1ebe0095 Documentation: add NuttX-12.8.0 release notes
Add release notes for 12.8.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-28 23:03:40 +08:00
Alin Jerpelea
48f80bf41e Documentation: add NuttX-12.7.0 release notes
Add release notes for 12.7.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-28 23:03:40 +08:00
Kyle Wilson
1cfab89e65 Added incomplete octospi hardware defintions.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Register addresses are defined. Bit defintions are still needed.

Bitmaps for OCTOSPI peripheral register

Incremental updates to qspi files

Redefined QSPI/OCTOSPI registers for STM32H5

Fixed register definitions for the STM32H5. However, more work still needs to be done. Some bits that shared registers on the STM32H7 have different register locations on the H5. This still needs to be accounted for.

Fixed more differences vs STM32H7 qspi

Added ifdef for including stm32_dma.h in stm32_qspi.c. Added stm32_qspi.c to Make.defs.

Register fixes. SPI activity but not able to format device yet.

Fixed DCYC mask

Set HCLK frequency to correct value. Undid ccrconfig debug.

Tested Interrupt Mode (single SPI). Added alternate bytes to meminfo and cmdinfo structures. Updated Kconfig variables for STM32H5.

Fixed base register in hardware/stm32_qspi.h. Updated qspi_dumpregs.

The base register was previously set to STM32_QUADSPI_BASE, changed to the correctly named STM32_OCTOSPI1_BASE. However, these defines for the OCTOSPI registers are not even used. Instead qspi_putreg and qspi_getreg utilize the priv->base value to access OCTOSPI registers.

Removed altbytes code, left as before. Moved QSPI clock selection to stm32h5xx_rcc.c

Changed STM32H5_QUADSPI to STM32H5_QSPI1

Added hook to define QSPI_CLK_FREQUENCY as STM32_QSPI_FREQUENCY from board.h

Removed changes to nuttx qspi.h

style fixes
2024-12-28 11:46:49 +08:00
zhangyuan29
ca4fd09275 arch_atomic: change atomic_fetch_x interface to inline function
When CONFIG_LIBC_ARCH_ATOMIC is defined, the atomic_fetch_x
interface conflicts with the atomic_fetch_x interface in libcxx.
Therefore, it has been changed to a inline function.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-28 11:46:04 +08:00
hujun5
4627a087f0 fix compile error
chip/efm32_leserial.c: In function 'efm32_restoreuartint':
Error: chip/efm32_leserial.c:329:37: error: 'len' undeclared (first use in this function); did you mean 'ien'?
  329 |   efm32_restoreuartint_nolock(priv, len);
      |                                     ^~~
      |                                     ien

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-28 11:42:59 +08:00
Kyle Wilson
96fa400c3d Fixed errors in CI build tests for pull request #15351
There were two simple errors when running ci tests on pull #15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted.

imxrt_edma_s missing lock variable

CI build tests noted that the variable g_edma was referencing a lock variable that did not exist in the structure. This change adds that missing lock as a spinlock_t type.

Remove unused flags variable from imxrt_dmach_stop

Removed extra =
2024-12-28 11:14:42 +08:00