# HG changeset patch # User Mychaela Falconia # Date 1588882081 0 # Node ID 094152d97ce7d38d8faeade3b858d4714fb89688 # Parent 41c03ea90403edf19c7244ca010489b160f70b3c Luna bring-up: workaround for slow LCD init sequence diff -r 41c03ea90403 -r 094152d97ce7 src/aci2/aci/aci_pei.c --- a/src/aci2/aci/aci_pei.c Thu May 07 08:06:31 2020 +0000 +++ b/src/aci2/aci/aci_pei.c Thu May 07 20:08:01 2020 +0000 @@ -152,6 +152,10 @@ extern const char firmware_version_str[]; +#if (MMI != 0) +extern int r2d_is_running; +#endif + /*==== DEFINE =====================================================*/ @@ -1278,6 +1282,12 @@ return PEI_ERROR; } +/* FreeCalypso addition to fix R2D start race condition */ +#if (MMI != 0) + if (!r2d_is_running) + return PEI_ERROR; +#endif + #ifdef DTI #ifdef _SIMULATION_ /* diff -r 41c03ea90403 -r 094152d97ce7 src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_init_i.c --- a/src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_init_i.c Thu May 07 08:06:31 2020 +0000 +++ b/src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_init_i.c Thu May 07 20:08:01 2020 +0000 @@ -4,12 +4,17 @@ static void r2d_refresh_task_init(void) { - UINT32 i; - /* reset pulse */ CNTL_RST_REG |= EXT_RESET; rvf_delay(RVF_MS_TO_TICKS(10)); CNTL_RST_REG &= ~EXT_RESET; + /* finish the job in the running R2D refresh task */ +} + +void r2d_refresh_task_secondary_init(void) +{ + UINT32 i; + rvf_delay(RVF_MS_TO_TICKS(50)); /* start register init */ LCD_REG_WR(0x0001, 0x011c); // set SS and NL bit diff -r 41c03ea90403 -r 094152d97ce7 src/cs/drivers/drv_app/r2d/r2d_task.c --- a/src/cs/drivers/drv_app/r2d/r2d_task.c Thu May 07 08:06:31 2020 +0000 +++ b/src/cs/drivers/drv_app/r2d/r2d_task.c Thu May 07 20:08:01 2020 +0000 @@ -38,6 +38,9 @@ extern INT16 r2d_g_refresh_disabled; +/* FreeCalypso addition */ +int r2d_is_running; + /******************************************************************************* ** Function r2d_core ** @@ -45,16 +48,20 @@ ** *******************************************************************************/ T_RVM_RETURN r2d_core(void) -{ +{ BOOLEAN error_occured = FALSE; // T_R2D_EVT * msg_ptr_rx, * msg_ptr_tx; - + //r2d_start(); - - rvf_send_trace("R2D REFRESH TASK STARTED",24, NULL_PARAM, - RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID ); - + rvf_send_trace("R2D REFRESH TASK STARTED", 24, NULL_PARAM, + RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID); +#ifdef CONFIG_TARGET_LUNA + r2d_refresh_task_secondary_init(); + rvf_send_trace("R2D secondary init complete", 27, NULL_PARAM, + RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID); +#endif + r2d_is_running = 1; /* loop to process messages */ while (error_occured == FALSE)