From 00e8113145aa12d89db72068bdd3157f08575d14 Mon Sep 17 00:00:00 2001 From: Mark Dykes Date: Wed, 1 Dec 2021 15:08:02 -0600 Subject: [PATCH] fix(trp): Distinguish between cold and warm boot The original design prevented the primary CPU from doing a warm boot sequence. This patch allows the primary to do warm boot as well. Signed-off-by: Mark Dykes Change-Id: I6baa50c3dff3051ff8b3e5a922d340634f651867 --- services/std_svc/rmmd/trp/trp_entry.S | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/services/std_svc/rmmd/trp/trp_entry.S b/services/std_svc/rmmd/trp/trp_entry.S index 23b48fb42..5826d7501 100644 --- a/services/std_svc/rmmd/trp/trp_entry.S +++ b/services/std_svc/rmmd/trp/trp_entry.S @@ -33,8 +33,19 @@ */ trp_head: bl plat_set_my_stack - bl plat_is_my_cpu_primary - cbz x0, trp_secondary_cpu_entry + + /* + * Find out whether this is a cold or warm boot + */ + ldr x1, cold_boot_flag + cbz x1, warm_boot + + /* + * Update cold boot flag to indicate cold boot is done + */ + adr x2, cold_boot_flag + str xzr, [x2] + /* --------------------------------------------- * Zero out BSS section @@ -47,12 +58,20 @@ trp_head: bl trp_setup bl trp_main -trp_secondary_cpu_entry: +warm_boot: mov_imm x0, RMI_RMM_REQ_COMPLETE mov x1, xzr smc #0 b trp_handler + /* + * Flag to mark if it is a cold boot. + * 1: cold boot, 0: warmboot. + */ +.align 3 +cold_boot_flag: + .dword 1 + /* --------------------------------------------- * Direct SMC call to BL31 service provided by * RMM Dispatcher