Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 1 | # |
Leonardo Sandoval | 579c737 | 2020-10-23 15:23:32 -0500 | [diff] [blame] | 2 | # Copyright (c) 2019-2020 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 | # |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 6 | # Expect script for TSP |
| 7 | # |
| 8 | |
| 9 | source [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 |
| 22 | set tsp_resp_proof [get_param tsp_resp_proof 1000] |
| 23 | set tsp_resp_count 0 |
| 24 | |
| 25 | expect_string "TSP: Built" "TSP booted" |
| 26 | |
| 27 | # TSPD prints more messages only when built with INFO or above. |
| 28 | set tsp_debug [get_param tsp_debug] |
| 29 | if {$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 | |
| 49 | source [file join [file dirname [info script]] uart-hold.inc] |