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
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.
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
17 Link: https://github.com/raspberrypi/linux/issues/4197
18 Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
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
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) += \
33 + pcie-32bit-dma.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)
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
50 [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
53 --- a/arch/arm/boot/dts/overlays/overlay_map.dts
54 +++ b/arch/arm/boot/dts/overlays/overlay_map.dts
56 deprecated = "use gpio-ir";
67 +++ b/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts
70 + * pcie-32bit-dma-overlay.dts
77 + compatible = "brcm,bcm2711";
80 + target-path = "/aliases";