blob: ce7fba46835b9128386ff9d487be99fa98f5a5f0 [file] [log] [blame]
Fathi Boudra422bf772019-12-02 11:10:16 +02001#
Leonardo Sandoval579c7372020-10-23 15:23:32 -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#
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
25expect_string "TSP: Built" "TSP booted"
26
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} {
38 puts "<<TSP $tsp_resp_count responses; sufficient>>"
39 break
40 }
41 }
42 timeout {
43 exit_timeout
44 }
45 }
46 }
47}
48
49source [file join [file dirname [info script]] uart-hold.inc]