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