Commit Graph

5312 Commits

Author SHA1 Message Date
Rbb666 46fdeefb32 refactor(pic): dispatch NVIC IRQs through traps 2026-08-12 12:54:50 +08:00
Rbb666 1f23e3f270 fix(dm): route Cortex-M resets through power core 2026-08-12 12:54:50 +08:00
Rbb666 f05fb1c076 fix(mm): exclude no-MMU ioremap from MMU builds 2026-08-12 12:54:50 +08:00
Rbb666 6b4f34204e feat(dm): support OFW on Cortex-M targets
Add the ARM NVIC PIC driver, no-MMU I/O mapping, built-in FDT support, and Cortex-M CPU hooks required by the native RT-Thread device model.
2026-08-12 12:54:50 +08:00
hanzhijian c00f13005b [lwip-dhcpd] Fix pbuf leak for oversized requests 2026-08-12 10:55:20 +08:00
GUI 9d04b6baab
[dm][clk] fixup the work flow of CLK (#11673)
* [dm][clk] fixup the work flow of CLK

Add RT_CLK_F_SET_RATE_NO_REPARENT so clock providers can preserv
the currently selected parent during rate changes.
Round and re-read the effective clock rate after parent handling,
skip redundant gate toggles and hardware programming when
the target is already active, and fix error handling for parent-clock allocation failures.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-08 18:25:02 +08:00
GUI a2c196d643
[dm][phye] Add Mode/State and MIPI D-PHY timing helper (#11675)
* [dm][phye] Add Mode/State and MIPI D-PHY timing helper

Extend the generic PHY framework with cached mode and submode state,
avoiding redundant hardware mode changes.
Add MIPI D-PHY default timing calculation helpers based on
pixel clock or lane high-speed clock, and expose the new API through rtdevice.h.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-07 21:31:43 +08:00
GUI c19fe2c823
[dm][regulator] Update Regulator (#11674)
* [dm][regulator] update regulator

Replace the regulator framework spinlock with a mutex
because regulator operations may sleep.
Move always-on policy into the regulator core,
keep an initial enable reference for always-on supplies,
prevent the last disable from turning them off,
and let fixed/GPIO providers report and control their actual hardware state.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* [dm][regulator] add PWM regulator support

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-07 21:29:33 +08:00
GUI 19e9be8779
[dm][ufs] fixup the ufs supported (#11646)
* [dm][block] add 4K support for EFI partion

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* [dm][ufs] fixup the linkup flow

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

* drivers: address UFS review feedback

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-07 16:54:29 +08:00
GuEe-GUI abc2c59e57 style: format code with clang-format 2026-08-07 09:26:42 +08:00
GuEe-GUI 871d9f5922 [dm][graphic] update graphic
1. Add FB_ACTIVATE_* cmd
2. Fixup the vsync
3. Update the graphic test

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-07 09:26:42 +08:00
GuEe-GUI 621a074a41 style: format code with clang-format 2026-08-07 09:25:45 +08:00
GuEe-GUI 83b703c6b6 [dm][ata] support DW AHCI
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-07 09:25:45 +08:00
GuEe-GUI 955fb76bb0 [dm][ivshmem] Add Inter-VM shared memory for virtualization
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 18:19:52 +08:00
angryproton 2f7a2299f6 [fix][dfs] 增加文件系统操作的类型检查,防止类型不匹配导致数据结构不一致引发的异常 2026-08-06 11:18:51 +08:00
GuEe-GUI 395dff4e2e [dm][misc] make RT_BITS_PER_LONG custom mode
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 11:14:28 +08:00
GuEe-GUI 96cf830d89 [dm][thermal] update the thermal cooling
1. Fixup the cooling control flow.
2. Replace the spinlock to mutex.
3. Fixup the PWM args for PWM-FAN.
4. Add GPIO-FAN

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 11:09:50 +08:00
GuEe-GUI 73614c8684 [dm][nvmem] fixup the DT parse for bits
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 11:09:43 +08:00
GuEe-GUI 69dfbf86fd [dm][nvme] replace the CPU physical address to DMA address
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 10:51:46 +08:00
GuEe-GUI c3e1dd7946 [dm][ethernet] add MACB and DWMAC ethernet support
They support PTP, too.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 09:43:10 +08:00
GuEe-GUI 84da9b9393 [dm][phy] improve PHY v2 support and add RTL8211F driver
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 09:43:10 +08:00
GuEe-GUI fae3992d14 [dm][ethernet] Add ethernet for DM
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-06 09:43:10 +08:00
GuEe-GUI 9915dc66c1 ipc: fix recursive data queue locking on SMP
rt_data_queue_pop() holds the data queue spinlock while updating the ring
state, then calls rt_data_queue_len(). The length function tries to acquire
the same non-recursive spinlock again, causing an SMP deadlock when a pop
leaves the queue non-empty.

Add a private _data_queue_len_nolock() helper for callers which already hold
the queue lock. Keep the public rt_data_queue_len() protected by one spinlock
acquisition.

This does not change the public API, ABI, queue state transitions, low-water
mark wakeups, or event callback behavior.

Tested on a four-core Spacemit K1 with cyclic HDMI playback and by building the
SMP QEMU Virt64 RISC-V BSP with generic audio, Intel HDA and VirtIO Sound.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-03 09:43:57 +08:00
GuEe-GUI fe751c1521 [dm][core] Add rt_bus_probe_device API
Add rt_bus_probe_device() to retry driver matching for a registered
but unbound device. Use it when an OFW-created platform device
is requested again, while preserving native-bus ownership
for I2C, SPI, and other non-platform devices.
Also instantiate eligible child platform devices after a parent node is registered.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-03 09:36:21 +08:00
Bernard Xiong 2b01936f11
components/dfs: unify vnode lock names 2026-07-31 15:13:53 +08:00
GuEe-GUI 36f52133ec [dm][i2c] port to the pinctrl for EP
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-07-29 11:11:10 +08:00
GuEe-GUI a7b0182817 [dm][tee] support Trusted Execution Environment (TEE)
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-07-27 17:53:20 +08:00
angryproton f19da943aa [fix][dfs] 修正 elmfat mkfs 中 f_mount 的错误传参 2026-07-23 11:57:10 +08:00
GuEe-GUI f975c7c4ca [dm][rpmsg] port the default RX handler for NS
Application traffic should be bound via a higher layer later.
And debug.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-07-23 09:27:29 +08:00
yi chen 4fbdf331d1 lwp: copy timeout into kernel space in sys_select()
sys_select() passed the raw user-space timeout pointer straight
through to select(), unlike readfds/writefds/exceptfds which are
all validated with lwp_user_accessable() and copied into kernel
memory first. A malicious or buggy user thread could pass a
timeout pointing at unmapped or otherwise invalid memory, which
select() would then dereference directly (timeout->tv_sec /
timeout->tv_usec) without any check, from kernel context.

Validate and copy it into a kernel-local struct timeval the same
way the fd_set arguments already are, before it reaches select().

Fixes #10298

Signed-off-by: yi chen <94xhn1@gmail.com>
2026-07-22 21:50:12 +08:00
mnikapl954 8e68826dc3 [drivers][adc] Fix misleading doxygen for rt_adc_voltage 2026-07-22 20:57:55 +08:00
mnikapl954 108a958a9d [drivers][dac] Fix wrong rt_dac_write arguments in doxygen example 2026-07-22 19:59:36 +08:00
CYFS 25212f3745 fix: name anonymous Kconfig choices 2026-07-20 13:05:46 +08:00
GuEe-GUI c22b3931b6 [pic][gicv3-its] fixup cleanup path removes list node after freeing it
Link: https://github.com/RT-Thread/rt-thread/issues/11604

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-07-20 11:36:37 +08:00
angryproton 560fa880ff [fix][tmpfs]修正 getdents 中文件类型错误的判断变量 2026-07-20 10:18:14 +08:00
Old-Ding b6cdae57d4 net: lwip: fix mDNS test buffer fill size
Fill the mDNS domain name buffers with their array size instead of the size of the MDNS_DOMAIN_MAXLEN constant. This preserves the test intent of leaving different trailing bytes after equal names are encoded.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-20 09:39:17 +08:00
CYFS 5363e4ed4c [bsp][drivers][soft_spi] unify the software SPI driver 2026-07-17 09:41:51 +08:00
CYFS 414ff7f371 [bsp][drivers][soft_i2c] unify the software I2C driver 2026-07-16 13:19:57 +08:00
angryproton 997de9433a [fix][dfs] elmfat磁盘操作设备指针判空 2026-07-15 16:42:15 +08:00
Onlyou_tzZ f8a65e4092
sb_glue_nation.c中添加N32H49X和N32H7XX系列MCU的USBHS支持 2026-07-14 18:08:59 +08:00
Cheng Mingming 6c5378a1b0 [finsh][cmd] Merge duplicate RT_USING_CPU_USAGE_TRACER blocks in list_thread
The RT_USING_CPU_USAGE_TRACER print block was duplicated identically in
both the ARCH_CPU_STACK_GROWS_UPWARD and the normal branch of
list_thread(). Both branches only differ in the stack usage line (which
has no trailing newline), so move the single shared block after the
#endif of the stack-growth conditional. No functional change.
2026-07-14 09:33:50 +08:00
与非熊 63b4a7fcc2 [chg][dfs]Clean up comments in dfs_elm_free_vnode
Removed unnecessary comments from dfs_elm_free_vnode function.
2026-07-13 10:54:07 +08:00
angryproton cf1c12ee06 [fix][dfs_elm] 修复关闭目录和释放vnode时的资源泄露 2026-07-13 10:54:07 +08:00
angryproton 5af8b0af64 [fix][dfs] 修复elmfat挂载失败时的内存泄漏 2026-07-13 09:01:43 +08:00
Old-Ding c7f21bddeb drivers: pci: Fix endpoint MSI setup
rt_pci_ep_set_msi() checked the set_msix callback before calling set_msi. That rejects endpoint controllers that implement MSI without MSI-X, and can call through a NULL set_msi pointer when only MSI-X is provided.

The same helper converts a requested MSI vector count into the log2 field passed to the controller. Stop after the first value large enough for the request so smaller requests are not widened by later loop iterations.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-08 14:03:38 +08:00
Old-Ding 3eac0a8a17 drivers: pic: Fix PIRQ lookup upper bound
rt_pic_linear_irq() stores irq_nr as a count and assigns pic->pirqs to the first entry in that range. rt_pic_find_pirq() therefore must treat the upper bound as exclusive.

The inclusive check could return pic->pirqs[irq_nr] when irq equals irq_start + irq_nr, which is one entry past the allocated range.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-08 14:03:16 +08:00
Old-Ding d2d89271ea drivers: fix fan53555 slew rate bounds check
Valid slew_rates indices are 0 through RT_ARRAY_SIZE(slew_rates) - 1.
The current check rejects only values greater than the table size,
allowing slew_idx == RT_ARRAY_SIZE(slew_rates) to index one element
past the table.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-08 14:02:15 +08:00
Old-Ding 221502ade0 components: finsh: check token bounds before access
Move the command length checks before reading command buffers while parsing module, script, and LWP command names. This keeps commands without separators from reading one byte past the provided length.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-08 13:37:21 +08:00
Old-Ding b9550aad85 drivers: dac: Fix disable callback check
_dac_control() checked the enabled callback before invoking disabled for RT_DAC_CMD_DISABLE. That can reject DAC drivers that provide a disable callback without enable, and can call through a NULL disabled callback when only enable is implemented.

Check the disabled callback in the disable command path so the guard matches the operation being dispatched.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-08 13:24:42 +08:00
Old-Ding 50c6853d38 rt-link: reject frame offset at frame limit
The receive sequence filter maps incoming data-frame sequence numbers to zero-based frame offsets. RT_LINK_FRAMES_MAX is the maximum number of split frames, so valid offsets are 0 through RT_LINK_FRAMES_MAX - 1.

Reject offset == RT_LINK_FRAMES_MAX before frame handling instead of letting it reach long-frame assembly.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-07 19:55:21 +08:00