omap serial driver rs485 loopback

Hi,
I’m using omap serial driver to do some rs485 writing and reading. The rts gpio is toggling correctly and the RE pin is grounded, so rx is always enabled.
Have done test with other rs485 board and it can write and read.

The issue is that the uart is not receiving what it has wrote, so can’t check if a bus collision occurs when writing.
I have been using the same setup with the 8250 serial driver but with manual rts toogling and the loopback was ok.

Is this the expected behavior of the omap serial driver?
Is possible to configure to enable loopback?

using kernel
4.14.63-bone16

Thanks,
Pablo

looking in the source of the driver found this.

if ((up->rs485.flags & SER_RS485_ENABLED) &&
!(up->rs485.flags & SER_RS485_RX_DURING_TX))
serial_omap_stop_rx(port);

suppose that i need to set this flag.
SER_RS485_RX_DURING_TX

This is done in the .dts file or in runtime?

Thanks,
Pablo

Adding rs485-rx-during-tx to the .dts do the trick.

fragment@2 {
target = <&uart2>;
overlay {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&pb_uart2_rs485_pins>;
rs485-rts-delay = <0 0>;

rts-gpio = <&gpio2 25 1>; /* GPIO_ACTIVE_HIGH>; */
rs485-rts-active-high;
rs485-rx-during-tx;
linux,rs485-enabled-at-boot-time;
};
};

Thanks