A20 UARTs enable/disable and module/driver

Started by Klaus, March 12, 2020, 03:51:05 PM

Previous topic - Next topic

Klaus

Hi,

 I would like to build a simple rs485 interface to the A20-OLinuxino-Micro board.

I was looking into utilizing one of the UARTs (6 or 7) on EXT1 or EXT2 and add an external driver chip to it.

While I just find ttyS0 (on 0x01c28000), ttyS1 (on 0x01c29800) and ttyS2 (on 0x01c29c00), it seems all other UARTs are also assigned to a module (serial8250?).
# find /sys/devices/ -name 'ttyS*'
/sys/devices/platform/soc/1c28000,serial/tty/ttyS0
/sys/devices/platform/soc/1c29c00,serial/tty/ttyS2
/sys/devices/platform/soc/1c29800,serial/tty/ttyS1
/sys/devices/platform/serial8250/tty/ttyS6
/sys/devices/platform/serial8250/tty/ttyS4
/sys/devices/platform/serial8250/tty/ttyS7
/sys/devices/platform/serial8250/tty/ttyS5
/sys/devices/platform/serial8250/tty/ttyS3

How can I find out
- which module/driver is used to access ttyS0, ttyS1 and ttyS2
- if ttyS3 - ttyS7 are 'active' and which modile/driver was used
- how do enable/disable any ttySx and/or prevent the kernel to automatically load a module for it ?

I would guess some of it should be done in the device tree. Can someone recommend/link some HowTo's to get started with that?

Thanks in advance,
Klaus

LubOlimex

Technical support and documentation manager at Olimex

Klaus

Thanks for the input, but unfortunately this does not get me any further in regards to drivers/modules. :-(

BTW:  OLIMEX-sunxi-overlays refers to armbian-config System->Hardware.
Here it seems uart2 to uart7 are disabled and could be enabled, but board actually 'finds' uart0 (as ttyS0), uart6 (as ttyS1) and uart7 (as ttyS2) during the boot process. Therefor, in the armbian-config, uart1 is missing and the correct status (enabled) of uart6/7 is not shown. :-(


mauricio

Hello, sorry by the dumb question

I'm using an Olimex A20 Micro

When I try to open serial connection to /dev/ttyS2, I receive

sudo python3 -m serial.tools.miniterm /dev/ttyS2 9600
could not open port '/dev/ttyS2': Could not configure port: (5, 'Input/output error')

Serial command work fine with /dev/ttyS0, I mean , connection stablished

So, I'd like to open (enable) /dev/ttyS2, but I can't figure out  how

I guess my option is to build debian package, from https://github.com/OLIMEX/OLIMEX-sunxi-overlays/tree/master/sun7i-a20

But what to do after that ?, where to place or what to do with that "output" folder files ?

Please any help is appreciated, thanks

JohnS

Do you have /dev/ttyS2 ?

I have, using Debian buster - but I don't know what you used.

(Try some other Olimex image.)

John

LubOlimex

If you use one of the official images you can run script:

~#olinuxino-overlay – it provides easy way to enable or disable different hardware assignments – different I2C, SPI, UART, CAN, PWM, etc;

This is one of our Olimax-made scripts, the rest are:

~#olinuxino-display – allows setting different video output;

~#olinuxino-sd-to-emmc – allows booting from eMMC; transfers the Linux file system from the card to the eMMC memory (if your board has one); boot is placed in SPI flash memory;

~#olinuxino-sd-to-sata – allows booting from the SATA disk; transfers the Linux file system from the card to external SATA disk; boot is placed in SPI flash memory.

The official images for A20-OLinuXino-MICRO can be found here:

http://images.olimex.com/release/a20/


If you don't know what image to use, try the Bionic Base image.
Technical support and documentation manager at Olimex

mauricio

Hello

Thank you !

Yes, I'm using olimex official image A20-OLinuXino-buster-base-20200731-135406.img.7z

I'll try run olinuxino-overlay and comment here my results

Thanks

mauricio

Hello

It works

I just did

#sudo find / -name 'olinuxino-overlay'
#/usr/sbin/olinuxino-overlay
#cd /usr/sbin
#sudo ./olinuxino-overlay

At the opened UI, I selected both

sun7i-a20-uart6.dtbo
sun7i-a20-uart7.dtbo

#sudo reboot

Awesome !!

Thank you all