diff src/cs/drivers/drv_app/power/board/power.c @ 223:740a8e8fc9d7

startup sync logic rework for the new PWON button boot scheme Previously we added logic to the MMI task to hold off PEI init until R2D is running, and then extended that condition to wait for FCHG init too. However, the dependencies of MMI upon R2D and FCHG don't start until mmiInit(), and that call is driven by Switch_ON() code, hence the wait for R2D and FCHG init can be made in that code path instead of the MMI task. Furthermore, with our new way of signaling PWON button boot to MMI, we need a new wait to ensure that the MMI task is up - previously this assurance was provided by the wait for Kp pointers to be set. Solution: revert our previous PEI init hold-off additions to MMI, add a new flag indicating MMI task init done, and put the combined wait for all needed conditions into our new PWON button boot code in power.c.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 27 Apr 2021 06:24:52 +0000
parents 0947a816580c
children 305d3bb691a5
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/power/board/power.c	Mon Apr 26 22:04:10 2021 +0000
+++ b/src/cs/drivers/drv_app/power/board/power.c	Tue Apr 27 06:24:52 2021 +0000
@@ -53,6 +53,10 @@
 {
 #if (MMI != 0)
     extern void fchs_pwon_button_boot(void);
+    extern int fchg_is_running, r2d_is_running, mmi_task_init_done;
+
+    while (!fchg_is_running || !r2d_is_running || !mmi_task_init_done)
+	rvf_delay(8);
 
     fchs_pwon_button_boot();
 #endif