aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0748-overlays-Add-baudrate-parameter-to-i2c3-i2c6.patch
blob: bdbdcbb20f96085e8e5d3529a66cad73013e4913 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
From 73d2665f0756435e50bb94039a28d47f6134bcb9 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 5 Aug 2019 14:17:14 +0100
Subject: [PATCH 748/773] overlays: Add baudrate parameter to i2c3-i2c6

The overlays for enabling the new BCM2711 I2C interfaces were lacking
the means to configure the baud/clock rate.

Also explictly set the default pins, rather than relying on the values
in the base DTB.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 arch/arm/boot/dts/overlays/README           |  8 ++++++++
 arch/arm/boot/dts/overlays/i2c3-overlay.dts | 15 ++++++++++++---
 arch/arm/boot/dts/overlays/i2c4-overlay.dts | 15 ++++++++++++---
 arch/arm/boot/dts/overlays/i2c5-overlay.dts | 15 ++++++++++++---
 arch/arm/boot/dts/overlays/i2c6-overlay.dts | 15 ++++++++++++---
 5 files changed, 56 insertions(+), 12 deletions(-)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1221,6 +1221,8 @@ Info:   Enable the i2c3 bus
 Load:   dtoverlay=i2c3,<param>
 Params: pins_2_3                Use GPIOs 2 and 3
         pins_4_5                Use GPIOs 4 and 5 (default)
+        baudrate                Set the baudrate for the interface (default
+                                "100000")
 
 
 Name:   i2c4
@@ -1228,6 +1230,8 @@ Info:   Enable the i2c4 bus
 Load:   dtoverlay=i2c4,<param>
 Params: pins_6_7                Use GPIOs 6 and 7
         pins_8_9                Use GPIOs 8 and 9 (default)
+        baudrate                Set the baudrate for the interface (default
+                                "100000")
 
 
 Name:   i2c5
@@ -1235,6 +1239,8 @@ Info:   Enable the i2c5 bus
 Load:   dtoverlay=i2c5,<param>
 Params: pins_10_11              Use GPIOs 10 and 11
         pins_12_13              Use GPIOs 12 and 13 (default)
+        baudrate                Set the baudrate for the interface (default
+                                "100000")
 
 
 Name:   i2c6
@@ -1242,6 +1248,8 @@ Info:   Enable the i2c6 bus
 Load:   dtoverlay=i2c6,<param>
 Params: pins_0_1                Use GPIOs 0 and 1
         pins_22_23              Use GPIOs 22 and 23 (default)
+        baudrate                Set the baudrate for the interface (default
+                                "100000")
 
 
 Name:   i2s-gpio28-31
--- a/arch/arm/boot/dts/overlays/i2c3-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c3-overlay.dts
@@ -6,10 +6,11 @@
 
 	fragment@0 {
 		target = <&i2c3>;
-		__overlay__ {
+		frag0: __overlay__ {
 			status = "okay";
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c3_pins>;
+			clock-frequency = <100000>;
 		};
 	};
 
@@ -20,8 +21,16 @@
 		};
 	};
 
+	fragment@2 {
+		target = <&i2c3_pins>;
+		__overlay__ {
+			brcm,pins = <4 5>;
+		};
+	};
+
 	__overrides__ {
-		pins_2_3 = <0>,"=1";
-		pins_4_5 = <0>,"!1";
+		pins_2_3 = <0>,"=1!2";
+		pins_4_5 = <0>,"!1=2";
+		baudrate = <&frag0>, "clock-frequency:0";
 	};
 };
--- a/arch/arm/boot/dts/overlays/i2c4-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c4-overlay.dts
@@ -6,10 +6,11 @@
 
 	fragment@0 {
 		target = <&i2c4>;
-		__overlay__ {
+		frag0: __overlay__ {
 			status = "okay";
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c4_pins>;
+			clock-frequency = <100000>;
 		};
 	};
 
@@ -20,8 +21,16 @@
 		};
 	};
 
+	fragment@2 {
+		target = <&i2c4_pins>;
+		__overlay__ {
+			brcm,pins = <8 9>;
+		};
+	};
+
 	__overrides__ {
-		pins_6_7 = <0>,"=1";
-		pins_8_9 = <0>,"!1";
+		pins_6_7 = <0>,"=1!2";
+		pins_8_9 = <0>,"!1=2";
+		baudrate = <&frag0>, "clock-frequency:0";
 	};
 };
--- a/arch/arm/boot/dts/overlays/i2c5-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c5-overlay.dts
@@ -6,10 +6,11 @@
 
 	fragment@0 {
 		target = <&i2c5>;
-		__overlay__ {
+		frag0: __overlay__ {
 			status = "okay";
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c5_pins>;
+			clock-frequency = <100000>;
 		};
 	};
 
@@ -20,8 +21,16 @@
 		};
 	};
 
+	fragment@2 {
+		target = <&i2c5_pins>;
+		__overlay__ {
+			brcm,pins = <12 13>;
+		};
+	};
+
 	__overrides__ {
-		pins_10_11 = <0>,"=1";
-		pins_12_13 = <0>,"!1";
+		pins_10_11 = <0>,"=1!2";
+		pins_12_13 = <0>,"!1=2";
+		baudrate = <&frag0>, "clock-frequency:0";
 	};
 };
--- a/arch/arm/boot/dts/overlays/i2c6-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c6-overlay.dts
@@ -6,10 +6,11 @@
 
 	fragment@0 {
 		target = <&i2c6>;
-		__overlay__ {
+		frag0: __overlay__ {
 			status = "okay";
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c6_pins>;
+			clock-frequency = <100000>;
 		};
 	};
 
@@ -20,8 +21,16 @@
 		};
 	};
 
+	fragment@2 {
+		target = <&i2c6_pins>;
+		__overlay__ {
+			brcm,pins = <22 23>;
+		};
+	};
+
 	__overrides__ {
-		pins_0_1 = <0>,"=1";
-		pins_22_23 = <0>,"!1";
+		pins_0_1 = <0>,"=1!2";
+		pins_22_23 = <0>,"!1=2";
+		baudrate = <&frag0>, "clock-frequency:0";
 	};
 };