blob: f152335bf1632faac03471721e15042a6ff774b2 [file] [log] [blame]
Fathi Boudra422bf772019-12-02 11:10:16 +02001#
Chris Kay3d2ae332022-11-15 11:32:03 +00002# Copyright (c) 2019-2022 Arm Limited. All rights reserved.
Fathi Boudra422bf772019-12-02 11:10:16 +02003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
Fathi Boudra422bf772019-12-02 11:10:16 +02006# Expect script for TSP
7#
8
9source [file join [file dirname [info script]] handle-arguments.inc]
10
11#
12# Output from TSP:
13#
14# NOTICE: TSP: <version>(<mode>):<commit_id>
15# NOTICE: TSP: Built : <hh:mm:ss>, <date>
16#
17# With 'TSP: Built' message, we assume a successful boot. All further messages
18# are ignored.
19#
20
21# Arbitrary TSP response count during boot. Maybe adjusted as necessary
22set tsp_resp_proof [get_param tsp_resp_proof 1000]
23set tsp_resp_count 0
24
Chris Kay78ea2c32022-11-15 12:24:24 +000025expect_string "TSP: Built" "TSP booted successfully"
Fathi Boudra422bf772019-12-02 11:10:16 +020026
27# TSPD prints more messages only when built with INFO or above.
28set tsp_debug [get_param tsp_debug]
29if {$tsp_debug != ""} {
30 while {1} {
31 expect {
32 # Following CPU power operations, TSP emits sample stats using
33 # the below prefix. After tsp_resp_proof responses during boot,
34 # we're confident TSP is functional; so quit with success.
35 "TSP: cpu" {
36 incr tsp_resp_count
37 if {$tsp_resp_count >= $tsp_resp_proof} {
Chris Kay78ea2c32022-11-15 12:24:24 +000038 message "TSP $tsp_resp_count responses; sufficient"
Fathi Boudra422bf772019-12-02 11:10:16 +020039 break
40 }
41 }
Fathi Boudra422bf772019-12-02 11:10:16 +020042 }
43 }
44}
45
46source [file join [file dirname [info script]] uart-hold.inc]