Add support to specify payload UART

UART used by payload(such as tftf, Linux) may not be the same as the
primary UART. Set a run environment variable to track the payload
UART which is tracked to check if the test has finished sucessfully.

If not specified, payload UART is same as primary UART.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I951eb0e6a09e31a92587a837b168c5084c508901
diff --git a/script/build_package.sh b/script/build_package.sh
index a52b3f3..e15eaf4 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -268,6 +268,14 @@
 		echo "Primary UART set to UART$uart."
 		set_run_env "primary_uart" "$uart"
 	fi
+
+	# UART used by payload(such as tftf, Linux) may not be the same as the
+	# primary UART. Set a run environment variable to track the payload
+	# UART which is tracked to check if the test has finished sucessfully.
+	if upon "$set_payload_uart"; then
+		echo "Payload uses UART$uart."
+		set_run_env "payload_uart" "$uart"
+	fi
 }
 
 # Extract a FIP in $1 using fiptool