blob: f6c6652b1660331a3593bf599d5e223c8aa4a126 [file] [log] [blame]
Fathi Boudra422bf772019-12-02 11:10:16 +02001#
Slava Andrianov192ee172025-06-11 15:40:43 -05002# Copyright (c) 2019-2025, 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
Slava Andrianov192ee172025-06-11 15:40:43 -050011set TFA_EVENT_LOG [get_param tfa_log "tfa_event_log"]
12
Fathi Boudra422bf772019-12-02 11:10:16 +020013# Initial boot message won't be present if we're starting at BL31. Skip waiting
Zelalemfd529af2020-08-04 15:09:53 -050014# for them by inspecting the environment variable 'skip_early_boot_msgs'.
Fathi Boudra422bf772019-12-02 11:10:16 +020015if {![info exists ::env(skip_early_boot_msgs)]} {
16 expect_string "Booting Trusted Firmware"
Zelalemfd529af2020-08-04 15:09:53 -050017
18 expect {
Chris Kay78ea2c32022-11-15 12:24:24 +000019 "BL1: Booting BL2" { message "BL2 booting" }
Zelalemfd529af2020-08-04 15:09:53 -050020
21 # Catch all 3 possible BL2 loading error messages, namely:
22 # "Failure in pre image load handling of BL2"
23 # "Failed to load BL2 firmware."
24 # "Failure in post image load handling of BL2"
25 -re "Fail.*load.*BL2" {
Chris Kay78ea2c32022-11-15 12:24:24 +000026 message "BL2 loading error"
Zelalemfd529af2020-08-04 15:09:53 -050027 exit_uart -1
28 }
Harrison Mutaifbadee42025-02-18 10:47:48 +000029 }
Zelalemfd529af2020-08-04 15:09:53 -050030
Harrison Mutaifbadee42025-02-18 10:47:48 +000031 # Capture the event log from TF-A if we are running with measured boot
32 # enabled.
Slava Andrianov192ee172025-06-11 15:40:43 -050033 if {[info exists ::env(measured_boot)] || [info exists ::env(verify_hashes)]} {
34 capture_log $TFA_EVENT_LOG "BL1: Booting BL31|Finished using crypto library"
Harrison Mutaifbadee42025-02-18 10:47:48 +000035 } else {
36 expect_string "BL1: Booting BL31"
37 }
Fathi Boudra422bf772019-12-02 11:10:16 +020038} else {
Chris Kay78ea2c32022-11-15 12:24:24 +000039 message "Skipping early boot messages from BL1 and BL2"
Slava Andrianov192ee172025-06-11 15:40:43 -050040 if {[info exists ::env(verify_hashes)]} {
41 capture_log $TFA_EVENT_LOG "BL1: Booting BL31|BL2: Booting BL31|Finished using crypto library"
42 }
Fathi Boudra422bf772019-12-02 11:10:16 +020043}