Commit Graph

1834 Commits

Author SHA1 Message Date
lhxj
7641ef6885 [drivers] Fix OFW bus conflict and prevent duplicate device creation
Problem:
When enumerating device tree nodes, platform bus and native buses (I2C/SPI)
may create duplicate devices for the same OFW node, causing cross-bus conflicts.
This triggers assertion failure '(dev->bus != new_bus)' in
rt_bus_reload_driver_device() during boot on minimal DM-enabled systems.

Root Cause:
1. Platform bus tries to reload devices that already belong to other buses
   by calling rt_bus_reload_driver_device(dev->bus, dev), which violates
   the API contract (requires dev->bus != new_bus).
2. Native buses (I2C/SPI) do not mark OFW nodes as occupied, so platform
   bus creates duplicate platform devices for I2C/SPI client nodes.

Solution:
1. components/drivers/core/platform_ofw.c: Return RT_EOK when np->dev exists,
   letting the native bus handle device lifecycle instead of cross-bus reload.
2. components/drivers/i2c/dev_i2c_bus.c: Mark i2c_client_np->dev during scan
   to prevent platform bus from duplicating I2C client devices.
3. components/drivers/spi/dev_spi_bus.c: Mark spi_dev_np->dev during scan
   to prevent platform bus from duplicating SPI devices.

Tested on Spacemit K1 RISC-V platform with minimal DM configuration.

Signed-off-by: lhxj <2743257167@qq.com>
2026-01-20 22:05:28 +08:00
AngryProton
f4566f14dc [drivers/blk] 解决块设备写入不对齐数据失败的问题 #11103 2026-01-12 17:14:59 +08:00
Runcheng Lu
17d026c6cc [fix] drivers: spi: refactor SPI bit operations into independent configuration
- Add RT_USING_SPI_BITOPS as a separate configurable option
- Make RT_USING_SOFT_SPI depend on RT_USING_SPI_BITOPS
- Adjust build order in SConscript for proper com

Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
2026-01-04 17:04:34 +08:00
Copilot
7c05661ae9 [virtio] Fix queue_sel ordering in virtio_queue_init and virtio_queue_destroy #11114 2026-01-04 16:55:19 +08:00
GUI
c6498b5f65 [sdio][dm] update for DM (#11078)
* [sdio][dm] import Kconfig for DM

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

* [sdio] fixup IRQ and mmcsd threads' stack size default

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

* [sdio][dm] Support DM mode

1. Support features read by DM.
2. Support regulator API in drivers.
3. Support send tuning option CMD.
4. Replace `switch_uhs_voltage` by `signal_voltage_switch`.

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

* [dm][sdhci] Cleanup the SDHCI

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

* [sdio][dm] add new SDIO/SDHCI drivers

1. SDHCI support on PCI bus
2. Synopsys DesignWare MMC Family(MMIO/PCI)

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

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-26 21:04:42 +08:00
GuEe-GUI
9370f81ad7 [dm][include] fixup loss' header
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-22 13:24:41 +08:00
GUI
43733268c1 [dm][firmware][scmi] support ARM-SCMI interface #11069 2025-12-19 21:20:17 +08:00
GuEe-GUI
df990e91d3 [dm][power] add new drivers for power framework
1. GPIO poweroff/restart
2. Generic SYSCON regmap poweroff/reboot mode/reboot
3. Emulator battery(thermal)/charger
4. GPIO charger

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-17 10:29:05 +08:00
GuEe-GUI
b4d332706e [dm][power] add power reset and supply framework
1. Board level reset or poweroff
2. Power supply class

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-17 10:29:05 +08:00
GuEe-GUI
9a6d515e27 [dm][serial] add new serial driver for DM
1. 8250 serila family (OFW, PCI, DWC, early)
2. Virtual serial (by graphic and input)
3. HVC early serial
4. ARM PL011 serial

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-16 12:41:02 +08:00
GuEe-GUI
6394797471 [dm][serial] Fixup serial tty check
Just return if is not a tty device, don't assert

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-16 12:41:02 +08:00
GuEe-GUI
cb808f3a0e [dm][serial] replace rt_hw_atomic_add to rt_atomic_add, clean code
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-16 12:41:02 +08:00
GuEe-GUI
32bdc73a11 [dm][serial] make DM Kconfig import
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-16 12:41:02 +08:00
GuEe-GUI
e83a6e9baa [dm][scsi] Add parallel_io option for SCSI host
Some SCSI supported parallel_io = RT_TRUE, like UFS.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-16 11:39:41 +08:00
GuEe-GUI
4913211409 [dm][core] add common machine power interface
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-16 11:35:35 +08:00
GuEe-GUI
27eb7c4f72 [dm][graphic] add new drivers and logo
1. Generic GPIO based backlight driver
2. Generic PWM based backlight driver
3. Simple framebuffer support
4. Standard 224-color RT-Thread logo
5. Standard 224-color RT-Thread white logo

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-15 16:54:23 +08:00
GuEe-GUI
5abecc1fd0 [dm][graphic] support dm mode
1. Add backlight framework for graphic.
2. Add framebuffer and plane, power, EDID for graphic framework
3. Add boot logo render for graphic
4. Update lcd.h

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-15 16:54:23 +08:00
GuEe-GUI
cbf3f8c3b4 [dm][core] Update the OFW CLk init flow
The clock should init before common platform devices.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-13 16:35:32 +08:00
GUI
1b4111a99e [dm][pinctrl] Set pinctrl default auto in platform bus. (#11052)
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-13 16:33:05 +08:00
GUI
d8709ba9fb [dm][hwcache] support hwcache (#11049)
Some ARCH not has std cache ops, such as RISC-V

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-13 16:32:25 +08:00
GuEe-GUI
af0e513bef [dm][pmdomain] make DM Kconfig import
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-13 16:30:04 +08:00
GuEe-GUI
6270b2f97c [dm][core] Set default CLK config for platform device probe
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-12 13:33:28 +08:00
GuEe-GUI
335a1242b0 [dm][clk] refactoring the CLK framework
The old CLK is can't link all hardware clock cell in system that the
API of layout such as 'set_parent' can't work as expected.

Some hareware clock cell need some flags to prevent some dangerous behaviors, eg:
When a clock cell is link to the PMU, the SoC will power-down if the cell is
disable.

The new CLK can do it, and make the CLK drivers implemented easier from
TRM/DataSheet.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-12 13:33:28 +08:00
Fan Yang
d6b173be4b fix:[components][drivers][sdio] fix the sequence of switching to emmc high-speed ddr mode #11037 2025-12-11 19:25:29 +08:00
GuEe-GUI
dd20176cba [dm][hwspinlock] support hwspinlock
Hardware spinlock modules provide hardware assistance for
synchronization and mutual exclusion between heterogeneous processors
and those not operating under a single, shared operating system.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-11 11:08:33 +08:00
Chuan
d76356b94e [utest][smp_call]:Add standardized documentation for SMP Call Smoke Test (#11014) 2025-12-11 11:06:57 +08:00
GUI
f39a86266a [drivers][ofw] Update OFW #11004
Fixup fdt address reg and cells parse.
Support only option name way for earlycon.
Find the console device when using "stdout-path".
2025-12-11 11:05:47 +08:00
Chuan
5f9984fa5e [utest][smp_call]:fix initialize current_mask in _wait_for_update 2025-12-10 17:05:10 +08:00
GuEe-GUI
22a77f2694 [dm][nvmem] support nvmem
Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-10 17:04:23 +08:00
GUI
e465ec567d [dm][rtc] update rtc and new drivers (#11033)
* [dd][rtc] set the RTC alarm thread stack size default.

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

* [dm][rtc] make Kconfig import for DM

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

* [dm][rtc] support DM API for RTC

1. rtc_dev_set_name for RTC device init the name auto.
2. rtc_wkalarm_to_timestamp and rtc_timestamp_to_wkalarm for
   rt_rtc_wkalarm/time_t convert.

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

* [dm][rtc] add new drivers

1. Dallas/Maxim DS1302
2. Dallas/Maxim DS1307/37/38/39/40, ST M41T11
3. Goldfish Real Time Clock
4. Haoyu Microelectronics HYM8563
5. NXP PCF8523
6. Philips PCF8563/Epson RTC8564
7. ARM PL031
8. Epson RX8010SJ

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

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-10 17:03:20 +08:00
GUI
3ff3fc3948 [dm][input] support input #11031 2025-12-10 16:58:10 +08:00
GuEe-GUI
357c9b7b5a [dm][pin][pinctrl] add new driver
1. ARM PL061 GPIO
2. Single Pinctrl

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-10 16:53:09 +08:00
GuEe-GUI
b5ea9220be [dm][pin] fixup the DM Kconfig import in DM mode only
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-10 16:53:09 +08:00
GuEe-GUI
6c0753cb8f [dm][pinctrl] new interface for 'pin_gpio_request'
Some GPIO should apply GPIO mode by pinctrl, add `pin_ctrl_gpio_request`
for GPIO driver to apply it auto.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-10 16:53:09 +08:00
GuEe-GUI
44c1cf8d1e [DM][HWTIMER] Enable arm arch timer more API for cpuidle in the future
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 21:07:14 +08:00
GuEe-GUI
0aca985525 [DM][HWTIMER] Make Kconfig import for DM
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 21:07:14 +08:00
GuEe-GUI
056ae364cb [dm][core] add new API for DM
1. rt_dm_dev_is_big_endian
2. rt_dm_dev_get_prop_fuzzy_name

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 21:04:16 +08:00
GuEe-GUI
c857e03544 [dm][core] fixup the rt_dm_dev_prop_read_u8_array_index OFW check
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 21:04:16 +08:00
GuEe-GUI
7357abdc37 [dm][core] cleanup format
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 21:04:16 +08:00
GuEe-GUI
c74148a8b3 [dm][core] add common stack size for DM
DM driver is public, they don't know the size of the thread stack default.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 21:04:16 +08:00
GUI
944b974c1a [DM][PIC] Fix #10998 (#11024)
* [DM/PIC] Fixup SMP CPU mask list when CPU < 4

* [DM][PIC] Fix #10998

The size of cpumask is `RT_CPUS_NR`, memset force to space will
overflow in stack.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 14:33:31 +08:00
GUI
b949618f20 [DM][LED] Update LED#11007
* [DM][LED] Fixup LED check status string match
* [DM][LED] Update LED blink cycle to heartbeat
* [DM][LED] Fixup gpio-led memory alloc to zero
* [DM][LED] Update LED common drivers
2025-12-09 13:58:43 +08:00
GuEe-GUI
b28d540cfd [DM][HWCRYPTO] Make Kconfig import for DM
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 09:49:34 +08:00
GUI
6618fa1cf6 [Driver][MISC] Update ADC/PWM (#11003)
* [DM][MISC] Make Kconfig(ADC/PWM) import for DM

* [Driver][MISC][ADC] Fixup ADC

1. Fixup error no.
2. Fixup type of control for args.
3. Fixup value no init.

* [Driver][MISC][PWM] Enable `rt_pwm_get` API

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-09 09:49:02 +08:00
GuEe-GUI
cd1d47b87c [DM][MTD] Add common MTD drivers
1. CFI-Nor flash DM driver.
2. SPI-Nor flash DM driver.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-08 17:06:12 +08:00
GuEe-GUI
065338dc69 [DM][MTD] Set MTD config to menuconfig
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-08 17:06:12 +08:00
GuEe-GUI
09b6099701 [DM/PHYE] Support USB generic PHYE.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-08 17:00:08 +08:00
GuEe-GUI
a890e62e64 [DM/PIC] Fixup SMP CPU mask list when CPU < 4
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-07 23:00:18 +08:00
GuEe-GUI
2995112bee [DM/MFD] Add QEMU EDU for PCI study
EDU Support DMA (lower 32 bits) and factorial, MSI-X, user can change device or driver
to study PCI.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-07 22:58:09 +08:00
GuEe-GUI
c9b8cb5897 [DM/MFDD] Make Kconfig import for DM
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-12-07 22:58:09 +08:00