blob: f2c4e992418fbe3a52b64c63dab3f2bef834f815 [file] [log] [blame]
Fathi Boudra422bf772019-12-02 11:10:16 +02001#
Zelalemfd529af2020-08-04 15:09:53 -05002# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
Fathi Boudra422bf772019-12-02 11:10:16 +02003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
Zelalemfd529af2020-08-04 15:09:53 -05006# Script to interact with AArch64 Trusted Firmware-A.
Fathi Boudra422bf772019-12-02 11:10:16 +02007#
8# This script is not standalone and should be sourced by a top expect script.
9#
10
11# Initial boot message won't be present if we're starting at BL31. Skip waiting
Zelalemfd529af2020-08-04 15:09:53 -050012# for them by inspecting the environment variable 'skip_early_boot_msgs'.
Fathi Boudra422bf772019-12-02 11:10:16 +020013if {![info exists ::env(skip_early_boot_msgs)]} {
14 expect_string "Booting Trusted Firmware"
Zelalemfd529af2020-08-04 15:09:53 -050015
16 expect {
Chris Kay78ea2c32022-11-15 12:24:24 +000017 "BL1: Booting BL2" { message "BL2 booting" }
Zelalemfd529af2020-08-04 15:09:53 -050018
19 # Catch all 3 possible BL2 loading error messages, namely:
20 # "Failure in pre image load handling of BL2"
21 # "Failed to load BL2 firmware."
22 # "Failure in post image load handling of BL2"
23 -re "Fail.*load.*BL2" {
Chris Kay78ea2c32022-11-15 12:24:24 +000024 message "BL2 loading error"
Zelalemfd529af2020-08-04 15:09:53 -050025 exit_uart -1
26 }
Harrison Mutaifbadee42025-02-18 10:47:48 +000027 }
Zelalemfd529af2020-08-04 15:09:53 -050028
Harrison Mutaifbadee42025-02-18 10:47:48 +000029 # Capture the event log from TF-A if we are running with measured boot
30 # enabled.
31 if {[info exists ::env(measured_boot)]} {
Harrison Mutaicfe90f32025-05-06 15:26:04 +000032 capture_log tfa_event_log "BL1: Booting BL31|Finished using crypto library"
Harrison Mutaifbadee42025-02-18 10:47:48 +000033 } else {
34 expect_string "BL1: Booting BL31"
35 }
Fathi Boudra422bf772019-12-02 11:10:16 +020036} else {
Chris Kay78ea2c32022-11-15 12:24:24 +000037 message "Skipping early boot messages from BL1 and BL2"
Fathi Boudra422bf772019-12-02 11:10:16 +020038}