aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0698-dtoverlay-Reduce-size-of-PCIE-IB-window-in-pcie-32-d.patch
blob: 4badeb1baddf78462b79d770cb3b012ad2f45c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From e4402c2622756ab56d02159a8ff3c54165ab577c Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 3 Feb 2022 11:17:16 +0000
Subject: [PATCH] dtoverlay: Reduce size of PCIE IB window in
 pcie-32-dma overlay

The PCIE inbound window is rounded up to a power of 2, so the default
of 3GB rounds up to 4GB starting at 0. This prohibits the MSI vector
sitting at 0x0_fffffffc, and causes warnings from some subsystems
(eg ahci) of a 64bit address on a 32bit configuration.

Reduce the window down to 2GB to avoid this issue.

https://github.com/raspberrypi/linux/issues/4848

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 .../dts/overlays/pcie-32bit-dma-overlay.dts   | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

--- a/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts
+++ b/arch/arm/boot/dts/overlays/pcie-32bit-dma-overlay.dts
@@ -11,8 +11,28 @@
 	fragment@0 {
 		target-path = "/aliases";
 		__overlay__ {
+			/*
+			 * Removing this alias stops the firmware patching the
+			 * PCIE DT dma-ranges based on the detected chip
+			 * revision.
+			 */
 			pcie0 = "";
 		};
 	};
 
+	fragment@1 {
+		target = <&pcie0>;
+		__overlay__ {
+			/*
+			 * The size of the range is rounded up to a power of 2,
+			 * so the range ends up being 0-4GB, and the MSI vector
+			 * gets pushed beyond 4GB.
+			 */
+			#address-cells = <3>;
+			#size-cells = <2>;
+			dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000
+				      0x0 0x80000000>;
+		};
+	};
+
 };