-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add RS485 mode support for UART2, UART3, UART4, and UART5. #6820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RS485 mode support for UART2, UART3, UART4, and UART5. #6820
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one minor comment from me.
arch/arm/boot/dts/overlays/README
Outdated
parameter, as RTS is required (default off). | ||
rs485_invert_rts When RS485 mode is enabled, inverts the RTS | ||
line from active-high (default) to active-low | ||
(default off). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what you mean by "default off" here. You've already said the default is active-high. Applies to the other instances too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :) I meant that "rs485_invert_rts" is default off, but I appreciate that could cause confusion - would it be better if I just removed the last line of rs485_invert_rts on each instance?
Thank you - I've amended the potentially confusing documentation in a new commit. |
kernel: Add driver for the Waveshare DSI-TOUCH series panels See: raspberrypi/linux#6566 kernel: Add support for TI ADS7828/ADS7830 I2C ADCs See: raspberrypi/linux#6819 kernel: Add RS485 mode support for UART2, UART3, UART4, and UART5 See: raspberrypi/linux#6820
kernel: Add driver for the Waveshare DSI-TOUCH series panels See: raspberrypi/linux#6566 kernel: Add support for TI ADS7828/ADS7830 I2C ADCs See: raspberrypi/linux#6819 kernel: Add RS485 mode support for UART2, UART3, UART4, and UART5 See: raspberrypi/linux#6820
This patch adds RS485 mode support for UART2/3/4/5.
This allows the RTS line to be used to drive the OE pin of an RS485 transceiver (i.e. MAX3078E).
I needed this for a project & it would be useful to have in-tree.
The "ctsrts" override is automatically activated, as this is required to enable the RTS line; there are also overrides to invert the RTS signal, and to set the RTS on and off delays to change the RTS timing around data transmission.
I haven't made changes to uart0-overlay.dts or uart1-overlay.dts as the syntax is quite different, I'm guessing this is legacy.
I also haven't made changes to uartX-pi5-overlay.dts as I'm unable to test these due to them being Pi5-only.
Tested and working OK on a CM4 with a pair of MAX3078E transceivers, overrides in /boot/firmware/config.txt as follows:
dtoverlay=uart3,rs485
dtoverlay=uart4,rs485
Credit to 6by9 for pretty much all of the device tree modifications here.
The associated forum thread is available here:
https://forums.raspberrypi.com/viewtopic.php?p=2311800