Add pcie-32bit-dma-overlay-pi5 to enable 32bit DMA on the Pi 5's external PCIe
authorRodrigo Rosmaninho <quico.rosmaninho@gmail.com>
Tue, 23 Jan 2024 18:50:19 +0000 (18:50 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:33 +0000 (11:35 +0000)
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.

Signed-off-by: Rodrigo Rosmaninho <r.rosmaninho@ua.pt>
arch/arm/boot/dts/overlays/Makefile
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/overlay_map.dts
arch/arm/boot/dts/overlays/pcie-32bit-dma-pi5-overlay.dts [new file with mode: 0644]

index 63ebdd9..8028c4e 100644 (file)
@@ -183,6 +183,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        pca953x.dtbo \
        pcf857x.dtbo \
        pcie-32bit-dma.dtbo \
+       pcie-32bit-dma-pi5.dtbo \
        pibell.dtbo \
        pifacedigital.dtbo \
        pifi-40.dtbo \
index 6fa3cf2..181799b 100644 (file)
@@ -3394,6 +3394,12 @@ Load:   dtoverlay=pcie-32bit-dma
 Params: <None>
 
 
+Name:   pcie-32bit-dma-pi5
+Info:   Force PCIe config to support 32bit DMA addresses at the expense of
+        having to bounce buffers (on the Pi 5).
+Load:   dtoverlay=pcie-32bit-dma-pi5
+Params: <None>
+
 [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
 
 
index 1261ab5..030b597 100644 (file)
 
        pcie-32bit-dma {
                bcm2711;
+               bcm2712 = "pcie-32bit-dma-pi5";
+       };
+
+       pcie-32bit-dma-pi5 {
+               bcm2712;
        };
 
        pi3-act-led {
diff --git a/arch/arm/boot/dts/overlays/pcie-32bit-dma-pi5-overlay.dts b/arch/arm/boot/dts/overlays/pcie-32bit-dma-pi5-overlay.dts
new file mode 100644 (file)
index 0000000..f990849
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * pcie-32bit-dma-pi5-overlay.dts
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+       compatible = "brcm,bcm2712";
+
+       fragment@0 {
+               target = <&pcie1>;
+               __overlay__ {
+                       /*
+                        * The size of the range is rounded up to a power of 2,
+                        * so the range ends up being 0-4GB, and the MSI vector
+                        * gets pushed beyond 4GB.
+                        */
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000
+                                     0x0 0x80000000>;
+               };
+       };
+
+};