1 From 9c0f4b3e3b197d5c81f4bd6679f2c2456ab45c9e Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 17 Jul 2019 10:08:55 +0100
4 Subject: [PATCH 705/806] overlays: Add i2c0 and i2c1 for regularity
6 The new i2c overlays for pi4 (i2c3, i2c4, i2c5, i2c6) have a
7 standardised interface that allows pin groups to be chosen
8 atomically rather than as individual pins. Add i2c0 and i2c1
9 overlays to fit the naming scheme and parameter usage, deprecating
10 i2c0-bcm2708 and i2c1-bcm2708.
12 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
14 arch/arm/boot/dts/overlays/Makefile | 2 +
15 arch/arm/boot/dts/overlays/README | 33 +++++---
16 .../dts/overlays/i2c0-bcm2708-overlay.dts | 77 +++----------------
17 arch/arm/boot/dts/overlays/i2c0-overlay.dts | 61 +++++++++++++++
18 .../dts/overlays/i2c1-bcm2708-overlay.dts | 46 ++---------
19 arch/arm/boot/dts/overlays/i2c1-overlay.dts | 44 +++++++++++
20 6 files changed, 147 insertions(+), 116 deletions(-)
21 create mode 100644 arch/arm/boot/dts/overlays/i2c0-overlay.dts
22 create mode 100644 arch/arm/boot/dts/overlays/i2c1-overlay.dts
24 --- a/arch/arm/boot/dts/overlays/Makefile
25 +++ b/arch/arm/boot/dts/overlays/Makefile
26 @@ -66,7 +66,9 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
36 --- a/arch/arm/boot/dts/overlays/README
37 +++ b/arch/arm/boot/dts/overlays/README
38 @@ -1151,14 +1151,12 @@ Params: addr Set the
44 Info: Change i2c0 pin usage. Not all pin combinations are usable on all
45 platforms - platforms other then Compute Modules can only use this
46 to disable transaction combining.
47 -Load: dtoverlay=i2c0-bcm2708,<param>=<val>
48 -Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*)
49 - scl0_pin GPIO pin for SCL0 (deprecated - use pins_*)
50 - pins_0_1 Use pins 0 and 1 (default)
51 +Load: dtoverlay=i2c0,<param>=<val>
52 +Params: pins_0_1 Use pins 0 and 1 (default)
53 pins_28_29 Use pins 28 and 29
54 pins_44_45 Use pins 44 and 45
55 pins_46_47 Use pins 46 and 47
56 @@ -1166,18 +1164,33 @@ Params: sda0_pin GPIO pin
62 +Info: Deprecated, legacy version of i2c0, from which it inherits its
63 + parameters, just adding the explicit individual pin specifiers.
65 +Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*)
66 + scl0_pin GPIO pin for SCL0 (deprecated - use pins_*)
70 Info: Change i2c1 pin usage. Not all pin combinations are usable on all
71 platforms - platforms other then Compute Modules can only use this
72 to disable transaction combining.
73 -Info: Enable the i2c_bcm2708 driver for the i2c1 bus
74 -Load: dtoverlay=i2c1-bcm2708,<param>=<val>
75 +Load: dtoverlay=i2c1,<param>=<val>
76 +Params: pins_2_3 Use pins 2 and 3 (default)
77 + pins_44_45 Use pins 44 and 45
78 + combine Allow transactions to be combined (default
83 +Info: Deprecated, legacy version of i2c1, from which it inherits its
84 + parameters, just adding the explicit individual pin specifiers.
86 Params: sda1_pin GPIO pin for SDA1 (2 or 44 - default 2)
87 scl1_pin GPIO pin for SCL1 (3 or 45 - default 3)
88 pin_func Alternative pin function (4 (alt0), 6 (alt2) -
90 - combine Allow transactions to be combined (default
95 --- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
96 +++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
99 - * Device tree overlay for i2c_bcm2708, i2c0 bus
102 - * dtc -@ -I dts -O dtb -o i2c0-bcm2708-overlay.dtb i2c0-bcm2708-overlay.dts
107 +#include "i2c0-overlay.dts"
110 - compatible = "brcm,bcm2835";
120 - target = <&i2c0_pins>;
121 - frag1: __overlay__ {
123 - brcm,function = <4>; /* alt0 */
128 - target = <&i2c0_pins>;
130 - brcm,pins = <28 29>;
131 - brcm,function = <4>; /* alt0 */
136 - target = <&i2c0_pins>;
138 - brcm,pins = <44 45>;
139 - brcm,function = <5>; /* alt1 */
144 - target = <&i2c0_pins>;
146 - brcm,pins = <46 47>;
147 - brcm,function = <4>; /* alt0 */
154 - compatible = "brcm,bcm2708-i2c";
159 - sda0_pin = <&frag1>,"brcm,pins:0";
160 - scl0_pin = <&frag1>,"brcm,pins:4";
161 - pins_0_1 = <0>,"+1-2-3-4";
162 - pins_28_29 = <0>,"-1+2-3-4";
163 - pins_44_45 = <0>,"-1-2+3-4";
164 - pins_46_47 = <0>,"-1-2-3+4";
165 - combine = <0>, "!5";
168 + sda0_pin = <&pins1>,"brcm,pins:0",
169 + <&pins2>,"brcm,pins:0",
170 + <&pins3>,"brcm,pins:0",
171 + <&pins4>,"brcm,pins:0";
172 + scl0_pin = <&pins1>,"brcm,pins:4",
173 + <&pins2>,"brcm,pins:4",
174 + <&pins3>,"brcm,pins:4",
175 + <&pins4>,"brcm,pins:4";
179 +++ b/arch/arm/boot/dts/overlays/i2c0-overlay.dts
185 + compatible = "brcm,bcm2835";
191 + pinctrl-0 = <&i2c0_pins>;
196 + target = <&i2c0_pins>;
197 + pins1: __overlay__ {
199 + brcm,function = <4>; /* alt0 */
204 + target = <&i2c0_pins>;
205 + pins2: __dormant__ {
206 + brcm,pins = <28 29>;
207 + brcm,function = <4>; /* alt0 */
212 + target = <&i2c0_pins>;
213 + pins3: __dormant__ {
214 + brcm,pins = <44 45>;
215 + brcm,function = <5>; /* alt1 */
220 + target = <&i2c0_pins>;
221 + pins4: __dormant__ {
222 + brcm,pins = <46 47>;
223 + brcm,function = <4>; /* alt0 */
230 + compatible = "brcm,bcm2708-i2c";
235 + pins_0_1 = <0>,"+1-2-3-4";
236 + pins_28_29 = <0>,"-1+2-3-4";
237 + pins_44_45 = <0>,"-1-2+3-4";
238 + pins_46_47 = <0>,"-1-2-3+4";
239 + combine = <0>, "!5";
242 --- a/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts
243 +++ b/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts
246 - * Device tree overlay for i2c_bcm2708, i2c1 bus
249 - * dtc -@ -I dts -O dtb -o i2c1-bcm2708-overlay.dtb i2c1-bcm2708-overlay.dts
254 +#include "i2c1-overlay.dts"
257 - compatible = "brcm,bcm2835";
262 - pinctrl-0 = <&i2c1_pins>;
268 - target = <&i2c1_pins>;
269 - pins: __overlay__ {
271 - brcm,function = <4>; /* alt 0 */
278 - compatible = "brcm,bcm2708-i2c";
283 - sda1_pin = <&pins>,"brcm,pins:0";
284 - scl1_pin = <&pins>,"brcm,pins:4";
285 - pin_func = <&pins>,"brcm,function:0";
286 - combine = <0>, "!2";
289 + sda1_pin = <&pins1>,"brcm,pins:0", <&pins2>,"brcm,pins:0";
290 + scl1_pin = <&pins1>,"brcm,pins:4", <&pins1>,"brcm,pins:4";
291 + pin_func = <&pins1>,"brcm,function:0", <&pins2>,"brcm,function:0";
295 +++ b/arch/arm/boot/dts/overlays/i2c1-overlay.dts
301 + compatible = "brcm,bcm2835";
307 + pinctrl-names = "default";
308 + pinctrl-0 = <&i2c1_pins>;
313 + target = <&i2c1_pins>;
314 + pins1: __overlay__ {
316 + brcm,function = <4>; /* alt 0 */
321 + target = <&i2c1_pins>;
322 + pins2: __dormant__ {
323 + brcm,pins = <44 45>;
324 + brcm,function = <6>; /* alt 2 */
331 + compatible = "brcm,bcm2708-i2c";
336 + pins_2_3 = <0>,"=1!2";
337 + pins_44_45 = <0>,"!1=2";
338 + combine = <0>, "!3";