Skip to content

Commit cd70969

Browse files
giampiero7pelwell
authored andcommitted
overlays: Add rs485 support to uart[0-4]-pi5
Add RS-485 support to UARTs 0 to 4 of Pi 5. Signed-off-by: Giampiero Baggiani <giampiero@sferalabs.cc>
1 parent f45c4eb commit cd70969

6 files changed

Lines changed: 105 additions & 0 deletions

File tree

arch/arm/boot/dts/overlays/README

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5371,6 +5371,20 @@ Name: uart0-pi5
53715371
Info: Enable uart 0 on GPIOs 14-15. Pi 5 only.
53725372
Load: dtoverlay=uart0-pi5,<param>
53735373
Params: ctsrts Enable CTS/RTS on GPIOs 16-17 (default off)
5374+
rs485 Enable RS485 mode for using the RTS line to
5375+
drive the OE pin of an RS485 transceiver (i.e.
5376+
MAX3078E); also enables the UARTx ctsrts
5377+
parameter, as RTS is required (default off).
5378+
rs485_full_duplex When RS485 mode is enabled, enables receiving of
5379+
data while sending data (default off)
5380+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5381+
line from active-high (default) to active-low.
5382+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5383+
milliseconds) between data transmission starting
5384+
and the RTS line being asserted (default 0).
5385+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5386+
milliseconds) between data transmission ending
5387+
and the RTS line being deasserted (default 0).
53745388

53755389

53765390
Name: uart1
@@ -5385,6 +5399,20 @@ Name: uart1-pi5
53855399
Info: Enable uart 1 on GPIOs 0-1. Pi 5 only.
53865400
Load: dtoverlay=uart1-pi5,<param>
53875401
Params: ctsrts Enable CTS/RTS on GPIOs 2-3 (default off)
5402+
rs485 Enable RS485 mode for using the RTS line to
5403+
drive the OE pin of an RS485 transceiver (i.e.
5404+
MAX3078E); also enables the UARTx ctsrts
5405+
parameter, as RTS is required (default off).
5406+
rs485_full_duplex When RS485 mode is enabled, enables receiving of
5407+
data while sending data (default off)
5408+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5409+
line from active-high (default) to active-low.
5410+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5411+
milliseconds) between data transmission starting
5412+
and the RTS line being asserted (default 0).
5413+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5414+
milliseconds) between data transmission ending
5415+
and the RTS line being deasserted (default 0).
53885416

53895417

53905418
Name: uart2
@@ -5411,6 +5439,20 @@ Name: uart2-pi5
54115439
Info: Enable uart 2 on GPIOs 4-5. Pi 5 only.
54125440
Load: dtoverlay=uart2-pi5,<param>
54135441
Params: ctsrts Enable CTS/RTS on GPIOs 6-7 (default off)
5442+
rs485 Enable RS485 mode for using the RTS line to
5443+
drive the OE pin of an RS485 transceiver (i.e.
5444+
MAX3078E); also enables the UARTx ctsrts
5445+
parameter, as RTS is required (default off).
5446+
rs485_full_duplex When RS485 mode is enabled, enables receiving of
5447+
data while sending data (default off)
5448+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5449+
line from active-high (default) to active-low.
5450+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5451+
milliseconds) between data transmission starting
5452+
and the RTS line being asserted (default 0).
5453+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5454+
milliseconds) between data transmission ending
5455+
and the RTS line being deasserted (default 0).
54145456

54155457

54165458
Name: uart3
@@ -5437,6 +5479,20 @@ Name: uart3-pi5
54375479
Info: Enable uart 3 on GPIOs 8-9. Pi 5 only.
54385480
Load: dtoverlay=uart3-pi5,<param>
54395481
Params: ctsrts Enable CTS/RTS on GPIOs 10-11 (default off)
5482+
rs485 Enable RS485 mode for using the RTS line to
5483+
drive the OE pin of an RS485 transceiver (i.e.
5484+
MAX3078E); also enables the UARTx ctsrts
5485+
parameter, as RTS is required (default off).
5486+
rs485_full_duplex When RS485 mode is enabled, enables receiving of
5487+
data while sending data (default off)
5488+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5489+
line from active-high (default) to active-low.
5490+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5491+
milliseconds) between data transmission starting
5492+
and the RTS line being asserted (default 0).
5493+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5494+
milliseconds) between data transmission ending
5495+
and the RTS line being deasserted (default 0).
54405496

54415497

54425498
Name: uart4
@@ -5463,6 +5519,20 @@ Name: uart4-pi5
54635519
Info: Enable uart 4 on GPIOs 12-13. Pi 5 only.
54645520
Load: dtoverlay=uart4-pi5,<param>
54655521
Params: ctsrts Enable CTS/RTS on GPIOs 14-15 (default off)
5522+
rs485 Enable RS485 mode for using the RTS line to
5523+
drive the OE pin of an RS485 transceiver (i.e.
5524+
MAX3078E); also enables the UARTx ctsrts
5525+
parameter, as RTS is required (default off).
5526+
rs485_full_duplex When RS485 mode is enabled, enables receiving of
5527+
data while sending data (default off)
5528+
rs485_invert_rts When RS485 mode is enabled, inverts the RTS
5529+
line from active-high (default) to active-low.
5530+
rs485_rts_on_delay When RS485 mode is enabled, sets the delay (in
5531+
milliseconds) between data transmission starting
5532+
and the RTS line being asserted (default 0).
5533+
rs485_rts_off_delay When RS485 mode is enabled, sets the delay (in
5534+
milliseconds) between data transmission ending
5535+
and the RTS line being deasserted (default 0).
54665536

54675537

54685538
Name: uart5

arch/arm/boot/dts/overlays/uart0-pi5-overlay.dts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
frag0: __overlay__ {
1010
status = "okay";
1111
pinctrl-0 = <&uart0_pins>;
12+
rs485-rts-delay = <0 0>;
1213
};
1314
};
1415

1516
__overrides__ {
1617
ctsrts = <&frag0>,"pinctrl-0:4=",<&uart0_ctsrts_pins>;
18+
rs485 = <&frag0>,"pinctrl-0:4=",<&uart0_ctsrts_pins>,
19+
<&frag0>,"linux,rs485-enabled-at-boot-time?";
20+
rs485_full_duplex = <&frag0>,"rs485-rx-during-tx?";
21+
rs485_invert_rts = <&frag0>,"rs485-rts-active-low?";
22+
rs485_rts_on_delay = <&frag0>,"rs485-rts-delay:0";
23+
rs485_rts_off_delay = <&frag0>,"rs485-rts-delay:4";
1724
};
1825
};

arch/arm/boot/dts/overlays/uart1-pi5-overlay.dts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
frag0: __overlay__ {
1010
status = "okay";
1111
pinctrl-0 = <&uart1_pins>;
12+
rs485-rts-delay = <0 0>;
1213
};
1314
};
1415

1516
__overrides__ {
1617
ctsrts = <&frag0>,"pinctrl-0:4=",<&uart1_ctsrts_pins>;
18+
rs485 = <&frag0>,"pinctrl-0:4=",<&uart1_ctsrts_pins>,
19+
<&frag0>,"linux,rs485-enabled-at-boot-time?";
20+
rs485_full_duplex = <&frag0>,"rs485-rx-during-tx?";
21+
rs485_invert_rts = <&frag0>,"rs485-rts-active-low?";
22+
rs485_rts_on_delay = <&frag0>,"rs485-rts-delay:0";
23+
rs485_rts_off_delay = <&frag0>,"rs485-rts-delay:4";
1724
};
1825
};

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
frag0: __overlay__ {
1010
status = "okay";
1111
pinctrl-0 = <&uart2_pins>;
12+
rs485-rts-delay = <0 0>;
1213
};
1314
};
1415

1516
__overrides__ {
1617
ctsrts = <&frag0>,"pinctrl-0:4=",<&uart2_ctsrts_pins>;
18+
rs485 = <&frag0>,"pinctrl-0:4=",<&uart2_ctsrts_pins>,
19+
<&frag0>,"linux,rs485-enabled-at-boot-time?";
20+
rs485_full_duplex = <&frag0>,"rs485-rx-during-tx?";
21+
rs485_invert_rts = <&frag0>,"rs485-rts-active-low?";
22+
rs485_rts_on_delay = <&frag0>,"rs485-rts-delay:0";
23+
rs485_rts_off_delay = <&frag0>,"rs485-rts-delay:4";
1724
};
1825
};

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
frag0: __overlay__ {
1010
status = "okay";
1111
pinctrl-0 = <&uart3_pins>;
12+
rs485-rts-delay = <0 0>;
1213
};
1314
};
1415

1516
__overrides__ {
1617
ctsrts = <&frag0>,"pinctrl-0:4=",<&uart3_ctsrts_pins>;
18+
rs485 = <&frag0>,"pinctrl-0:4=",<&uart3_ctsrts_pins>,
19+
<&frag0>,"linux,rs485-enabled-at-boot-time?";
20+
rs485_full_duplex = <&frag0>,"rs485-rx-during-tx?";
21+
rs485_invert_rts = <&frag0>,"rs485-rts-active-low?";
22+
rs485_rts_on_delay = <&frag0>,"rs485-rts-delay:0";
23+
rs485_rts_off_delay = <&frag0>,"rs485-rts-delay:4";
1724
};
1825
};

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
frag0: __overlay__ {
1010
status = "okay";
1111
pinctrl-0 = <&uart4_pins>;
12+
rs485-rts-delay = <0 0>;
1213
};
1314
};
1415

1516
__overrides__ {
1617
ctsrts = <&frag0>,"pinctrl-0:4=",<&uart4_ctsrts_pins>;
18+
rs485 = <&frag0>,"pinctrl-0:4=",<&uart4_ctsrts_pins>,
19+
<&frag0>,"linux,rs485-enabled-at-boot-time?";
20+
rs485_full_duplex = <&frag0>,"rs485-rx-during-tx?";
21+
rs485_invert_rts = <&frag0>,"rs485-rts-active-low?";
22+
rs485_rts_on_delay = <&frag0>,"rs485-rts-delay:0";
23+
rs485_rts_off_delay = <&frag0>,"rs485-rts-delay:4";
1724
};
1825
};

0 commit comments

Comments
 (0)