Tool/software: Linux
Hello,
I want to get following configuration:
UART0: disabled
UART1: disabled
UART2: RS422
UART3: RS485
UART4: debug
UART5: RS422
My problem is that while using SERIAL_8250 driver RS422 works fine, but RS485 is only receiving, not transmiting.
On the other hand, when I use SERIAL_OMAP driver RS485 works like a charm, but I can't establish connection on RS422 (I have pppd TCP/IP over RS422).
Debug works always.
Whichever driver I use, I'm not changing device tree (maybe that's a mistake?). Device tree looks as follows:
uart2: serial@48024000 { // RS422 ppp pinctrl-names = "default"; pinctrl-0 = <&uart2_pins>; status = "okay"; }; uart3: serial@481a6000 { // RS485 pinctrl-names = "default"; pinctrl-0 = <&uart3_pins>; status = "okay"; rs485-rts-delay = <0 0>; linux,rs485-enabled-at-boot-time; rts-gpio = <&gpio2 17 0>; rs485-rts-active-high; }; uart4: serial@481a8000 { // debug pinctrl-names = "default"; pinctrl-0 = <&uart4_pins>; status = "okay"; }; uart5: serial@481aa000 { // RS422 ppp pinctrl-names = "default"; pinctrl-0 = <&uart5_pins>; status = "okay"; };
uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = < 0x150 ( PIN_INPUT_PULLUP | MUX_MODE1 ) /* (A17) spi0_sclk.uart2_rxd */ 0x154 ( PIN_OUTPUT_PULLDOWN | MUX_MODE1 ) /* (B17) spi0_d0.uart2_txd */ >; }; uart3_pins: pinmux_uart3_pins { pinctrl-single,pins = < 0x160 (PIN_INPUT_PULLUP | MUX_MODE1) /* (C15) spi0_cs1.uart3_rxd */ 0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (C18) ecap0_in_pwm0_out.uart3_txd */ 0xcc ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (U4) lcd_data11.uart3_rtsn */ >; }; uart4_pins: pinmux_uart4_pins { pinctrl-single,pins = < 0x70 (PIN_INPUT_PULLUP | MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */ 0x74 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* (U17) gpmc_wpn.uart4_txd */ >; }; uart5_pins: pinmux_uart5_pins { pinctrl-single,pins = < 0x108 ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (H16) gmii1_col.uart5_rxd */ 0x144 ( PIN_OUTPUT_PULLDOWN | MUX_MODE3 ) /* (H18) rmii1_refclk.uart5_txd */ >; };
Kernel configuration fragment for SERIAL_8250 with working RS422:
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=10
CONFIG_SERIAL_8250_RUNTIME_UARTS=10
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_8250_OMAP=y
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_HW_RANDOM=m
CONFIG_HW_RANDOM_OMAP=m
CONFIG_DEVPORT=y
And for the second case (SERIAL_OMAP with working RS485):
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_OMAP=y
CONFIG_SERIAL_OMAP_CONSOLE=y
CONFIG_HW_RANDOM=m
CONFIG_HW_RANDOM_OMAP=m
CONFIG_DEVPORT=y
configs not listed are not set.
Please help me figure it out. As everything is working (unfortunately not in same time...) I think HW is fine so I don't think posting schematics will be necessary.
Kind regars,
Marek Słomiany