This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM335X: RS485 issue with kernel 4.4

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

I'm trying to make RS485 function work on our platform with kernel 4.4.x but have some problems.

I did the below modifications on the TI-kernel 4.4.19(ti-processor-sdk-linux-am335x-evm-03.01.00.06):

1. Kernel config:

    disable  CONFIG_SERIAL_8250_OMAP
    enable   CONFIG_SERIAL_OMAP

2.  Device tree:  (I use uart2 to be RS485-port)

uart2_pins: uart2_pins {                                                                                                                                                                             
                pinctrl-single,pins = <
                        0xc4 (PIN_OUTPUT | MUX_MODE7)           /* lcd_data9.gpio2[15] */
                        0x150 (PIN_INPUT | MUX_MODE1)           /* spi0_sclk.uart2_rxd */
                        0x154 (PIN_OUTPUT | MUX_MODE1)          /* spi0_d0.uart2_txd */
                >;
 };

&uart2 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart2_pins>;                                                                                                                                                                           
        status = "okay";
        rts-gpio = <&gpio2 15 GPIO_ACTIVE_HIGH>;
        rs485-rts-active-high;
        rs485-rts-delay = <0 0>;
        linux,rs485-enabled-at-boot-time;
};

The RS485 only can send/receiver data properly in the first 2~3 bytes.

I setup two devices and did the test by the following commands:


Device A:

root@am335x-evm:~# stty -F /dev/ttyO2 115200 -echo

root@am335x-evm:~# echo "abcdefghij" > /dev/ttyO2
root@am335x-evm:~# echo "abcdefghij" > /dev/ttyO2

Device B:

root@am335x-evm:~# stty -F /dev/ttyO2 115200 -echo
root@am335x-evm:~# cat /dev/ttyO2
abcdedghIn
abdmfghkj


The same config and hardware can work normal on kernel 3.14.x.

I have tried to port the omap-serial.c from kernel 3.14.x to kernel 4.4.x but have the same result.

Please give me some help.

Thanks.