We need to use RS-485 interface on Colibri iMX7 carrier board, which should be pretty simple. Knowledge base states that adding property
linux,rs485-enabled-at-boot-time; enables RS-485 functionality for said serial port, so kernel would automatically control RTS signal as needed.
Unfortunately it seems that kernel version used in BSP V2.7 does not support this property at all, while older kernels actually did. Compare following versions:
As you can see, there is no code handling
linux,rs485-enabled-at-boot-time property in kernel 4.1, while one would assume there would, because knowledge bases includes this information.
While it is still possible to use RS-485 on port using IOCTL call from custom application, it would be nice to device tree binding supported as well.
Is this known issue? What solution is recommended?
Note that the documentation also mentions i.MX 6 only, we did not officially released a beta release for Colibri iMX7 with the 3.14 kernel.
However, since the 4.1 is a shared kernel, and it has been available for the i.MX 6 devices, it is a regression. I created a ticket, it should show up in our roadmap.
It seems that only support for the property is missing. In a quick attempt to fix it I added support for the property with this patch (untested, I don’t have an environment I can test it quickly).
@stefan.tx: Thanks for the patch, I will try that during next week.
@stefan.tx: Looks like patch does not work as expected because
rs485.flags gets overwriten by different piece of code later. I have modified the patch, you can get it here.
I am not sure if
SER_RS485_RX_DURING_TX makes sense as default option, there is some patchwork fixing
linux,rs485-enabled-at-boot-time that also disables this flag in default state and instead gives DT property to enable it, as you can see here.
That seems like a sensible change, classic RS-485 is half-duplex so I guess you don’t need/want the receiver to be active during TX.