fix(tsp): flush uart console

tsp uses uart2 and is printing some init messages in main, but
in certain situations we may exit tsp and may not have flushed
uart data, this could later land in uart fifo overflow or
random corruption.

Time to time we have seen a character corruption on uart2 arising
out of logs from tsp main.

So flush console messages from tsp_main before leaving the function.
This is inline with our uart usage strategy across TF-A as most
entry _main function ensures uart console is flushed before exit.

The console flush is harmless and should fix the potential character
corruption if it was due to tsp_main negligence.

But we cannot also rule out that it could be a potential FVP-UART
problem, but that's quite unlikely and further CI daily's will give
us a idea if this fixes the character corruption seen or we may need
stress test FVP-UART which maybe corrupting character in certain
circumstances.

Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I300c6b71c00fa92b8b97b3e77ea936b393d0f7b5
This commit is contained in:
Govindraj Raja 2023-05-22 13:22:42 -05:00
parent d3e71ead6e
commit ae074b369a
1 changed files with 2 additions and 0 deletions

View File

@ -50,6 +50,8 @@ uint64_t tsp_main(void)
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count,
tsp_stats[linear_id].cpu_on_count);
console_flush();
return (uint64_t) &tsp_vector_table;
}