Re: [PATCH v2] riscv: dts: spacemit: k1: give each PCIe port its own DMA window
From: Frédéric Mahé
Date: Tue Nov 17 2026 - 03:50:39 EST
On Thu, Nov 12, 2026 at 09:31:58PM -0500, Vlad Banea wrote:
> The shared pcie-bus skips all three windows, bus 0x8000_0000-0xb7ff_ffff,
> which leaves CPU addresses 0x1_0000_0000-0x1_37ff_ffff unreachable from
> every port. Give each port its own bus that skips only its own window.
Tested on a Banana Pi BPI-F3 (16 GB) with an NVMe SSD on pcie1, on
v7.4-rc1 plus "PCI: spacemit: Ignore PERST# input in RC mode on K1".
For pages at known physical addresses (from /proc/self/pagemap), I did
one 4 KiB O_DIRECT write and read per page and counted swiotlb_bounced
events:
CPU range without with this patch
0x1_0000_0000-0x1_0fff_ffff 1439/1439 bounced 0/864 bounced
0x1_1000_0000-0x1_1fff_ffff all bounced all bounced (pcie1's own window)
Every page read back correctly in both cases, so DMA through bus
0x8000_0000 works. fio with crc32c verify (16 GiB direct, 8 GiB
buffered) also passed with both DTs.
Tested-by: Frédéric Mahé <frederic.mahe@xxxxxxxx>