bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/xback.git] / target / linux / bcm27xx / patches-6.1 / 950-1254-Add-pcie-32bit-dma-overlay-pi5-to-enable-32bit-DMA-o.patch
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
6
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.
8
9 Signed-off-by: Rodrigo Rosmaninho <r.rosmaninho@ua.pt>
10 ---
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
17
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) += \
21 pca953x.dtbo \
22 pcf857x.dtbo \
23 pcie-32bit-dma.dtbo \
24 + pcie-32bit-dma-pi5.dtbo \
25 pibell.dtbo \
26 pifacedigital.dtbo \
27 pifi-40.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
31 Params: <None>
32
33
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
38 +Params: <None>
39 +
40 [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
41
42
43 --- a/arch/arm/boot/dts/overlays/overlay_map.dts
44 +++ b/arch/arm/boot/dts/overlays/overlay_map.dts
45 @@ -185,6 +185,11 @@
46
47 pcie-32bit-dma {
48 bcm2711;
49 + bcm2712 = "pcie-32bit-dma-pi5";
50 + };
51 +
52 + pcie-32bit-dma-pi5 {
53 + bcm2712;
54 };
55
56 pi3-act-led {
57 --- /dev/null
58 +++ b/arch/arm/boot/dts/overlays/pcie-32bit-dma-pi5-overlay.dts
59 @@ -0,0 +1,26 @@
60 +/*
61 + * pcie-32bit-dma-pi5-overlay.dts
62 + */
63 +
64 +/dts-v1/;
65 +/plugin/;
66 +
67 +/ {
68 + compatible = "brcm,bcm2712";
69 +
70 + fragment@0 {
71 + target = <&pcie1>;
72 + __overlay__ {
73 + /*
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.
77 + */
78 + #address-cells = <3>;
79 + #size-cells = <2>;
80 + dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000
81 + 0x0 0x80000000>;
82 + };
83 + };
84 +
85 +};