dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Devices nodes not created

Tue Aug 14, 2018 8:09 am

I'm hoping someone can assist an issue I'm experiencing.

I'm using a Pi-Zero with ArchLinux (taking over an existing project), where a MAX14830 device is being added to provide 4 additional tty ports.

I have a device tree overlay that is called up ib /boot/config.txt, and this seems to work as the driver gets loaded and 4 tty ports (ttyMAX0 to ttyMAX4) get registered. Here's the relevant output from dmesg.

[ 25.655575] max310x: loading out-of-tree module taints kernel.
[ 25.940683] spi0.0: ttyMAX0 at I/O 0x0 (irq = 163, base_baud = 230400) is a MAX14830
[ 25.973206] serial serial0: tty port ttyMAX0 registered
[ 26.000590] spi0.0: ttyMAX1 at I/O 0x20 (irq = 163, base_baud = 230400) is a MAX14830
[ 26.033142] serial serial1: tty port ttyMAX1 registered
[ 26.060612] spi0.0: ttyMAX2 at I/O 0x40 (irq = 163, base_baud = 230400) is a MAX14830
[ 26.093256] serial serial2: tty port ttyMAX2 registered
[ 26.120610] spi0.0: ttyMAX3 at I/O 0x60 (irq = 163, base_baud = 230400) is a MAX14830
[ 26.160203] serial serial3: tty port ttyMAX3 registered

However, there are no ttyMAXx devices listed in /dev, although there is an entry in /proc/devices
[[email protected] alarm]# cat /proc/devices | grep tty
4 tty
5 /dev/tty
5 ttyprintk
204 ttyAMA
204 ttyMAX

Does anyone have a suggestion of how to resolve the issue. I'm open to switching Linux distribution if necessary.

Thanks

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1912
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Devices nodes not created

Thu Aug 16, 2018 2:48 pm

It's not immediately obvious why the /dev nodes aren't appearing. It looks as though the necessary call to device_add() should happen as result of the driver calling uart_add_one_port(). If you really want to debug this I would suggest building your own kernel with "#define DEBUG" added to the start of drivers/tty/serdev/core.c to try and see how far the registration is getting for the different serial devices.

dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Re: Devices nodes not created

Wed Aug 22, 2018 10:33 am

Thank you for the response.

The solution to the problem was a bit more drastic - I changed from ArchLinux back to Raspian, and as if by magic, the device nodes appeared.

I'm still having a few difficulties actually getting serial data in/out of the max14830, but I suspect this is down to interrupts as the overlay I used was for a Pi3, and I'm using a Pi-ZeroW.

Thanks again.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1912
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Devices nodes not created

Wed Aug 22, 2018 10:36 am

Post the source to your overlay and I'll check it for obvious problems.

afaerber
Posts: 1
Joined: Sat Sep 22, 2018 3:56 pm
Location: Germany
Contact: Website

Re: Devices nodes not created

Sat Sep 22, 2018 4:18 pm

This is likely caused by CONFIG_SERIAL_DEV_BUS.
Overlays need to comply strictly with the Device Tree bindings documentation shipped as part of the Linux kernel (https://git.kernel.org/pub/scm/linux/ke ... e/bindings) and not add random nodes in places not explicitly allowed. I would bet that your overlay adds some invalid, e.g., fixed-clock node as child to the SPI sub-node for this chipset out of lazyness. Serial nodes may have only one optional child node though and, if present, the serdev subsystem will try to load a driver and attach it to the tty device as slave.

The trivial fix then is to correct your overlay by moving such extra nodes to the root node (i.e., /) or another suitable place where they are allowed.

Return to “Device Tree”