Skip to content

Commit 07dfe37

Browse files
Josh-TsaiJohnAZoidberg
authored andcommitted
fwk: sunflower: EC shouldn't communicate with PD chip during flashing PD
We found the PD update fail is because EC still communicate with PD during flashing. This change return the update battery status function during flashing the PD chips. BRANCH=sunflower BUG=None TEST=use i2ctrance to ensure EC does not communicate with PD chip Signed-off-by: Josh-Tsai <[email protected]> (cherry picked from commit eb83285)
1 parent 164b48d commit 07dfe37

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

zephyr/program/framework/include/cypress_pd_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,11 @@ void update_system_power_state(int controller);
736736
*/
737737
void set_pd_fw_update(bool is_update);
738738

739+
/**
740+
* @param updating return true when firmware is updating
741+
*/
742+
bool get_pd_fw_update_status(void);
743+
739744
/**
740745
* After PD chip firmware update complete, need to reinitialize the PD chip
741746
*/

zephyr/program/framework/src/cypd_ccg6.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ void cypd_customize_battery_status(void)
565565
return;
566566
}
567567

568+
/* we shouldn't update the battery status during pd chip is updating */
569+
if (get_pd_fw_update_status())
570+
return;
571+
568572
/* only update data when soc change */
569573
if (batt.state_of_charge == pd_batt_soc)
570574
return;

zephyr/program/framework/src/cypress_pd_common.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,6 +1930,11 @@ void set_pd_fw_update(bool is_update)
19301930
firmware_update = is_update;
19311931
}
19321932

1933+
bool get_pd_fw_update_status(void)
1934+
{
1935+
return firmware_update;
1936+
}
1937+
19331938
void cypd_reinitialize(void)
19341939
{
19351940
int i;

0 commit comments

Comments
 (0)