changeset 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 c336ed5691a5
children bb1f572ac098
files src/cs/drivers/drv_app/power/board/power.c src/g23m-aci/aci/aci_pei.c
diffstat 2 files changed, 7 insertions(+), 10 deletions(-) [+]
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
--- a/src/g23m-aci/aci/aci_pei.c	Mon Apr 26 22:04:10 2021 +0000
+++ b/src/g23m-aci/aci/aci_pei.c	Tue Apr 27 06:24:52 2021 +0000
@@ -154,9 +154,7 @@
 
 extern const char firmware_version_str[];
 
-#if (MMI != 0)
-extern int fchg_is_running, r2d_is_running;
-#endif
+int mmi_task_init_done;
 
 
 /*==== DEFINE =====================================================*/
@@ -1388,13 +1386,6 @@
 
 #endif /* TI_PS_HCOMM_CHANGE */
 
-/* FreeCalypso addition to fix R2D start race condition */
-/* wait for FCHG too now that MFW depends on it */
-#if (MMI != 0)
-  if (!fchg_is_running || !r2d_is_running)
-    return PEI_ERROR;
-#endif
-
 #ifdef DTI
 #ifdef _SIMULATION_
   /*
@@ -1595,6 +1586,8 @@
   acia_init();
 #endif
 
+  mmi_task_init_done = 1;
+
   return PEI_OK;
 }