Skip to content

Commit cf8b0d9

Browse files
Add RS485 mode support for UART2, UART3, UART4, and UART5.
1 parent 57bc100 commit cf8b0d9

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5181,6 +5181,19 @@ Name: uart2
51815181
Info: Enable uart 2 on GPIOs 0-3. BCM2711 only.
51825182
Load: dtoverlay=uart2,<param>
51835183
Params: ctsrts Enable CTS/RTS on GPIOs 2-3 (default off)
5184+
rs485 Enable RS485 mode for using the RTS line to
5185+
drive the OE pin of an RS485 transceiver (i.e.
5186+
MAX3078E); also enables the UARTx ctsrts
5187+
parameter, as RTS is required (default off).
5188+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5189+
line from active-high (default) to active-low
5190+
(default off).
5191+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5192+
milliseconds) between data transmission starting
5193+
and the RTS line being asserted (default 0).
5194+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5195+
milliseconds) between data transmission ending
5196+
and the RTS line being deasserted (default 0).
51845197

51855198

51865199
Name: uart2-pi5
@@ -5193,6 +5206,19 @@ Name: uart3
51935206
Info: Enable uart 3 on GPIOs 4-7. BCM2711 only.
51945207
Load: dtoverlay=uart3,<param>
51955208
Params: ctsrts Enable CTS/RTS on GPIOs 6-7 (default off)
5209+
rs485 Enable RS485 mode for using the RTS line to
5210+
drive the OE pin of an RS485 transceiver (i.e.
5211+
MAX3078E); also enables the UARTx ctsrts
5212+
parameter, as RTS is required (default off).
5213+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5214+
line from active-high (default) to active-low
5215+
(default off).
5216+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5217+
milliseconds) between data transmission starting
5218+
and the RTS line being asserted (default 0).
5219+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5220+
milliseconds) between data transmission ending
5221+
and the RTS line being deasserted (default 0).
51965222

51975223

51985224
Name: uart3-pi5
@@ -5205,6 +5231,19 @@ Name: uart4
52055231
Info: Enable uart 4 on GPIOs 8-11. BCM2711 only.
52065232
Load: dtoverlay=uart4,<param>
52075233
Params: ctsrts Enable CTS/RTS on GPIOs 10-11 (default off)
5234+
rs485 Enable RS485 mode for using the RTS line to
5235+
drive the OE pin of an RS485 transceiver (i.e.
5236+
MAX3078E); also enables the UARTx ctsrts
5237+
parameter, as RTS is required (default off).
5238+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5239+
line from active-high (default) to active-low
5240+
(default off).
5241+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5242+
milliseconds) between data transmission starting
5243+
and the RTS line being asserted (default 0).
5244+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5245+
milliseconds) between data transmission ending
5246+
and the RTS line being deasserted (default 0).
52085247

52095248

52105249
Name: uart4-pi5
@@ -5217,6 +5256,19 @@ Name: uart5
52175256
Info: Enable uart 5 on GPIOs 12-15. BCM2711 only.
52185257
Load: dtoverlay=uart5,<param>
52195258
Params: ctsrts Enable CTS/RTS on GPIOs 14-15 (default off)
5259+
rs485 Enable RS485 mode for using the RTS line to
5260+
drive the OE pin of an RS485 transceiver (i.e.
5261+
MAX3078E); also enables the UARTx ctsrts
5262+
parameter, as RTS is required (default off).
5263+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5264+
line from active-high (default) to active-low
5265+
(default off).
5266+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5267+
milliseconds) between data transmission starting
5268+
and the RTS line being asserted (default 0).
5269+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5270+
milliseconds) between data transmission ending
5271+
and the RTS line being deasserted (default 0).
52205272

52215273

52225274
Name: udrc

arch/arm/boot/dts/overlays/uart2-overlay.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@
1919
};
2020
};
2121

22+
rs485: fragment@2 {
23+
target = <&uart2>;
24+
__dormant__ {
25+
linux,rs485-enabled-at-boot-time;
26+
rs485-rts-delay = <0 0>;
27+
};
28+
};
29+
2230
__overrides__ {
2331
ctsrts = <0>,"=1";
32+
rs485 = <0>,"=1=2";
33+
rs485_invert_rts = <&rs485>,"rs485-rts-active-low";
34+
rs485_rts_on_delay = <&rs485>, "rs485-rts-delay:0";
35+
rs485_rts_off_delay = <&rs485>, "rs485-rts-delay:4";
2436
};
2537
};

arch/arm/boot/dts/overlays/uart3-overlay.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@
1919
};
2020
};
2121

22+
rs485: fragment@2 {
23+
target = <&uart3>;
24+
__dormant__ {
25+
linux,rs485-enabled-at-boot-time;
26+
rs485-rts-delay = <0 0>;
27+
};
28+
};
29+
2230
__overrides__ {
2331
ctsrts = <0>,"=1";
32+
rs485 = <0>,"=1=2";
33+
rs485_invert_rts = <&rs485>,"rs485-rts-active-low";
34+
rs485_rts_on_delay = <&rs485>, "rs485-rts-delay:0";
35+
rs485_rts_off_delay = <&rs485>, "rs485-rts-delay:4";
2436
};
2537
};

arch/arm/boot/dts/overlays/uart4-overlay.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@
1919
};
2020
};
2121

22+
rs485: fragment@2 {
23+
target = <&uart4>;
24+
__dormant__ {
25+
linux,rs485-enabled-at-boot-time;
26+
rs485-rts-delay = <0 0>;
27+
};
28+
};
29+
2230
__overrides__ {
2331
ctsrts = <0>,"=1";
32+
rs485 = <0>,"=1=2";
33+
rs485_invert_rts = <&rs485>,"rs485-rts-active-low";
34+
rs485_rts_on_delay = <&rs485>, "rs485-rts-delay:0";
35+
rs485_rts_off_delay = <&rs485>, "rs485-rts-delay:4";
2436
};
2537
};

arch/arm/boot/dts/overlays/uart5-overlay.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@
1919
};
2020
};
2121

22+
rs485: fragment@2 {
23+
target = <&uart5>;
24+
__dormant__ {
25+
linux,rs485-enabled-at-boot-time;
26+
rs485-rts-delay = <0 0>;
27+
};
28+
};
29+
2230
__overrides__ {
2331
ctsrts = <0>,"=1";
32+
rs485 = <0>,"=1=2";
33+
rs485_invert_rts = <&rs485>,"rs485-rts-active-low";
34+
rs485_rts_on_delay = <&rs485>, "rs485-rts-delay:0";
35+
rs485_rts_off_delay = <&rs485>, "rs485-rts-delay:4";
2436
};
2537
};

0 commit comments

Comments
 (0)