mctrl_gpio_set empty?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mctrl_gpio_set empty?

686 Views
jose_au_zone
Contributor II

Hello!

I'm trying to make RS-485 connection work in half-duplex mode on the i.MX8

Found this very similar problem here: https://community.nxp.com/t5/i-MX-Processors/Does-UART-in-RS485-mode-support-only-9-Bit-mode-for-i-M...

Looks like the solution was to add the rs485-enabled-at-boot-time property in the required uart node in the device tree. I searched in the kernel code and this is checked at the function uart_get_rs485_mode. If the property is present the SER_RS485_ENABLED flag is set

But digging deeper into the code, the function that should actually set the RTS pin to the required value is empty.
That function is mctrl_gpio_set which is called by both the function 
imx_uart_rts_active and imx_uart_rts_inactive

That can be checked here

I didn't test in my board yet to see if just adding the rs485-enabled-at-boot-time property enables the half-duplex comm. But I'm curious about why is that function empty in the kernel code

Thank you so much!

0 Kudos
3 Replies

681 Views
igorpadykov
NXP Employee
NXP Employee

Hi jose_au_zone

 

seems it is used in imx.c using "SER_RS485_ENABLED",

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/imx.c?h=imx_5.4.70_2.3....

if (device_property_read_bool(dev, "linux,rs485-enabled-at-boot-time"))

rs485conf->flags |= SER_RS485_ENABLED;

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/serial_core.c?h=imx_5.4...

 

Best regards
igor

0 Kudos

676 Views
jose_au_zone
Contributor II

Thanks for the reply. That I know already, but why the function that would change the RTS line to the appropriate level is empty? That's what I wanted to know

 

Thanks!

0 Kudos

671 Views
igorpadykov
NXP Employee
NXP Employee

 

>why the function that would change the RTS line to the appropriate level is empty?

 

imx_uart_start_tx() seems changes the RTS line, it is not empty :

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/imx.c?h=imx_5.4.70_2.3....

 

Best regards
igor

0 Kudos