Commit graph

57502 commits

Author SHA1 Message Date
liuhongchao
6dbd355c1f nuttx: Support for the mouse ioctl interface
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
Matteo Golin
c15b900a88 sensors/sht4x: Converted SHT4X driver to UORB framework. 2025-01-17 09:08:21 +08:00
Tim Hardisty
acd7e44cad Add GD55 QSPI NOR Flash support 2025-01-17 09:07:22 +08:00
Matteo Golin
5de7e240af sensors/msxxxx-crc4: Modify CRC calculation so that it passes with MS5611. 2025-01-17 09:05:54 +08:00
chao an
67582acc14 sched/wqueue: fix potential deadlock
sched_unlock() should called after spin_unlock

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-17 09:05:37 +08:00
chao an
8877366c0e sched/wdog: remove wd_cancel_irq() implement
we do not need this implement after change the lock from csec to spin_lock

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-17 09:05:11 +08:00
Huang Qi
bac2df6bc8 risc-v: replace fence.i with __ISB for instruction sync
Summary:
- Replace direct use of `fence.i` instruction with `__ISB()` macro for instruction synchronization
- This change improves portability while maintaining the same functionality

Impact:
- No functional changes - both `fence.i` and `__ISB()` ensure instruction
synchronization on RISC-V
- Makes the code more maintainable by using the architecture abstraction
layer

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 09:04:45 +08:00
Huang Qi
56415a0275 libc/gnssutils: remove C99 standard flag from Make.defs
Summary:
- Removed explicit -std=c99 flag from Make.defs
- The project-wide C standard is already set at a higher level
- Keeps build configuration consistent across the codebase

Impact:
- No functional changes to the code
- Maintains consistency with project-wide C standard settings

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 09:03:18 +08:00
wangjianyu3
7cf82fe422 libs/lib_tempbuffer: set errno when fails
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-17 08:16:14 +08:00
stbenn
b561b4459b Add uid file needed for ethernet
copied over files, not modified properly yet

Squashing lots of define errors to get ethernet.c working

quick path rename

Fix STM32_EMAC_BASE (and ICACHE/DCACHE Bases). Enable ETH, ETHTX, and ETHRX with CONFIG_STM32H5_ETHMAC (like H7 does).

Fixed stm32_get_uniqueid

Previously, an exception occurred as a result of calling this function. The problem turned out to be this line: uniqueid[i] = *((uint8_t *)(STM32_SYSMEM_UID) + i);. Dereferencing a 32-bit register as a 8-bit register seemed to be causing this issue. I think this function is better anyway, fewer register accesses and loop iterations.

Turn on SBS peripheral when using Ethernet

The SBS peripheral is required to be turned on because the ETH_SEL_PHY bits need to be set. Without turning this on, RMII mode is not possible. MII may not work either.

Style Updates
2025-01-16 18:48:57 -03:00
chenrun1
118f827103 sim_hostfs:add host_errno_convert API for convert result
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:33:53 +08:00
Filipe Cavalcanti
027a57071a boards/xtensa: disable DEV_CONSOLE on usbnsh defconfig 2025-01-15 23:33:10 +08:00
chenrun1
0c97296f39 syslog_intbuffer:fix build warning
CC:  mqueue/msgsnd.c syslog/syslog_intbuffer.c: In function 'syslog_flush_internal':
syslog/syslog_intbuffer.c:99:14: warning: unused variable 'flags' [-Wunused-variable]
   99 |   irqstate_t flags;
      |              ^~~~~

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:30:00 +08:00
chenrun1
3b6f463ce2 syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario
Summary:
  When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:30:00 +08:00
Yanfeng Liu
ad7198069d arm/qemu: select PSCI at processor level
This moves ARM_HAVE_PSCI selection to virtual processor level as
armv7-r chips like Cortex-R5 doesn't have it.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-15 12:23:09 -03:00
chao an
dedb57cb2d libc/unistd: move NAME_MAX/LINE_MAX/PATH_MAX define to unistd
These options are unistd-specific and should not be filesystem dependent,
and also not suitable for define in the sched directory.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-15 23:17:51 +08:00
chao an
71a37b4f2d Documentation: clean up of CONFIG_NSH_LINELEN define
Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-15 23:17:51 +08:00
Pavel Pisa
46c3f354b3 drivers/can: ctucanfd the first round of fixes - mainly for char dev
Corrected CAN FD messages sending in character driver mode.
Assign CAN FD format flag in reception of CAN FD messages.
Corrected some defines mismatches.

The code has been tested in QEMU

qemu-system-x86_64 -m 2G -enable-kvm -smp 1 \
  -cpu host,+pcid,+x2apic,+tsc-deadline,+xsave,+rdrand \
  -kernel nuttx/nuttx \
  -nographic -serial mon:stdio \
  -object can-bus,id=canbus0-bus \
  -object can-host-socketcan,if=can0,canbus=canbus0-bus,id=canbus0-socketcan \
  -device ctucan_pci,canbus0=canbus0-bus,canbus1=canbus0-bus

The overall state of this third party CTU CAN FD driver in NuttX
is far from ideal. It would worth to consult and follow more
closely our Linux kernel driver and even better RTEMS CAN/CAN FD
stack design

  https://canbus.pages.fel.cvut.cz/#cancan-fd-subsystem-and-drivers-for-rtems

Signed-off-by: Pavel Pisa <pisa@fel.cvut.cz>
2025-01-15 13:47:04 +01:00
hujun5
61f0c97193 wqueue: wqueue remove csection
reason:
We decouple semcount from business logic
by using an independent counting variable,
which allows us to remove critical sections in many cases.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-15 17:26:07 +08:00
wangzhi16
e211904640 Use small lock to protect usbdev and endpoint in arch renesas.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-15 17:15:49 +08:00
wangzhi16
ac2b495945 Use small lock to protect usbdev and endpoint in arch mips
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-15 17:14:23 +08:00
hujun5
e908fb6d51 armv7a/r: fix regression from https://github.com/apache/nuttx/pull/14596
reason:
In kernel mode, sighand_test() may failed.
because nxsig_unmask_pendingsignal may change tcb->xcp.regs,and we should update return value(regs).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-15 17:13:29 +08:00
chenrun1
06540e7be1 fs_procfsproc:fix proc_heap to get kernel task info
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 17:12:50 +08:00
chenrun1
38c217bbfd fs_heap:add fs_heap_mallinfo_task
Summary:
  Added fs_heap_mallinfo_task implementation, which is used in proc_heap

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 17:12:50 +08:00
Jukka Laitinen
19fe41cb1b mm/kmap/kmm_map.c: Fix argument to gran_free
Fix a memory corruption & deadlocks while calling gran_free.

The function expects a GRAN_HANDLE as a paramter, not a pointer to it.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-15 17:10:57 +08:00
Jukka Laitinen
8d635ed0bf arch/arm64/src/common/arm64_addrenv_pgmap.c: Add normal region flags to kernel page mappings
In up_addrenv_kmap_pages, the MMU_MT_NORMAL_FLAGS are needed for the MMU
mappings in order for the memory & caches to function normally

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-15 17:10:57 +08:00
raiden00pl
0652cbf304 Documentation: update sensors documentation
update sensors documentation:

- add info about different sensor frameworks in one place
- fix headers style for sensors_uorb.rst: headers
- fix long lines for sensors_uorb.rst so it's possible to read this file in terminal IDE
- add code sections for sensors_uorb.rst

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-01-15 17:09:25 +08:00
wangzhi16
4558db18e4 Use small lock to protect usbdev and endpoint in sim.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-15 17:04:58 +08:00
Yanfeng Liu
95f11e02c1 arch/arm/qemu: select NEON at processor level
This moves ARM_HAVE_NEON from QEMU ARM family level down to the
processor level as not all processors have it (e.g. Cortex R5).

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-15 16:54:10 +08:00
raiden00pl
d9edc7c01a gitignore: add Emacs auto-save files
add Emacs auto-save files to gitignore

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-01-15 16:10:22 +08:00
raiden00pl
9a3fd90db9 nrf5340-dk/configs/qspi_cpuapp: remove temporary file added by accident
remove temporary emacs file added by accident

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-01-15 16:10:22 +08:00
dongjiuzhu1
500b55c330 Documentation: update uorb and sensor driver doc
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-01-15 08:57:57 +01:00
wangzhi16
007a3fffac Use small lock to protect usbdev and endpoint in AVR.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-15 10:05:16 +08:00
wangjianyu3
b629daf61c tools/refresh.sh: Add log for progress
Log

  $ ./tools/refresh.sh --silent --defaults arch:risc-v
  Normalizing all boards in arch: risc-v !
    [1/227] Normalize arty_a7/nsh
    [2/227] Normalize arty_a7/netnsh
    [3/227] Normalize arty_a7/knsh
    # ... ...

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-15 03:31:53 +08:00
wangjianyu3
aa24051628 boards: Refresh configurations with refresh.sh
With patch https://github.com/apache/nuttx/pull/15531

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-15 00:08:28 +08:00
wangjianyu3
f3b31ef1df boards: Replace CONFIG_NSH_LINELEN with CONFIG_LINE_MAX
Details: https://github.com/apache/nuttx-apps/pull/2943

1. find boards/ -name defconfig | xargs sed -i 's/CONFIG_NSH_LINELEN/CONFIG_LINE_MAX/g'
2. ./tools/refresh.sh --silent --defaults all

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-15 00:07:58 +08:00
Kyle Wilson
9701b0f660 Fix memory map for EMAC, ICACHE, and DCACHE.
It was dis overed during debug of the ethernet driver that the EMAC base was incorrect. After examination, it was determined that ICACHE and DCACHE also had incorrect base addresses. This commit fixes the base addresses according to the reference manual.
2025-01-15 00:07:43 +08:00
wangjianyu3
d014867766 tools/refresh.sh: Should continue to refresh other configs when matching debug configs
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-14 23:08:01 +08:00
Matteo Golin
36507cc7b2 drivers/sensors: Wrote a driver for the MCP9600 thermocouple amplifier. 2025-01-14 23:04:18 +08:00
chenrun1
cf66a1d5ce hostfs_open:return errno from host
Summary:
  Returns the error code returned directly by the host to avoid conversion to EBADF

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-14 23:03:20 +08:00
wangmingrong1
450b47fbb0 gcov.py: Add copy skip path, prevent recursion
When the copy path is a subdirectory of the source path, the copy will occur recursively

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-14 23:02:16 +08:00
Huang Qi
b1d97688b7 arch/risc-v: Remove riscv_mhartid
Summary:
This commit removes the riscv_mhartid function and replaces all its
usages with up_cpu_index. The functionality is consolidated into
up_cpu_index which provides a more consistent API for getting the
current CPU/hart ID across different execution modes (machine/supervisor).

Impact:
- Removes riscv_mhartid.S and its references from build systems
- Updates all arch-specific code to use up_cpu_index instead
- Adds more detailed documentation for up_cpu_index behavior
- Changes the implementation of up_cpu_index to use percpu scratch
register in supervisor mode

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-14 11:48:40 -03:00
Huang Qi
6e82ca3013 arch/risc-v: Decouple ARCH_RV_CPUID_MAP and up_cpu_index()
Summary:
- Separated CPU index functionality from CPU ID mapping configuration
- Moved CPU ID mapping functions to new riscv_cpuidmap.c file
- Made up_cpu_index() implementation dependent on ARCH_USE_S_MODE
- Updated build system to handle new file organization

Impact:
- Improves code organization by separating concerns between basic CPU index
functionality and advanced CPU ID mapping features
- Makes CPU index functionality available independently of CPU ID mapping
- Reduces conditional compilation complexity in header files
- Better aligns with RISC-V architecture modes (M-mode vs S-mode)

Testing:
GitHub CI and local testing

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-14 20:19:37 +08:00
YAMAMOTO Takashi
00010089b8 drivers/serial/serial.c: adapt to the iovec-based api
This would fix readv/writev issues mentioned in
https://github.com/apache/nuttx/pull/12674.
(only for this specific driver though. with this approach,
we basically have to fix every single drivers and
filesystems.)

Lightly tested on the serial console, using micropython REPL
on toywasm with esp32s3-devkit:toywasm, which used to be
suffered by the readv issue.
2025-01-14 20:18:21 +08:00
YAMAMOTO Takashi
30ad31e9d7 uio api tweaks
* Make readv/writev implementations update struct uio
  This can simplify partial result handling.

* change the error number on the overflow from EOVERFLOW to EINVAL
  to match NetBSD

* add a commented out uio_offset field. I used "#if 0" here as
  C comments can't nest.

* add a few helper functions

Note on uio_copyfrom/uio_copyto:
although i'm not quite happy with the "offset" functionality,
it's necessary to simplify the adaptation of some drivers like
drivers/serial/serial.c, which (ab)uses the user-supplied buffer
as a line-buffer.
2025-01-14 20:18:21 +08:00
YAMAMOTO Takashi
2749510413 Update a few comments after the recent readv/writev changes 2025-01-14 20:18:21 +08:00
anjiahao
cbb5e8fee2 modlib:gen-elf.ld.in DATA section need add CONFIG_MM_PGSIZE
arch/risc-v/src/common/riscv_addrenv.c:418:

{
...
  database = resvbase + MM_PGALIGNUP(resvsize);
...
}

need use MM_PGALIGNUP(resvsize) inside of ARCH_DATA_RESERVE_SIZE
if not add MM_PGALIGNUP(resvsize), will mismatch address load .data
section

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-01-14 20:13:28 +08:00
Yanfeng Liu
d385d9f7d2 arm/common: fix KERNEL build vfork
This fixes vfork test for kernel build, checked with qemu-armv7a:nsh
and qemu-armv7a:knsh

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-14 20:12:31 +08:00
chenrun1
b973bf3191 fs_procfs:Fix closedir should handle the release dir handle on a case-by-case basis
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-14 19:37:08 +08:00
YAMAMOTO Takashi
b88aba5ddc esp32s2: apply wifi deadlock fix from esp32s3
cf. https://github.com/apache/nuttx/pull/15445
2025-01-14 19:29:28 +08:00