W dniu 2018-11-15 o 08:36, Uwe Kleine-König pisze:
Hello,
On Wed, Nov 14, 2018 at 11:33:25PM +0100, Adam Rudziński wrote:
returning to our discussion on incorrect handling of CTSb used as "driver
enable" by SERIAL_IMX driver in RS485 mode, I've made the fix I was able to,
ie. the simple one with just keeping the receiver of the UART on. Eventually
this got tested in action and worked fine.
The kernel I used is a version of ancient 4.14.39, possibly with some
vendor-specific patches. I tried to compare it with the most recent
long-term 4.14.81, but there are changes which I can't interpret without
deeper studies (however, it seems to me that the original problem would
still be present). Newer kernels have even more differences.
If such fix could be useful, and somebody feels like undertaking the effort
to implement it in a proper way, the fix can be found under this address
(along with a short description):
http://arf.net.pl/iMX6/RS485fix.html
How does the relevant part of your dts look like? Did you try to use a
gpio instead of the hardware function "CTS" as rts?
Best regards
Uwe
It goes like this, first in dtsi:
&uart5 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart5>;
uart-has-rtscts;
status = "disabled";
};
and then in dts for the board:
&uart5 {
rs485-rts-active-high;
linux,rs485-enabled-at-boot-time;
status = "okay";
};
The device tree has been prepared by the module vendor, I have just
trimmed it down to what was necessary in my application.
I haven't tried to use gpio. We've discussed that, but eventually that
would require to rewrite the driver and also I don't know how to
implement it correctly and according to Linux fashion. Too much for a
hardware guy who digs into code of Linux for the first time...
Best regards,
Adam