lopper:assists:petalinuxconfig: predict Linux tty device names for se… - #791
Merged
Conversation
…rial nodes
Emit a `tty_device` field (ttyPS0, ttyUL0, ...) for each serial slave in
sys_hw_data.yaml, reproducing how the kernel serial drivers allocate their
tty line numbers so downstream tooling can map a UART to its Linux console.
The tty prefix is taken from the input schema (sdt_ipinfo.yaml)
`console_prefix` field, matched via the node's compatible string. The line
number is allocated per the actual driver behavior:
- Alias-honoring drivers (ttyPS/xilinx_uartps, ttyAMA/amba-pl011) call
of_alias_get_id("serial"), so a node's serialN alias id becomes the tty
line directly (gaps allowed).
- Dynamic drivers (ttyUL/uartlite, ttyS/8250) ignore the serial alias and
use an explicit `port-number` property, otherwise the next free line in
probe order.
Fixed lines (alias id / port-number) are reserved first, then the remaining
nodes fall back to the lowest free line per prefix, avoiding collisions.
Also drop the redundant `serial_port` field (the info is already carried by
`aliases`) and precompute a compatible->console_prefix lookup so prefix
resolution is O(1) per node instead of rescanning the schema each time.
Signed-off-by: Raju Kumar Pothuraju <rajukumar.pothuraju@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rial nodes
Emit a
tty_devicefield (ttyPS0, ttyUL0, ...) for each serial slave in sys_hw_data.yaml, reproducing how the kernel serial drivers allocate their tty line numbers so downstream tooling can map a UART to its Linux console.The tty prefix is taken from the input schema (sdt_ipinfo.yaml)
console_prefixfield, matched via the node's compatible string. The line number is allocated per the actual driver behavior:port-numberproperty, otherwise the next free line in probe order.Fixed lines (alias id / port-number) are reserved first, then the remaining nodes fall back to the lowest free line per prefix, avoiding collisions.
Also drop the redundant
serial_portfield (the info is already carried byaliases) and precompute a compatible->console_prefix lookup so prefix resolution is O(1) per node instead of rescanning the schema each time.