Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 1 | # |
Chris Kay | 3d2ae33 | 2022-11-15 11:32:03 +0000 | [diff] [blame] | 2 | # Copyright (c) 2019-2022 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 | |
Chris Kay | 78ea2c3 | 2022-11-15 12:24:24 +0000 | [diff] [blame] | 25 | expect_string "TSP: Built" "TSP booted successfully" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 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} { |
Chris Kay | 78ea2c3 | 2022-11-15 12:24:24 +0000 | [diff] [blame] | 38 | message "TSP $tsp_resp_count responses; sufficient" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 39 | break |
| 40 | } |
| 41 | } |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | source [file join [file dirname [info script]] uart-hold.inc] |