Skip to content

Commit 653033c

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 95122c3 commit 653033c

File tree

6 files changed

+105
-0
lines changed

6 files changed

+105
-0
lines changed

arch/arm/boot/dts/overlays/README

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

53815395

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

53955423

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

54215463

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

54475503

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

54735543

54745544
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)