blob: 2d837caab0dbc7b6fbf249fa76a22a2f4ba4f2fc [file] [log] [blame]
Patrick Williams58cf3be2023-10-26 02:38:04 -05001# Default console to use if there is only one host.
2OBMC_CONSOLE_HOST_TTY = "ttyS2"
3
4# TTYs that are reserved for non-console purposes.
5OBMC_CONSOLE_TTY_SKIP = "4"
6
7# Calculate the TTY assignments for the hosts.
8def fb_get_consoles(d):
9 hosts = len(d.getVar('OBMC_HOST_INSTANCES', True).split())
10
11 if hosts <= 1:
12 return d.getVar('OBMC_CONSOLE_HOST_TTY', True)
13
14 skipped = \
15 [ int(i) for i in d.getVar('OBMC_CONSOLE_TTY_SKIP', True).split() ]
16 consoles = \
17 [ f"ttyS{i}" for i in sorted(set(range(0,16)).difference(skipped)) ]
18
19 return " ".join(consoles[:hosts])
20
21OBMC_CONSOLE_TTYS = "${@fb_get_consoles(d)}"
Patrick Williams7c3ee7b2024-02-03 16:52:58 -060022OBMC_CONSOLE_TTYS:fb-nohost = ""
Patrick Williams58cf3be2023-10-26 02:38:04 -050023
24