RS485 support in kernel 4.1.12-ti-r28

Hey all,

I’m currently using the latest Debian Jessie image (2015-11-08) on my Beaglebone Black.
I want to use UART4 as RS485 interface and use gpio3_19 as DE/RE signal.

The device tree overlay which I use to configure the pinmux settings can be found here:
https://github.com/Sillern/BB-RS485/blob/master/BB-RS485-00A0.dts

When I load this overlay and try to configure the port in my C program, I always get the error message “inappropriate ioctl for device”
when using the command
ioctl( fd, TIOCSRS485, &rs485conf )
where rs485conf is a struct serial_rs485

The image uses kernel version 4.1.12-ti-r28. Has this kernel version RS485 support enabled for the UART interfaces?
If not, is there a kernel version (preferable 4.1.X) which supports RS485 on the UARTs of the BBB?

Any help appreciated!
Regards,
Florian

There are a few patches being discussed, please follow

http://www.spinics.net/lists/linux-serial/msg19564.html

http://www.spinics.net/lists/linux-serial/

I'd like to backport what ever comes out of above ^

Regards,

Hi Florian,

I'm currently using the latest Debian Jessie image (2015-11-08) on my Beaglebone Black.
I want to use UART4 as RS485 interface and use gpio3_19 as DE/RE signal.

The device tree overlay which I use to configure the pinmux settings can be found here:
BB-RS485/BB-RS485-00A0.dts at master · Sillern/BB-RS485 · GitHub

When I load this overlay and try to configure the port in my C program, I always get the error message "inappropriate ioctl for device"
when using the command
ioctl( fd, TIOCSRS485, &rs485conf )
where rs485conf is a struct serial_rs485

The image uses kernel version 4.1.12-ti-r28. Has this kernel version RS485 support enabled for the UART interfaces?
If not, is there a kernel version (preferable 4.1.X) which supports RS485 on the UARTs of the BBB?

The 4.x-series ti kernels use the omap8250 driver which does not
have RS485 support (yet). An initial patchset was just recently
submitted for 8250 support of RS485 but needs some more work before
it will be accepted into mainline (4.5 at the earliest).

If you can build your own kernel, you can switch back to the
omap-serial driver which still offers RS485 support. Note if you
do switch, you will need to change your user-space console/tty ports
back to ttyO*.

Regards,
Peter Hurley

Not now I’m going to use RS485 working on the kernel 4.1 . ( I used 3.8 before ) .

Robert.N the patches are not exactly what we want for the beaglebone black ( 8250_fintek 8250_lpc18xx ) ; correct me if I’m wrong.

And most of the time we don’t use the hardware control of the PIN, We use other Pins to control the DE/RE .

Floriant, I don’t have time yet to work on this case, ( maybe on december ). But could you do some test on your own ?

That the official documentation of the RS485 with the kernel 4.1 :
http://lxr.free-electrons.com/source/Documentation/serial/serial-rs485.txt?v=4.1

Also I remember that the kernel 4.1 is build by default with not the OMAP configured, you need to build the kernel yourself :

git clone https://github.com/RobertCNelson/bb-kernel.git

and activate omap as a serial driver.

Micka,

Not for November 23, since I will be on a business trip next week. But after that I will try to look into it.

Robert.N the patches are not exactly what we want for the beaglebone black ( 8250_fintek 8250_lpc18xx ) ; correct me if I'm wrong.

That's not correct; the patches pointed to by Robert add software-driven
RTS control for RS485.

And most of the time we don't use the hardware control of the PIN, We use other Pins to control the DE/RE .

Good point, thanks.

Regards,
Peter Hurley

Well rs485 already work with the kernel 4.1 :

http://lxr.free-electrons.com/source/drivers/tty/serial/omap-serial.c#L293

There is everything that we need there !

But it’s with the driver omap which is what we want to avoid now …