summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorGUI <[email protected]>2026-08-14 12:42:01 +0800
committerGitHub <[email protected]>2026-08-14 12:42:01 +0800
commitf2c05253d11f0b5746ade4bdb7d8d838bb7a5df1 (patch)
tree63e8bc39e0391bd0e0587a96d59dc3a7b42a732f /bsp
parentc1418dbd2e3b9596b4082b111b80bd5f86e76028 (diff)
[dm][dma] Update DMA (#11678)
* [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 <[email protected]> * [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 <[email protected]> * 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 <[email protected]>
Diffstat (limited to 'bsp')
-rw-r--r--bsp/qemu-virt64-aarch64/README.md10
-rw-r--r--bsp/qemu-virt64-aarch64/README_zh.md10
-rwxr-xr-xbsp/qemu-virt64-aarch64/amp.dtsi2
3 files changed, 11 insertions, 11 deletions
diff --git a/bsp/qemu-virt64-aarch64/README.md b/bsp/qemu-virt64-aarch64/README.md
index 8ac4012c1c..a4353865bc 100644
--- a/bsp/qemu-virt64-aarch64/README.md
+++ b/bsp/qemu-virt64-aarch64/README.md
@@ -191,10 +191,10 @@ VirtIO Sound:
AMP heterogeneous multi-core (RPMSG slave, **requires Smart version**):
```
-./qemu.py -dtbo amp.dtsi -mem 258
+./qemu.py -dtbo amp.dtsi -mem 300
```
-> **Note**: The AMP demo requires the **Smart version** (`RT_USING_SMART`) and **`-mem 258`** (memory layout in `amp.dtsi` needs ~258 MB; the default 128 MB is insufficient). `qemu.py` also increments `-smp` by 1 when `amp_soc` is detected (e.g. `RT_CPUS_NR=4` runs as `-smp 5`). QEMU `loader` pre-loads `amp.dtb` and `rtthread.bin` to fixed physical addresses in `amp.dtsi` (e.g. `kernel-entry = 0x48480000`); the primary core then starts the slave via PSCI. The standard kernel must run in a region where virtual addresses equal physical addresses and cannot be used for the slave address space. Enable Smart in menuconfig and rebuild.
+> **Note**: The AMP demo requires the **Smart version** (`RT_USING_SMART`) and **`-mem 300`** (memory layout in `amp.dtsi` needs ~300 MB; the default 128 MB is insufficient). `qemu.py` also increments `-smp` by 1 when `amp_soc` is detected (e.g. `RT_CPUS_NR=4` runs as `-smp 5`). QEMU `loader` pre-loads `amp.dtb` and `rtthread.bin` to fixed physical addresses in `amp.dtsi` (e.g. `kernel-entry = 0x48480000`); the primary core then starts the slave via PSCI. The standard kernel must run in a region where virtual addresses equal physical addresses and cannot be used for the slave address space. Enable Smart in menuconfig and rebuild.
Camera demo (requires `-graphic` for framebuffer overlay in `camera.c`):
@@ -328,12 +328,12 @@ Default application. Prints `hello rt-thread` after boot, then enters msh.
QEMU `loader` pre-loads `amp.dtb` and `rtthread.bin` to addresses in `amp.dtsi`; the primary core then boots the slave CPU via the `amp_soc` devicetree node and PSCI. Primary and slave communicate through VirtIO RPMSG and Mailbox. The primary writes VirtIO Block `vdb` resource info into the slave DTB before starting the slave. `qemu.py` increments `-smp` by 1 for the extra CPU.
-**Version requirement**: **Smart version** required (`RT_USING_SMART` in menuconfig), plus **`-mem 258`**. The standard kernel must run with virtual addresses equal to physical addresses. The AMP slave is loaded into a separate physical memory region (see `amp_memory`, `kernel-entry` in `amp.dtsi`), which violates that constraint — the standard kernel cannot be used for AMP demos.
+**Version requirement**: **Smart version** required (`RT_USING_SMART` in menuconfig), plus **`-mem 300`**. The standard kernel must run with virtual addresses equal to physical addresses. The AMP slave is loaded into a separate physical memory region (see `amp_memory`, `kernel-entry` in `amp.dtsi`), which violates that constraint — the standard kernel cannot be used for AMP demos.
Startup:
```
-./qemu.py -dtbo amp.dtsi -mem 258
+./qemu.py -dtbo amp.dtsi -mem 300
```
Slave console: `telnet localhost 4323`.
@@ -396,6 +396,6 @@ Optional VirtIO device arguments (add in `qemu.py` as needed):
- GIC auto-switches to v3 when exceeding 8 cores; or specify `-gic 3` manually. `gic-version=max` is set only internally when using `-el 2` with GICv3.
- 9P directory sharing requires QEMU built with virtfs (`--enable-virtfs`).
- `-gl` requires QEMU built with OpenGL / VirGL (`--enable-opengl`, `--enable-virglrenderer`); this is independent of RT-Thread OpenGL support — the default software stack is 2D graphics only.
-- AMP (`-dtbo`) requires Smart kernel (`RT_USING_SMART`), `-mem 258`, and auto-increments CPU count; the standard kernel requires VA=PA and cannot be used with slave images loaded at fixed physical addresses.
+- AMP (`-dtbo`) requires Smart kernel (`RT_USING_SMART`), `-mem 300`, and auto-increments CPU count; the standard kernel requires VA=PA and cannot be used with slave images loaded at fixed physical addresses.
- `-camera` requires a host V4L2 device path, Linux, and libvfio-user; your user must have read access to the device (typically via the `video` group); `-graphic` is needed only for the `camera.c` framebuffer preview demo.
- Override root device or boot parameters via `-bootargs`.
diff --git a/bsp/qemu-virt64-aarch64/README_zh.md b/bsp/qemu-virt64-aarch64/README_zh.md
index 0b623627d8..3b93d54028 100644
--- a/bsp/qemu-virt64-aarch64/README_zh.md
+++ b/bsp/qemu-virt64-aarch64/README_zh.md
@@ -187,10 +187,10 @@ VirtIO Sound 音频:
AMP 异构多核(RPMSG 从核,**须 Smart 版本**):
```
-./qemu.py -dtbo amp.dtsi -mem 258
+./qemu.py -dtbo amp.dtsi -mem 300
```
-> **说明**:AMP 示例要求启用 **Smart 版本**(`RT_USING_SMART`),且必须使用 **`-mem 258`**(`amp.dtsi` 内存布局约需 258 MB,默认 128 MB 不足)。`qemu.py` 检测到 `amp_soc` 时会将 `-smp` 自动加 1(例如 `RT_CPUS_NR=4` 时实际以 `-smp 5` 启动)。QEMU `loader` 会预先将 `amp.dtb` 与 `rtthread.bin` 加载到 `amp.dtsi` 指定的固定物理地址(如 `kernel-entry = 0x48480000`),主核再通过 PSCI 拉起从核。标准版内核要求在虚拟地址与物理地址相等的区域运行,无法用于从核地址空间。请在 menuconfig 中开启 Smart 后重新编译。
+> **说明**:AMP 示例要求启用 **Smart 版本**(`RT_USING_SMART`),且必须使用 **`-mem 300`**(`amp.dtsi` 内存布局约需 300 MB,默认 128 MB 不足)。`qemu.py` 检测到 `amp_soc` 时会将 `-smp` 自动加 1(例如 `RT_CPUS_NR=4` 时实际以 `-smp 5` 启动)。QEMU `loader` 会预先将 `amp.dtb` 与 `rtthread.bin` 加载到 `amp.dtsi` 指定的固定物理地址(如 `kernel-entry = 0x48480000`),主核再通过 PSCI 拉起从核。标准版内核要求在虚拟地址与物理地址相等的区域运行,无法用于从核地址空间。请在 menuconfig 中开启 Smart 后重新编译。
摄像头演示(`camera.c` 叠加画面到 framebuffer,需配合 `-graphic`):
@@ -324,12 +324,12 @@ Linux 下需预先配置 TAP 网桥,Windows / WSL 下 TAP 支持有限。TAP �
QEMU `loader` 预先将 `amp.dtb` 与 `rtthread.bin` 加载到 `amp.dtsi` 指定地址,主核再通过 `amp_soc` 设备树节点与 PSCI 拉起从核 CPU。主从之间通过 VirtIO RPMSG + Mailbox 通信。主核将 VirtIO Block `vdb` 的资源信息写入从核 DTB 后启动从核。`qemu.py` 会为这颗额外 CPU 将 `-smp` 加 1。
-**版本要求**:须 **Smart 版本**(menuconfig 中 `RT_USING_SMART`),且须使用 **`-mem 258`**。标准版内核必须在虚拟地址与物理地址一致的映射下运行;AMP 从核加载到独立物理内存区域(见 `amp.dtsi` 中 `amp_memory`、`kernel-entry` 等),不满足该约束,因此标准版无法用于 AMP 演示。
+**版本要求**:须 **Smart 版本**(menuconfig 中 `RT_USING_SMART`),且须使用 **`-mem 300`**。标准版内核必须在虚拟地址与物理地址一致的映射下运行;AMP 从核加载到独立物理内存区域(见 `amp.dtsi` 中 `amp_memory`、`kernel-entry` 等),不满足该约束,因此标准版无法用于 AMP 演示。
启动方式:
```
-./qemu.py -dtbo amp.dtsi -mem 258
+./qemu.py -dtbo amp.dtsi -mem 300
```
从核控制台:`telnet localhost 4323`。
@@ -392,6 +392,6 @@ VirtIO 设备可选参数(在 `qemu.py` 中按需添加):
- 超过 8 核时 GIC 自动切换为 v3,也可手动指定 `-gic 3`。`gic-version=max` 仅在 `-el 2` 且 GICv3 时由脚本内部设置。
- 启用 9P 目录共享需 QEMU 编译时包含 virtfs(`--enable-virtfs`)。
- 使用 `-gl` 需 QEMU 编译时包含 OpenGL / VirGL(`--enable-opengl`、`--enable-virglrenderer`);这与 RT-Thread 是否支持 OpenGL 无关,当前软件栈默认仅 2D 图形。
-- AMP(`-dtbo`)须 Smart 版本内核(`RT_USING_SMART`)、`-mem 258`,且自动增加 CPU 数;标准版要求 VA=PA 运行,无法用于从核固定物理地址加载场景。
+- AMP(`-dtbo`)须 Smart 版本内核(`RT_USING_SMART`)、`-mem 300`,且自动增加 CPU 数;标准版要求 VA=PA 运行,无法用于从核固定物理地址加载场景。
- `-camera` 须传入宿主机 V4L2 设备路径,仅支持 Linux,且需 libvfio-user;当前用户须能访问该设备(通常加入 `video` 组);`-graphic` 仅 `camera.c` framebuffer 预览演示需要。
- 修改根设备或启动参数时,通过 `-bootargs` 覆盖默认参数。
diff --git a/bsp/qemu-virt64-aarch64/amp.dtsi b/bsp/qemu-virt64-aarch64/amp.dtsi
index 2491d1b8a3..01ff9491d9 100755
--- a/bsp/qemu-virt64-aarch64/amp.dtsi
+++ b/bsp/qemu-virt64-aarch64/amp.dtsi
@@ -19,7 +19,7 @@
#define AMP_MEMORY_SIZE (128 * SIZE_MB)
/*
- * RUN COMMAND: ./qemu.py -dtbo amp.dtsi -mem 258
+ * RUN COMMAND: ./qemu.py -dtbo amp.dtsi -mem 300
* REMOTE: telnet localhost 4323
*/