From 93c6d3067b0f5a577307fe4acd3b9e169d161364 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Mon, 15 Mar 2021 17:25:02 +0100 Subject: [PATCH] overlays: Add pcie-32bit-dma overlay In order to accommodate full PCI DMA access to memory on newer BCM2711 revisions, we're forced to map PCIe's view of physical memory with an offset. This offset makes DMA addressing dependent on having 64bit support on the PCI device's side. Which isn't always the case. In order to mitigate this, introduce the pcie-32bit-dma overlay which will forbid firmware from updating the default inbound memory window. The default setting, albeit limited to accessing the lower 3GB of memory, will allow for 32bit DMA addresses at the expense of having to bounce buffers. Link: https://github.com/raspberrypi/linux/issues/4197 Signed-off-by: Nicolas Saenz Julienne --- arch/arm/boot/dts/overlays/Makefile | 1 + arch/arm/boot/dts/overlays/README | 7 +++++++ arch/arm/boot/dts/overlays/overlay_map.dts | 4 ++++ .../dts/overlays/pcie-32bit-dma-overlay.dts | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index ef0a0cc3da99a6..27594c3cd6ff82 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -127,6 +127,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ ov9281.dtbo \ papirus.dtbo \ pca953x.dtbo \ + pcie-32bit-dma.dtbo \ pibell.dtbo \ pifacedigital.dtbo \ pifi-40.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README index 97adda31fbe2cd..500196f1be8826 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -2079,6 +2079,13 @@ Params: addr I2C address of expander. Default 0x20. xra1202 Select the Exar XRA1202 (8 bit) +Name: pcie-32bit-dma +Info: Force PCIe config to support 32bit DMA addresses at the expense of + having to bounce buffers. +Load: dtoverlay=pcie-32bit-dma +Params: + + [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ] diff --git a/arch/arm/boot/dts/overlays/overlay_map.dts b/arch/arm/boot/dts/overlays/overlay_map.dts index b2e6b41216b207..e9a15fab82c707 100644 --- a/arch/arm/boot/dts/overlays/overlay_map.dts +++ b/arch/arm/boot/dts/overlays/overlay_map.dts @@ -37,6 +37,10 @@ deprecated = "use gpio-ir"; }; + pcie-32bit-dma { + bcm2711; + }; + pi3-act-led { renamed = "act-led"; }; diff --git a/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts b/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts new file mode 100644 index 00000000000000..cca3e83721b743 --- /dev/null +++ b/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts @@ -0,0 +1,18 @@ +/* + * pcie-32bit-dma-overlay.dts + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2711"; + + fragment@0 { + target-path = "/aliases"; + __overlay__ { + pcie0 = ""; + }; + }; + +};