aboutsummaryrefslogtreecommitdiff
path: root/target/linux/bcm27xx/patches-6.1/950-0709-ARM-dts-bcm27xx-Correct-the-dma-ranges.patch
blob: 88be17f62e93c96841d7f47df29c44998b8db76f (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From 96c1d3649471109b3da9fc04797fa84f8cab4c81 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 11 May 2023 09:59:04 +0100
Subject: [PATCH] ARM: dts: bcm27xx: Correct the dma-ranges

Step one of using DMA addresses the intended way is to make sure that
the mapping between CPU physical addresses and DMA addresses in Device
Tree is complete and correct.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 arch/arm/boot/dts/bcm2708.dtsi        |  3 ++-
 arch/arm/boot/dts/bcm2709.dtsi        |  3 +++
 arch/arm/boot/dts/bcm2710.dtsi        |  3 +++
 arch/arm/boot/dts/bcm2711-rpi-ds.dtsi | 13 ++++++++++++-
 4 files changed, 20 insertions(+), 2 deletions(-)

--- a/arch/arm/boot/dts/bcm2708.dtsi
+++ b/arch/arm/boot/dts/bcm2708.dtsi
@@ -10,7 +10,8 @@
 };
 
 &soc {
-	dma-ranges = <0x80000000 0x00000000 0x20000000>;
+	dma-ranges = <0x80000000 0x00000000 0x20000000>,
+		     <0x7e000000 0x20000000 0x02000000>;
 };
 
 &vc4 {
--- a/arch/arm/boot/dts/bcm2709.dtsi
+++ b/arch/arm/boot/dts/bcm2709.dtsi
@@ -8,6 +8,9 @@
 		ranges = <0x7e000000 0x3f000000 0x01000000>,
 		         <0x40000000 0x40000000 0x00040000>;
 
+		dma-ranges = <0xc0000000 0x00000000 0x3f000000>,
+			     <0x7e000000 0x3f000000 0x01000000>;
+
 		/delete-node/ timer@7e003000;
 	};
 
--- a/arch/arm/boot/dts/bcm2710.dtsi
+++ b/arch/arm/boot/dts/bcm2710.dtsi
@@ -11,6 +11,9 @@
 	};
 
 	soc {
+		dma-ranges = <0xc0000000 0x00000000 0x3f000000>,
+			     <0x7e000000 0x3f000000 0x01000000>;
+
 		/delete-node/ timer@7e003000;
 	};
 
--- a/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi
+++ b/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi
@@ -18,6 +18,10 @@
 	     /* Add a label */
 	};
 
+	soc: soc {
+	     /* Add a label */
+	};
+
 	arm-pmu {
 		compatible = "arm,cortex-a72-pmu", "arm,armv8-pmuv3", "arm,cortex-a7-pmu";
 
@@ -64,6 +68,12 @@
 	alloc-ranges = <0x0 0x00000000 0x30000000>;
 };
 
+&soc {
+	/* Add the physical <-> DMA mapping for the I/O space */
+	dma-ranges = <0xc0000000  0x0 0x00000000  0x40000000>,
+		     <0x7c000000  0x0 0xfc000000  0x03800000>;
+};
+
 &scb {
 	#size-cells = <2>;
 
@@ -71,7 +81,8 @@
 		 <0x0 0x40000000  0x0 0xff800000  0x0 0x00800000>,
 		 <0x6 0x00000000  0x6 0x00000000  0x0 0x40000000>,
 		 <0x0 0x00000000  0x0 0x00000000  0x0 0xfc000000>;
-	dma-ranges = <0x0 0x00000000  0x0 0x00000000  0x4 0x00000000>;
+	dma-ranges = <0x4 0x7c000000  0x0 0xfc000000  0x0 0x03800000>,
+		     <0x0 0x00000000  0x0 0x00000000  0x4 0x00000000>;
 
 	dma40: dma@7e007b00 {
 		compatible = "brcm,bcm2711-dma";