Repository navigation
Description
Describe the bug
I used several SC16IS752 on a Pi 4.
After the Last Update, the ttySCx devices are not longer available. After downgrading, the devices are available again. (4.19)
Seems the devices are recognized correct, but the device in /dev/ are not created.
Any Idears?
System
Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
- Which model of Raspberry Pi? e.g. Pi3B+, PiZeroW
PI4 - Which OS and version (
cat /etc/rpi-issue)?
Raspberry Pi reference 2019-07-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 175dfb027ffabd4b8d5080097af0e51ed9a4a56c, stage5 - Which firmware version (
vcgencmd version)?
Jul 17 2020 10:59:17
Copyright (c) 2012 Broadcom
version 21a15cb094f41c7506ad65d2cb9b29c550693057 (clean) (release) (start) - Which kernel version (
uname -a)?
Linux marine-control-server 5.4.51-v8+ 4.19.97 Booting RPi 4 with rootfs on SSD on USB 3 hub fails firmware#1329 SMP PREEMPT Wed Jul 29 10:33:36 BST 2020 aarch64 GNU/Linux
Logs
-dmesg:
[ 5.551930] serial serial0: tty port ttySC0 registered
[ 5.583411] serial serial1: tty port ttySC1 registered
[ 5.620841] serial serial2: tty port ttySC2 registered
[ 5.626098] serial serial3: tty port ttySC3 registered
[ 5.641702] serial serial4: tty port ttySC4 registered
[ 5.646916] serial serial5: tty port ttySC5 registered
-sudo vcdbg log msg
005693.525: brfs: File read: /mfs/sd/overlays/sc16is752-i2c.dtbo
005744.434: Loaded overlay 'sc16is752-i2c'
005744.463: dtparam: int_pin=13
005744.950: dtparam: addr=0x4c
005745.863: dtparam: xtal=14745600
005893.915: brfs: File read: 1356 bytes
005895.258: brfs: File read: /mfs/sd/overlays/sc16is752-i2c.dtbo
005946.342: Loaded overlay 'sc16is752-i2c'
005946.366: dtparam: int_pin=12
005946.834: dtparam: addr=0x49
005947.744: dtparam: xtal=14745600
006097.264: brfs: File read: 1356 bytes
006098.597: brfs: File read: /mfs/sd/overlays/sc16is752-i2c.dtbo
006149.818: Loaded overlay 'sc16is752-i2c'
006149.841: dtparam: int_pin=6
006150.311: dtparam: addr=0x48
006151.224: dtparam: xtal=14745600
-cat /proc/tty/drivers
unknown /dev/ttySC 235 0-7 serial
Additional context
Add any other relevant context for the problem.
Activity
Thomas-GeDaD commentedon Jul 29, 2020
pelwell commentedon Jul 29, 2020
To be clear, you are saying that the kernel driver is outputing:
and the output from
cat /proc/tty/driversinclude:but that there is no
/dev/ttySC*?Thomas-GeDaD commentedon Jul 29, 2020
yes, exactly
pelwell commentedon Jul 29, 2020
Try this:
sudo udevadm monitor -pin one terminal.sudo dtoverlay sc16is752-i2c int_pin=13 addr=0x4c xtal=14745600.Thomas-GeDaD commentedon Jul 29, 2020
KERNEL[96.856680] add /devices/platform/soc/fe804000.i2c/i2c-1/1-004c (i2c)
ACTION=add
DEVPATH=/devices/platform/soc/fe804000.i2c/i2c-1/1-004c
SUBSYSTEM=i2c
OF_NAME=sc16is752
OF_FULLNAME=/soc/i2c@7e804000/sc16is752@4c
OF_COMPATIBLE_0=nxp,sc16is752
OF_COMPATIBLE_N=1
MODALIAS=of:Nsc16is752T(null)Cnxp,sc16is752
SEQNUM=1789
KERNEL[96.884522] add /module/regmap_i2c (module)
ACTION=add
DEVPATH=/module/regmap_i2c
SUBSYSTEM=module
SEQNUM=1790
KERNEL[96.887343] add /module/regmap_spi (module)
ACTION=add
DEVPATH=/module/regmap_spi
SUBSYSTEM=module
SEQNUM=1791
UDEV [96.892598] add /module/regmap_i2c (module)
ACTION=add
DEVPATH=/module/regmap_i2c
SUBSYSTEM=module
SEQNUM=1790
USEC_INITIALIZED=96889007
UDEV [96.892770] add /module/regmap_spi (module)
ACTION=add
DEVPATH=/module/regmap_spi
SUBSYSTEM=module
SEQNUM=1791
USEC_INITIALIZED=96891677
KERNEL[96.893584] add /module/sc16is7xx (module)
ACTION=add
DEVPATH=/module/sc16is7xx
SUBSYSTEM=module
SEQNUM=1792
KERNEL[96.894100] add /bus/i2c/drivers/sc16is7xx (drivers)
ACTION=add
DEVPATH=/bus/i2c/drivers/sc16is7xx
SUBSYSTEM=drivers
SEQNUM=1793
KERNEL[96.894241] add /bus/spi/drivers/sc16is7xx (drivers)
ACTION=add
DEVPATH=/bus/spi/drivers/sc16is7xx
SUBSYSTEM=drivers
SEQNUM=1794
UDEV [96.897778] add /devices/platform/soc/fe804000.i2c/i2c-1/1-004c (i2c)
ACTION=add
DEVPATH=/devices/platform/soc/fe804000.i2c/i2c-1/1-004c
SUBSYSTEM=i2c
OF_NAME=sc16is752
OF_FULLNAME=/soc/i2c@7e804000/sc16is752@4c
OF_COMPATIBLE_0=nxp,sc16is752
OF_COMPATIBLE_N=1
MODALIAS=of:Nsc16is752T(null)Cnxp,sc16is752
SEQNUM=1789
USEC_INITIALIZED=96859644
UDEV [96.898261] add /bus/spi/drivers/sc16is7xx (drivers)
ACTION=add
DEVPATH=/bus/spi/drivers/sc16is7xx
SUBSYSTEM=drivers
SEQNUM=1794
USEC_INITIALIZED=96898036
UDEV [96.898925] add /bus/i2c/drivers/sc16is7xx (drivers)
ACTION=add
DEVPATH=/bus/i2c/drivers/sc16is7xx
SUBSYSTEM=drivers
SEQNUM=1793
USEC_INITIALIZED=96898701
UDEV [96.899796] add /module/sc16is7xx (module)
ACTION=add
DEVPATH=/module/sc16is7xx
SUBSYSTEM=module
SEQNUM=1792
USEC_INITIALIZED=96899559
=> No ttySCx available
pelwell commentedon Jul 29, 2020
A kernel configuration change in our 5.4 tree (
CONFIG_SERIAL_DEV_BUS=y) has had the unintended consequence of preventing the char device from being created. More time is needed to understand why the other serial devices are unaffected and whether this is fixable.pelwell commentedon Jul 29, 2020
See #3682 for some context.
pelwell commentedon Jul 29, 2020
[ Issue moved to the linux repo ]
gentoo-root commentedon Jul 30, 2020
Without this config option,
of_serdev_register_devicesdoesn't run. What is function does is, when some subnodes are defined in DT of the serial device, and it probes their drivers. Later on,tty_port_register_device_attr_serdevlooks at the return code ofserdev_tty_port_registerand skips creating the TTY device if any child devices were registered byof_serdev_register_devices. The purpose is to prevent exposing the TTY device to the userspace if some kernel driver uses the same netdev simultaneously, which makes sense.In our case, I see that
sc16is752-i2c-overlay.dtsdefines a sc16is752 serial device with one child: sc16is752_clk. So, the driver for this sc16is752_clk device is probed and it uses the serdev, that's why it's not exposed as a TTY device to the userspace.Unfortunately, I have no knowledge of what this device is, so I don't know if this clk device is needed or not. It looks like it's some auxiliary device needed by the serial port that doesn't actually interfere with it. We need to understand if it's needed, because I think the clk device wasn't probed before
CONFIG_SERIAL_DEV_BUS=y(or was it probed in a different way? Please advise). Workarounds could be to blacklist the clk driver, disable this subnode (with a dtparam?), remove it, but if it's actually needed, we need to find some other way, and we need to understand how it was probed before. RevertingCONFIG_SERIAL_DEV_BUStomin defconfig is not a good option, we need to find the real root cause, because probing of the device in topic shouldn't break if we enable additional kernel options.HiassofT commentedon Jul 30, 2020
The sc16is75x overlays are a bit odd, the fixed-clock node should probably be moved to / (or /clocks?), as it's probably an external oscillator, not a clock output provided by the device.
Thomas-GeDaD commentedon Jul 30, 2020
Yes the clock can define by an external oscillator. Typicly xtal=14745600
connection-reset commentedon Jul 30, 2020
As far as I understand the clock frequency is required or else the chip will not function [1, page 16f., 7.8 Programmable baud rate generator].
The device tree bindings support setting the clock frequency directly via the
clock-frequencyproperty instead of referencing a clock [2], the ttySC* devices get created in /dev and work just like before.pelwell commentedon Jul 30, 2020
The reason the fixed clock (an expensive way to wrap an integer) is embedded within the sc16is75x node is to guarantee that it is unique. The firmware doesn't automatically uniquify node names that clash, resulting in phandles getting overwritten and the ensuing mayhem, but there are other options that I'm exploring.
overlays: Fix sc16is75x overlays w.r.t. serdev
14 remaining items
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
overlays: Fix sc16is75x overlays w.r.t. serdev
Aalococo commentedon Dec 1, 2020
Hi there,
im not really into dt overlays but i have a similar Problem . I recently updated my pi 3 and now cant find ttySC0 and SC1 anymore as described above. I can find the following lines in dmesg after booting:
[ 7.778335] serial serial0: tty port ttySC0 registered
[ 7.778926] serial serial1: tty port ttySC1 registered
As i understand for some of you the Problem got solved but i cant figure out how ?
pelwell commentedon Dec 1, 2020
You say you aren't into overlays, but are you using one?
If you read through the above comments carefully you find that there were two significant changes:
These changes have been present in all kernels released since the end of August.
Aalococo commentedon Dec 1, 2020
thanks pelwell for the quick answer. Yes im using one but i made it copying together stuff that i dont quite understand enough to debug it myself. I added aditional aditional spi channels and the sc16 to my dt:
I understand i have to change something about my fixed-clock but i dont know what to do about it ? Here is my overlay:
`/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2837", "brcm,bcm2708", "brcm,bcm2709";
};
`
pelwell commentedon Dec 1, 2020
Move it to the top level - this is one of the official overlays: https://github.com/raspberrypi/linux/blob/rpi-5.4.y/arch/arm/boot/dts/overlays/sc16is752-spi0-overlay.dts
You can just copy fragment 2:
Aalococo commentedon Dec 1, 2020
Thanks a million times :)
vohum commentedon Feb 22, 2021
Hi I have problem with my custom board, I tried write dts for my board
CS-gpios: 8 7 25 16 23
CS0 - SC16IS752 (IRQ 24)
CS1 - MCP2515
CS2 - RFID RC522 module
CS3 - RFID RC522 module
CS4 - SC16IS752 (IRQ 27)
I think device init correcty
But any SPI device don't work, and cs is set to low level
mondocata commentedon Oct 18, 2023
Same issue here, after the new verion of Raspbian from May or October.
Until now i can't find the right solution to work my Waveshare 2-CH RS 485 HAT.
In the past i used this in config :
dtoverlay=sc16is752-spi1,int_pin=24,addr=0x48