fix: ensure non-standard FVP UART port schemes are respected
Change-Id: I75acd7c1b1cfc7a1e6c4fd22494a351d4ae7f65b
Signed-off-by: Chris Kay <chris.kay@arm.com>
(cherry picked from commit 24d039f93ce6d4373e2a8a23c511ebd872911e5a)
diff --git a/utils.sh b/utils.sh
index cbf6805..ead6ce7 100644
--- a/utils.sh
+++ b/utils.sh
@@ -366,6 +366,26 @@
get_uart_env "${1:?}" "${2:?}" port "${3-${default}}"
}
+# Set a UART environment variable.
+#
+# UART environment variables are the UART-specific environment variables
+# configured by the CI's test configuration.
+#
+# Usage: set_uart_env <archive> <uart> <variable> <value>
+set_uart_env() {
+ local path="$(get_uart_env_path "${1:?}" "${2:?}")"
+
+ mkdir -p "${path}" && \
+ echo "${4:?}" > "${path}/${3:?}"
+}
+
+# Set the FVP port for a given UART.
+#
+# Usage: set_uart_port <archive> <uart> <port>
+set_uart_port() {
+ set_uart_env "${1:?}" "${2:?}" port "${3:?}"
+}
+
# Make a temporary directory/file insdie workspace, so that it doesn't need to
# be cleaned up. Jenkins is setup to clean up workspace before a job runs.
mktempdir() {