Make sure udev rule only applies to first PL011 UART (#778) (#862)

The to symlink serial0/1 currently might apply to the first or second
ttyAMAX instance. In downstream, a patch makes sure that the first
PL011 is always ttyAMA0. However, upstream the numbering depends on the
UART alias, which leads to the first PL011 being ttyAMA1.

Check the actual iobase too to make sure we are dealing with the first
PL011 instance.

See also:
05cfe136f7 (diff-2678c183f503319c8d8c09c818af789a)
This commit is contained in:
Stefan Agner
2020-09-12 09:08:27 +02:00
committed by GitHub
parent 31fc13cf03
commit f4f6908c80

View File

@@ -1,4 +1,4 @@
KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
KERNEL=="ttyAMA[01]", ATTR{iomem_base}=="0xFE201000", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\