Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 1 | # |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 2 | # Copyright (c) 2019-2025, Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
Zelalem | fd529af | 2020-08-04 15:09:53 -0500 | [diff] [blame] | 6 | # Script to interact with AArch64 Trusted Firmware-A. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 7 | # |
| 8 | # This script is not standalone and should be sourced by a top expect script. |
| 9 | # |
| 10 | |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 11 | set TFA_EVENT_LOG [get_param tfa_log "tfa_event_log"] |
| 12 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 13 | # Initial boot message won't be present if we're starting at BL31. Skip waiting |
Zelalem | fd529af | 2020-08-04 15:09:53 -0500 | [diff] [blame] | 14 | # for them by inspecting the environment variable 'skip_early_boot_msgs'. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 15 | if {![info exists ::env(skip_early_boot_msgs)]} { |
| 16 | expect_string "Booting Trusted Firmware" |
Zelalem | fd529af | 2020-08-04 15:09:53 -0500 | [diff] [blame] | 17 | |
| 18 | expect { |
Chris Kay | 78ea2c3 | 2022-11-15 12:24:24 +0000 | [diff] [blame] | 19 | "BL1: Booting BL2" { message "BL2 booting" } |
Zelalem | fd529af | 2020-08-04 15:09:53 -0500 | [diff] [blame] | 20 | |
| 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 Kay | 78ea2c3 | 2022-11-15 12:24:24 +0000 | [diff] [blame] | 26 | message "BL2 loading error" |
Zelalem | fd529af | 2020-08-04 15:09:53 -0500 | [diff] [blame] | 27 | exit_uart -1 |
| 28 | } |
Harrison Mutai | fbadee4 | 2025-02-18 10:47:48 +0000 | [diff] [blame] | 29 | } |
Zelalem | fd529af | 2020-08-04 15:09:53 -0500 | [diff] [blame] | 30 | |
Harrison Mutai | fbadee4 | 2025-02-18 10:47:48 +0000 | [diff] [blame] | 31 | # Capture the event log from TF-A if we are running with measured boot |
| 32 | # enabled. |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 33 | 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 Mutai | fbadee4 | 2025-02-18 10:47:48 +0000 | [diff] [blame] | 35 | } else { |
| 36 | expect_string "BL1: Booting BL31" |
| 37 | } |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 38 | } else { |
Chris Kay | 78ea2c3 | 2022-11-15 12:24:24 +0000 | [diff] [blame] | 39 | message "Skipping early boot messages from BL1 and BL2" |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 40 | if {[info exists ::env(verify_hashes)]} { |
| 41 | capture_log $TFA_EVENT_LOG "BL1: Booting BL31|BL2: Booting BL31|Finished using crypto library" |
| 42 | } |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 43 | } |