Commit Graph

59790 Commits

Author SHA1 Message Date
zhanghongyu
aa8ffea3cf netdev_upperhalf: convert Kconfig to variable
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Upperhalf supports multiple working modes at the same time,
which is specified by NIC when register

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-14 10:01:22 +08:00
zhanghongyu
84895c8e70 Revert "e1000: add polling mode support for tx/rx"
Remove the previously supported polling mode. If necessary in the
future, switch to a new solution for implementation.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-14 10:01:22 +08:00
Justin Erenkrantz
d98e7a7b68 risc-v/litex: For vexriscv, point docs at linux CPU variant instead of secure.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The secure CPU variant of vexriscv immediately panics after bring up.

However, the linux CPU variant of the vexriscv core does work successfully.

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
2025-12-13 18:14:21 -03:00
Michal Lenc
977f9ed4b8 libs/libc/obstack/lib_obstack_free.c: fix object check within chunk
The original condition incorrectly used &h->chunk instead of
h->chunk in the calculation whether the object is in the chunk. This
could lead to the wrong behavior as the first branch gave incorrect
result and thus sometimes the entire obstack was freed even though
object was not NULL.

The commit also simplifies the logic, we can use pointer arithmetic
here and just do h->chunk + 1 as it gives the same result as
(FAR char *)h->chunk + sizeof(struct _obstack_chunk). This saves
unnecessary cast and sizeof.

The second branch should be less than or equal, not just less than.
This ensures the object is correctly located in the chunk even after
previous obstack_finish was called.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Karel Kočí <kkoci@elektroline.cz>
2025-12-13 18:13:19 -03:00
yangsong8
67584d9981 codespell-ignore: Ignore variable name sems
Ignore variable name sems

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8
69cac3bd3a driver/usbdev: Fix usbtrace lock unpaired issue
Fix usbtrace lock unpaired issue

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8
444293e3b5 drivers/usbdev: Use small lock to protect usbdev trace
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8
35a89be950 drivers/usbdev: Use small lock to protect usbdev msc
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8
4d319c6816 driver/usbdev: Use small lock to protect usbdev fs
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8
a1f5c269d7 driver/usbdev: Use small lock to protect composite device
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
Jiri Vlasak
f93a1b34e5 eeprom/spi_xx25xx: Add IOCTL to set Block Protect
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Add IOCTL to set Block Protect, because we need a way to set Block
Protect of an EEPROM.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2025-12-13 13:33:48 +08:00
chenxiaoyi
43405d34c4 Documentation: update the gprof usage
Update the usage part to demostrate two easily accessible environments,
one QEMU and one real board.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-13 13:31:46 +08:00
chenxiaoyi
0d757d0134 libc/machine/xtensa: add mcount implementation for gprof
Add the implementation of _mcount() to meet the requirements of gprof.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-13 13:31:46 +08:00
yangsong8
f2191a7e3b drivers/usbhost: fix build waring
usbhost/usbhost_hidkbd.c:1373:14: warning: unused variable ‘flags’ [-Wunused-variable]
 1373 |   irqstate_t flags;
      |              ^~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 13:03:52 +08:00
yangsong8
2660df6581 drivers/usbhost: use small lock to protect usbhost kbd
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 13:03:52 +08:00
yangsong8
25ec00c67c drivers/usbhost: improve usbhost hid kbd code
By passing parameters to the kthread_create process, reduce the global
variables and nxmutex lock.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 13:03:52 +08:00
yangsong8
a7af894cd3 driver/usbhost: use small lock to protect usbhost cdcmbim
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8
23cec99002 drivers/usbhost: use small lock to protect usbhost cdcacm
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8
62f7a8fa22 drivers/usbhost: use small lock to protect usbhost bthci
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8
5571ec8fa2 drivers/usbhost: use small lock to protect usbhost msc
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8
b9b62a9204 drivers/usbhost: Use small lock to protect usbhost common function
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
Justin Erenkrantz
52d5aeb60c risc-v/litex: Add a vexriscv and vexriscv_smp section to arty_a7 doc.
risc-v/litex: For vexriscv_smp, explicitly document requirement for C ISA ext.

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
2025-12-13 11:46:14 +08:00
Junbo Zheng
53edfb5815 sched/misc: correct coredump log format
since it has been replaced with
https://github.com/apache/nuttx/blob/master/sched/misc/coredump.c#L763
and `nput` map to `off_t` https://github.com/apache/nuttx/blob/master/include/nuttx/streams.h#L98

align with other prints, reference:
- https://github.com/apache/nuttx/blob/master/drivers/misc/rwbuffer.c#L1121
- https://github.com/apache/nuttx/blob/master/fs/mmap/fs_rammap.c#L84
- https://github.com/apache/nuttx/blob/master/libs/libc/elf/elf_read.c#L85

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2025-12-12 14:54:05 +01:00
yezhonghui
ceeeb73bd9 rpmsgdev: fix export null issue when rpmsgdev init
check rpmsgdev export null or not

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-12 17:48:43 +08:00
yezhonghui
806c881595 rpmsgdev: fix rpmsg dev server name too long issue
rpmsgdev name too long, we can use prefix and key info

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-12 17:48:43 +08:00
rongyichang
0b544d3359 drivers/rpmsg: add slash check for sepical rpmsg dev
rpmsgdev match name too long, so add prefix

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-12-12 17:48:43 +08:00
liaoao
ea1e38ef92 rpmsgdev_server: use a separate workqueue to process poll
it will block other works of the list of hpwork when it waits to get buffer for too long. so use a separate workqueue for rpmsgdev.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2025-12-12 17:48:43 +08:00
yezhonghui
582415318a rpmsgdev: destroy distinguish active and passive
rpmsgdev server will not destroy if client reboot

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-12 17:48:43 +08:00
wangchengdong
273578f658 sched/clock: Remove unnecessary preprocessor definition
Remove an unnecessary preprocessor definition in clock_systime_ticks.c.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-12 12:31:16 +08:00
yangsong8
3a76917058 sim/usbdev: Process all pending data at once
After processing a packet of data, do not exit interrupt, but continues
to check whether there is data to be processed. If there is, continue
processing.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
ligd
6736558d10 sim_usb: fix host function caused up_interrupt_context() failed
use host_uninterruptible to protect some system functions

Signed-off-by: ligd <liguiding1@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8
8bf88945ce sim/usbdev: Supports registering multiple USB devices on a same host
when start multiple sim, the host refuses to recognize multiple USB
devices, and the prompt message is as follows:
[365652.175289] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[365652.175304] misc raw-gadget: fail, usb_gadget_probe_driver returned -16

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8
3a0d2cbd41 sim_usb: fix dev function caused up_interrupt_context() failed
use host_uninterruptible to protect some system functions.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8
ae39301416 drivers/usbdev: not use wd timer when zero copy in cdcacm
When using the serial framework buffer, if the buffer is full, excess
data is cached in the usb req buffer. The CDCACM driver doesn't know
when the upper layer will read data from the serial buffer, so it
needs to periodically check if the cached data can be put into the
serial buffer. However, when using zero-copy, each usb req buffer
needs to be completely read before actively switching to the next
req buffer, so the timer is not needed to assist to query.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
04fbce9d40 driver/usbdev: fix cdcacm wr container missing issue
in cdcacm_sndpacket, If `if (priv->wrcontainer)` is true, then
`priv->wrcontainer` is set to NULL. If an interrupt occurs before
`priv->wrcontainer` is reassigned after being NULL,
`priv->wrcontainer` will be reassigned once during the interrupt,
and `nwrq--` will be called, but no data will be sent at this time.
Only when data is sent by calling `txint` will `priv->wrcontainer`
be reassigned and `nwrq--` called again. This causes the issue.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
10180ab4eb drivers/usb: use lock to protect reqbuf when cdcacm unbind
When CONFIG_CDCACM_DISABLE_TXBUF is enabled, if the USB is
unplugged during serial data transmission, it is possible
that cdcacm will enter the unbind process, and reqbuf will
be released, causing a crash during serial write.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
a53223741e drivers/usbdev: fix usb cdcacm build warning
usbdev/cdcacm.c:371:11: warning: implicit declaration of function 'spin_lock_irqsave' [-Wimplicit-function-declaration]
  371 |   flags = spin_lock_irqsave(&priv->lock);
      |           ^~~~~~~~~~~~~~~~~
usbdev/cdcacm.c:375:3: warning: implicit declaration of function 'spin_unlock_irqrestore' [-Wimplicit-function-declaration]
  375 |   spin_unlock_irqrestore(&priv->lock, flags);
      |   ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
d2daf66d38 drivers/usbdev/cdcacm: Fix the issue of missing release one req buf
When unbinding, if a req buf is held by priv->container, it also
needs to be released.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
cc067ab199 drivers/usbdev/cdcacm.c: Use small lock to protect cdcacm
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
fe293ec9b5 drivers/usbdev/cdcacm.c: fix check priv->nwrq issue
When enable CONFIG_CDCACM_DISABLE_TXBUF, dev->xmit.buffer always
take one req, so just compare CONFIG_CDCACM_NWRREQS - 1.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
e78e152cc7 drivers/usbdev/cdcacm.c: fix runtime error memcpy para is null
usbdev/cdcacm.c:2974:3: runtime error: null pointer passed as argument 2, which is declared to never be null
    #0 0x44716307 in cdcuart_dmasend usbdev/cdcacm.c:2974

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
dd5a2662ac cdcacm: check present bit
When close the serial tool in PC, only the persent bit is cleared
on Windows but all bits are cleared on linux.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8
b3758a1df0 compiler: redefine float and double when disable float compiling
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Redefine float and double on devices that do not support floating-point.
float  ==> int
double ==> long

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 02:33:49 +08:00
ligd
452557a249 binfmt: Fix error handling in exec_module
Remove an extra return statement in exec_module failure path,
ensuring proper cleanup when errors occurs.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2025-12-11 12:57:07 -05:00
ligd
eb65ea5612 env: Always call env_release in group_release
Remove unnecessary #ifdef CONFIG_DISABLE_ENVIRON.
This makes sure environment resources are always cleaned up,
regardless of configuration.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2025-12-11 12:57:07 -05:00
zhengyu16
dd76bf54d1 Documentation: add '-f' description for umount command
Reference:
https://github.com/apache/nuttx-apps/pull/3240

Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
2025-12-11 12:13:58 -05:00
wangchengdong
e2703c3f4a arm/stm32: Disable NSH help to fix build issue
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Disable NSH help in nucleo-f302r8/ihm07m1_b16 to resolve a build
failure caused by insufficient memory.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-11 20:07:00 +08:00
wangchengdong
23733e7642 sched/clock: Fix missing clock_inittime() call
The current implementation only calls
  clock_inittime() when RTC is enabled,
  which causes it to be skipped on other
  architectures. This patch ensures
  clock_inittime() is invoked during clock
  initialization for all cases.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-11 20:07:00 +08:00
Filipe Cavalcanti
37521ebf1d documentation: update flash encryption docs for Espressif devices
Adds new subsection under MCUBoot regarding use of flash encryption.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-11 11:29:26 +01:00
Filipe Cavalcanti
49d6177c68 espressif: automate build system for flash enc
Modifies Kconfig and build tools to support flash encryption
and E-Fuse burning when flash encryption is enabled.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-11 11:29:26 +01:00