tc2: capture RSS UART output

On TC2 FVP, RSS firmware prints messages on a third UART (in addition
to the "usual" UARTs used by AP and SCP firmwares). Add support for
monitoring this extra UART.

This means its output will be captured in a text file, which can be
later examined offline from the artefacts directory.

More importantly, this will make sure that some process consumes the
data produced on this UART, which if it wasn't, could make the FVP
stall (we've faced this issue before).

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I9c13b2670ddefa85b4277432c692a21d99563d36
diff --git a/model/tc-ports.awk b/model/tc-ports.awk
index 9689612..b3bdb0d 100644
--- a/model/tc-ports.awk
+++ b/model/tc-ports.awk
@@ -1,11 +1,12 @@
 #
-# Copyright (c) 2021, Arm Limited. All rights reserved.
+# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 
 /terminal_s0/ { ports[0] = $NF }
 /terminal_s1/ { ports[1] = $NF }
+/terminal_uart_ap/ { ports[2] = $NF }
 END {
 	for (i = 0; i < num_uarts; i++) {
 		if (ports[i] != "")
diff --git a/run_config/fvp-linux.tc b/run_config/fvp-linux.tc
index e6c488c..af6aae1 100644
--- a/run_config/fvp-linux.tc
+++ b/run_config/fvp-linux.tc
@@ -24,6 +24,9 @@
 	# RSS is applicable to TC2
 	if [ $plat_variant -eq 2 ]; then
 
+	    # Hold RSS terminal_uart_ap
+	    uart="2" file="hold_uart.exp" track_expect
+
 	    sign_image() {
                 # $1 ... host binary name to sign
 		# $2 ... image load address
diff --git a/run_config/fvp-tc2 b/run_config/fvp-tc2
index 865d6d0..4a8a81b 100644
--- a/run_config/fvp-tc2
+++ b/run_config/fvp-tc2
@@ -13,7 +13,7 @@
 	model_build="17" \
 	gen_model_params
 	set_run_env "ports_script" "$ci_root/model/tc-ports.awk"
-	set_run_env "num_uarts" "2"
+	set_run_env "num_uarts" "3"
 	uart="1" set_expect_variable "num_cpus" "8"
 	model="$model" gen_fvp_yaml
 }