I have an embedded Linux system with 2 built-in serial ports, and a PCI board that adds 8 more.
The kernel enumerates the devices in a way that the port numbers end up getting interleaved, for instance (from dmesg):
[ 5.964467] 0000:03:00.0: ttyS4 at MMIO 0xd0600000 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.964934] 0000:03:00.0: ttyS5 at MMIO 0xd0600400 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.965213] 0000:03:00.0: ttyS6 at MMIO 0xd0600800 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.965519] 0000:03:00.0: ttyS7 at MMIO 0xd0600c00 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.965879] 0000:03:00.0: ttyS8 at MMIO 0xd0601000 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.966755] 0000:00:1e.3: ttyS9 at MMIO 0xd091c000 (irq = 18, base_baud = 2764800) is a 16550A [ 5.967123] 0000:03:00.0: ttyS10 at MMIO 0xd0601400 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.967411] 0000:03:00.0: ttyS11 at MMIO 0xd0601800 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.967705] 0000:03:00.0: ttyS12 at MMIO 0xd0601c00 (irq = 105, base_baud = 7812500) is a XR17V35X [ 5.976690] 0000:00:1e.4: ttyS13 at MMIO 0xd091a000 (irq = 19, base_baud = 2764800) is a 16550A Here the built-in ports got assigned the names ttyS9 and ttyS13 and the expansion ports got ttyS4-8 and ttyS10-12. On the next reboot, the assignment will vary.
Because the port names get shuffled around, I don't have a stable identifier for my kernel command line option console=ttyS4,115200 or for getty.
I can write udev rules that create stable symlinks which might work for getty but don't work for the kernel's command line.
I have tried using the MMIO address for the Linux command line, as in console=uart,mmio32,0xd091c000,115200 and while the system boots, I don't seem to be receiving any kernel output.
How can I stabilize these identifiers?