changeset 70:032a561fab2b

GPF-Riviera sync: make MMI task startup wait for FCHG
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 23 Oct 2020 04:52:28 +0000
parents 77321341946c
children 1876b5f8d922
files src/cs/drivers/drv_app/fchg/fchg_task.c src/g23m-aci/aci/aci_pei.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/fchg/fchg_task.c	Fri Oct 23 03:39:22 2020 +0000
+++ b/src/cs/drivers/drv_app/fchg/fchg_task.c	Fri Oct 23 04:52:28 2020 +0000
@@ -9,6 +9,9 @@
 #include "rvm/rvm_use_id_list.h"
 #include "abb/abb.h"
 
+/* startup synchronization with MMI task in GPF land */
+int fchg_is_running;
+
 static void set_initial_state(void)
 {
 	SYS_UWORD16 abb_status;
@@ -34,6 +37,7 @@
 	pwr_load_ffs_charging_config();
 	set_initial_state();
 	pwr_init_discharge();
+	fchg_is_running = 1;
 
 	/* loop to process messages */
 	while (error_occured == FALSE)
--- a/src/g23m-aci/aci/aci_pei.c	Fri Oct 23 03:39:22 2020 +0000
+++ b/src/g23m-aci/aci/aci_pei.c	Fri Oct 23 04:52:28 2020 +0000
@@ -155,7 +155,7 @@
 extern const char firmware_version_str[];
 
 #if (MMI != 0)
-extern int r2d_is_running;
+extern int fchg_is_running, r2d_is_running;
 #endif
 
 
@@ -1389,8 +1389,9 @@
 #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 (!r2d_is_running)
+  if (!fchg_is_running || !r2d_is_running)
     return PEI_ERROR;
 #endif