blob: 47cfcf38a55c8fc6c769e6bb263f029e12eea4f8 [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)}"
22
23