Skip to content

Commit

Permalink
overlays: Add baudrate parameter to i2c3-i2c6
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Elwell committed Aug 5, 2019
1 parent 41c722d commit a08305b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 12 deletions.
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -1221,27 +1221,35 @@ 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
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
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
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
Expand Down
15 changes: 12 additions & 3 deletions arch/arm/boot/dts/overlays/i2c3-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

fragment@0 {
target = <&i2c3>;
__overlay__ {
frag0: __overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c3_pins>;
clock-frequency = <100000>;
};
};

Expand All @@ -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";
};
};
15 changes: 12 additions & 3 deletions arch/arm/boot/dts/overlays/i2c4-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

fragment@0 {
target = <&i2c4>;
__overlay__ {
frag0: __overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c4_pins>;
clock-frequency = <100000>;
};
};

Expand All @@ -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";
};
};
15 changes: 12 additions & 3 deletions arch/arm/boot/dts/overlays/i2c5-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

fragment@0 {
target = <&i2c5>;
__overlay__ {
frag0: __overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c5_pins>;
clock-frequency = <100000>;
};
};

Expand All @@ -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";
};
};
15 changes: 12 additions & 3 deletions arch/arm/boot/dts/overlays/i2c6-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

fragment@0 {
target = <&i2c6>;
__overlay__ {
frag0: __overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c6_pins>;
clock-frequency = <100000>;
};
};

Expand All @@ -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";
};
};

0 comments on commit a08305b

Please sign in to comment.