bcm27xx: switch to 5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0508-overlays-Add-pcie-32bit-dma-overlay.patch
1 From ce2860020c57a59c543139ad7b260624cd930dff Mon Sep 17 00:00:00 2001
2 From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
3 Date: Mon, 15 Mar 2021 17:25:02 +0100
4 Subject: [PATCH] overlays: Add pcie-32bit-dma overlay
5
6 In order to accommodate full PCI DMA access to memory on newer BCM2711
7 revisions, we're forced to map PCIe's view of physical memory with an
8 offset. This offset makes DMA addressing dependent on having 64bit
9 support on the PCI device's side. Which isn't always the case.
10
11 In order to mitigate this, introduce the pcie-32bit-dma overlay which
12 will forbid firmware from updating the default inbound memory window.
13 The default setting, albeit limited to accessing the lower 3GB of
14 memory, will allow for 32bit DMA addresses at the expense of having to
15 bounce buffers.
16
17 Link: https://github.com/raspberrypi/linux/issues/4197
18 Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
19 ---
20 arch/arm/boot/dts/overlays/Makefile | 1 +
21 arch/arm/boot/dts/overlays/README | 7 +++++++
22 arch/arm/boot/dts/overlays/overlay_map.dts | 4 ++++
23 .../dts/overlays/pcie-32bit-dma-overlay.dts | 18 ++++++++++++++++++
24 4 files changed, 30 insertions(+)
25 create mode 100644 arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts
26
27 --- a/arch/arm/boot/dts/overlays/Makefile
28 +++ b/arch/arm/boot/dts/overlays/Makefile
29 @@ -128,6 +128,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
30 ov9281.dtbo \
31 papirus.dtbo \
32 pca953x.dtbo \
33 + pcie-32bit-dma.dtbo \
34 pibell.dtbo \
35 pifacedigital.dtbo \
36 pifi-40.dtbo \
37 --- a/arch/arm/boot/dts/overlays/README
38 +++ b/arch/arm/boot/dts/overlays/README
39 @@ -2135,6 +2135,13 @@ Params: addr I2C addr
40 xra1202 Select the Exar XRA1202 (8 bit)
41
42
43 +Name: pcie-32bit-dma
44 +Info: Force PCIe config to support 32bit DMA addresses at the expense of
45 + having to bounce buffers.
46 +Load: dtoverlay=pcie-32bit-dma
47 +Params: <None>
48 +
49 +
50 [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
51
52
53 --- a/arch/arm/boot/dts/overlays/overlay_map.dts
54 +++ b/arch/arm/boot/dts/overlays/overlay_map.dts
55 @@ -37,6 +37,10 @@
56 deprecated = "use gpio-ir";
57 };
58
59 + pcie-32bit-dma {
60 + bcm2711;
61 + };
62 +
63 pi3-act-led {
64 renamed = "act-led";
65 };
66 --- /dev/null
67 +++ b/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts
68 @@ -0,0 +1,18 @@
69 +/*
70 + * pcie-32bit-dma-overlay.dts
71 + */
72 +
73 +/dts-v1/;
74 +/plugin/;
75 +
76 +/ {
77 + compatible = "brcm,bcm2711";
78 +
79 + fragment@0 {
80 + target-path = "/aliases";
81 + __overlay__ {
82 + pcie0 = "";
83 + };
84 + };
85 +
86 +};