1 From 1cdbd99f402b76c61632d09a49b20ce90af0cc72 Mon Sep 17 00:00:00 2001
2 From: Rodrigo Rosmaninho <quico.rosmaninho@gmail.com>
3 Date: Tue, 23 Jan 2024 18:50:19 +0000
4 Subject: [PATCH 1254/1295] Add pcie-32bit-dma-overlay-pi5 to enable 32bit DMA
5 on the Pi 5's external PCIe
7 Changes dma-ranges in the pcie1 component of the bcm2712 dts in order to ensure that the DMA addressing space is 32bits, at the expense of having to bounce buffers.
9 Signed-off-by: Rodrigo Rosmaninho <r.rosmaninho@ua.pt>
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 6 +++++
13 arch/arm/boot/dts/overlays/overlay_map.dts | 5 ++++
14 .../overlays/pcie-32bit-dma-pi5-overlay.dts | 26 +++++++++++++++++++
15 4 files changed, 38 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/pcie-32bit-dma-pi5-overlay.dts
18 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -182,6 +182,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
24 + pcie-32bit-dma-pi5.dtbo \
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -3388,6 +3388,12 @@ Load: dtoverlay=pcie-32bit-dma
34 +Name: pcie-32bit-dma-pi5
35 +Info: Force PCIe config to support 32bit DMA addresses at the expense of
36 + having to bounce buffers (on the Pi 5).
37 +Load: dtoverlay=pcie-32bit-dma-pi5
40 [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
43 --- a/arch/arm/boot/dts/overlays/overlay_map.dts
44 +++ b/arch/arm/boot/dts/overlays/overlay_map.dts
49 + bcm2712 = "pcie-32bit-dma-pi5";
52 + pcie-32bit-dma-pi5 {
58 +++ b/arch/arm/boot/dts/overlays/pcie-32bit-dma-pi5-overlay.dts
61 + * pcie-32bit-dma-pi5-overlay.dts
68 + compatible = "brcm,bcm2712";
74 + * The size of the range is rounded up to a power of 2,
75 + * so the range ends up being 0-4GB, and the MSI vector
76 + * gets pushed beyond 4GB.
78 + #address-cells = <3>;
80 + dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000