Add components.drivers.watchdog.smoke covering device find/open and
timeout set/get. Optional start/keepalive/stop stays off by default
to avoid board reset when STOP is unsupported.
Co-Authored-By: Grok <seteiro@mail.grokbot.com>
* [DM/PCI] Validate MSI-X table BIR and offset against BAR
BIR and the table offset in the MSI-X capability are controlled by the
device. msix_table_remap() used BIR directly as an index into
pdev->resource[] and never checked the table against the BAR size, so a
malicious device could make the kernel map and write to an arbitrary
physical address during probe.
Reject out-of-range BIR values, unassigned or zero-sized BARs, and
tables that do not fit completely inside the assigned BAR. Also verify
that the requested vector count does not exceed the table size read
from the MSI-X control register.
Fixes#11985
* [DM/PCI] Fix cppcheck warnings in MSI-X code
- Restore the default IRQ only when an MSI descriptor exists, avoiding
a potential NULL pointer dereference in rt_pci_msi_shutdown
- Initialize the error code in msix_setup_msi_descs so that an empty
vector list returns a defined value
is_pte_valid() accepted a GPT entry as long as both LBAs were inside the
disk, so a crafted image could set ending_lba < starting_lba. The size
computed in efi_partition() then underflowed to a huge value and was
registered as the logical partition size.
Reject entries whose end LBA is below the start LBA, and compute the
partition start/size only after the entry passed validation. This avoids
evaluating the underflow at all and reuses the validated start value for
the size calculation.
FixesRT-Thread/rt-thread#11271.
Co-authored-by: DeepSeek 4.1 Flash <noreply@deepseek.com>
- register SCMI reset and power-domain drivers during subsystem initialization
- resolve SCMI reset state through the reset-controller provider
- use the parsed DT reset domain ID when querying reset attributes
- retain the SCMI device reference in the reset provider instance
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* lwp: fix pid leak on exec failure before task startup
When msh tries to execute a non-ELF path, lwp_execve() may allocate a PID
before lwp_load() fails. The old error path only dropped the LWP reference,
leaving the PID tree entry pointing to a freed LWP.
In an init-less boot flow, this can poison pid 1 after a failed command from
msh. A later LWP launch may then treat the stale pid 1 entry as a valid parent
LWP, resulting in invalid pgrp/session state and a job-control assertion during
process exit.
Add lwp_pid_rollback() for exec/spawn failures before the process becomes
runnable. Unlike lwp_pid_put(), it always releases the PID lock and does not
enter the "no more pid allocation" state when the PID tree becomes empty.
Use the rollback helper in lwp_execve() failure paths after PID allocation.
Signed-off-by: zhangyang <gaoshanliukou@163.com>
* [drivers][sdio] avoid SDHCI device name stack overflow
rt_sdhci_init_host() allocated a fixed 32-byte buffer for device-derived object names, but sdio_host_set_name() may copy up to RT_NAME_MAX bytes into the output buffer. When RT_NAME_MAX is larger than 32, this can overwrite the stack and corrupt nearby locals.
Size the temporary name buffer with RT_NAME_MAX, force it to be NUL-terminated, and derive the append offset from the actual string length. Also replace the suffix rt_sprintf() calls with bounded rt_snprintf() so timer and workqueue suffixes cannot overflow the buffer when the base name is already close to RT_NAME_MAX.
Signed-off-by: zhangyangysu <zhangyangysu0928@gmail.com>
---------
Signed-off-by: zhangyang <gaoshanliukou@163.com>
Signed-off-by: zhangyangysu <zhangyangysu0928@gmail.com>
Co-authored-by: yang.zhang <zhangyang01@kylinos.cn>
- read reg-shift and reg-io-width from the device tree
- select the MMIO access width from reg-io-width
- reject unsupported register widths during early setup
- keep the generic 8250 path for other compatibles
rt_console_set_device() is typically called in rt_hw_board_init() right
after rt_components_board_init(). null was INIT_DEVICE (level 3), so it
was not registered yet and could not be RT_CONSOLE_DEVICE_NAME.
Raise to INIT_BOARD_EXPORT; null is a pure software sink with no HW deps.
Co-Authored-By: Grok <seteiro@mail.grokbot.com>
The touch framework has no private headers in its source directory, so
adding the directory to CPPPATH is unnecessary. Remove it to avoid
polluting the global header search path, as discussed in #10980.
* [libcpu][risc-v] Refactor the RISC-V architecture port
Introduce an opt-in unified RISC-V common layer for RV32 and RV64 while keeping existing BSPs on the legacy implementation during migration.
- use ARCH_RISCV and ARCH_CPU_64BIT for architecture and XLEN selection
- unify context, trap, MMU, cache, timer, SBI, SMP and ISA handling
- add PLIC, CLIC, ACLINT, APLIC and IMSIC support
- map physical hart IDs to contiguous logical CPU IDs
- add T-Head vendor overrides while preserving legacy ports
- migrate qemu-virt64-riscv with RV32 and RV64 support
- update clock_time, MM, LWP, OFW, PCI and Rust integration
Existing BSPs continue using legacy_common or common64 unless they select RT_USING_RISCV_NEW_COMMON.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [libcpu][risc-v] skip disabled CPU nodes in early FDT walk
Rbb666 noted that rt_hw_fdt_install_early() walked every /cpus child
without checking status, so disabled cores still joined hart registration
and MMU capability probing. Skip nodes that are not okay/ok via
rt_fdt_device_is_available() before reading reg or mmu-type.
Signed-off-by: seteiro <chenmoushun@163.com>
* [libcpu][risc-v] Fix per-CPU page table mapping
- reuse existing non-leaf page table entries when mapping per-CPU areas
- reject leaf entry conflicts instead of overwriting mappings
Signed-off-by: GuEe-GUI <2991707448@qq.com>
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>
Signed-off-by: seteiro <chenmoushun@163.com>
Co-authored-by: seteiro <chenmoushun@163.com>
The '#define assert ASSERT' in ulog_def.h conflicts with the 'assert'
used in reset.c (rstc->rstcer->ops->assert), causing unintended macro expansion.
Signed-off-by: Jiang Yu <yu.jiang@rock-chips.com>
Fix format specifier mismatches in blk_partition.c by using the
appropriate integer formats and explicit casts.
This removes -Wformat warnings on platforms where rt_uint32_t and
rt_size_t are represented as unsigned long.
- reorganize common Raspberry Pi drivers under the device framework
- add the Raspberry Pi 5 BSP, configuration and documentation
- add BCM2712 and DesignWare AXI DMA controller support
- distinguish BCM2712 DMA32 and DMA40 channels by channel mask
- restore DesignWare AXI DMA enable bits after controller reset
- support a shared AXI maximum burst length across DMA channels
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [DM/OFW][PCI] Fix address translation and PCI resource enumeration
Rework OFW address translation to walk nested bus ranges in the correct
direction and cache "ranges" and "dma-ranges" independently. Handle PCI
three-cell addresses without treating the PCI flags cell as part of the
address, and fix CPU-to-DMA and DMA-to-CPU translation across nested
buses.
Fix PCI BAR sizing and assignment by disabling address decoding during
probing, preserving BAR attribute bits, and programming 64-bit BARs
correctly. Add device enable and disable helpers so resources and bus
mastering are enabled before driver probe.
Program bridge memory and prefetch windows while scanning downstream
buses, correctly link child buses into the PCI bus hierarchy, and avoid
unnecessary PCIe link retraining when the link is already active.
Allow host bridges without a device-tree pci-domain property by
allocating unique domains dynamically, while preserving explicit domain
assignments.
Fix MSI and MSI-X IRQ setup, rollback, vector addressing, and affinity
selection.
Add the Raspberry Pi PCI vendor ID for RP1 and other downstream devices.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* style: format code with clang-format
* style: format complete changed files with clang-format
* drivers: pci: address OFW review feedback
* style: format PCI and OFW changes for current master
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [dm][dma] update DMA interface
Extend DMA mapping to honor OFW dma-ranges even
when no reserved memory pool is present,
and add PCI host-bridge DMA-region translation for PCI devices.
Prefer 32-bit-addressable allocations for translated devices,
improve pool allocation fallbacks and synchronization,
and establish a linear mapping for installed DMA pools when possible.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [dm][dma] fixup PL330 work flow
Fix PL330 channel allocation so device-tree cells
select peripheral request lines rather than execution channels.
Generate proper peripheral DMA microcode using DMAWFP, DMALDP, DMASTP, and DMAFLUSHP,
encode burst lengths correctly,
honor transfer direction and non-secure attributes,
and allocate microcode from DMA-coherent memory.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* style: format code with clang-format
* style: format complete changed files with clang-format
* drivers: dma: fix diagnostic format types
* style: format DMA changes for current master
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [DM/Input] Add ADC joystick, keyboard, and touchscreen drivers
Add polling input drivers for ADC-connected joysticks and resistor-
ladder keys. Parse Linux-compatible device-tree bindings, acquire ADC
channels through the IIO framework, and report absolute-axis and key
events.
Add an SPI touchscreen driver for ADS7843, ADS7845, ADS7846, ADS7873,
TSC2046, and XPT2046-compatible controllers. Support pen interrupts,
coordinate and pressure reporting, sample filtering, regulator control,
power management, and common touchscreen properties.
Add an I2C touchscreen driver for Goodix GT9xx controllers with
multi-touch reporting, GPIO-based reset and address selection, interrupt
handling with polling fallback, regulator control, panel configuration,
and alternate-address recovery.
Adapt the drivers to the RT-Thread device model and input framework,
following the corresponding Linux input drivers and device-tree
bindings.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* style: format code with clang-format
* drivers: input: address review feedback
* style: format input changes for current master
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>