From 16991af20bd821ecba1eae2fe11ddbcafa18f164 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 ++++ arch/arm/boot/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 753733c..bdaa62c 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -128,6 +128,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 51fd09c..d8a9ba5 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -2135,6 +2135,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 b2e6b41..e9a15fa 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 0000000..cca3e83 --- /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 = ""; + }; + }; + +}; -- 2.7.4