@@ -762,6 +762,7 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN,
762762 board_chipset_shutdown ,
763763 HOOK_PRIO_DEFAULT );
764764
765+ static int force_gpio6_rework ;
765766/* Called on AP S3 -> S0 transition */
766767static void board_chipset_resume (void )
767768{
@@ -772,7 +773,7 @@ static void board_chipset_resume(void)
772773 charge_psys_onoff (1 );
773774
774775 /* Enable BB retimer power, for MP boards. */
775- if (board_get_version () > BOARD_VERSION_10 )
776+ if (board_get_version () > BOARD_VERSION_10 || force_gpio6_rework )
776777 gpio_set_level (GPIO_PM_SLP_S0_L , 1 );
777778}
778779DECLARE_HOOK (HOOK_CHIPSET_RESUME , board_chipset_resume ,
@@ -790,13 +791,32 @@ static void board_chipset_suspend(void)
790791 charge_psys_onoff (0 );
791792
792793 /* Disable BB retimer power, for MP boards. */
793- if (board_get_version () > BOARD_VERSION_10 )
794+ if (board_get_version () > BOARD_VERSION_10 || force_gpio6_rework )
794795 gpio_set_level (GPIO_PM_SLP_S0_L , 0 );
795796}
796797DECLARE_HOOK (HOOK_CHIPSET_SUSPEND ,
797798 board_chipset_suspend ,
798799 HOOK_PRIO_DEFAULT );
799800
801+
802+ static int cmd_forcegpio6 (int argc , char * * argv )
803+ {
804+ if (argc == 2 && !strcasecmp (argv [1 ], "enable" )) {
805+ force_gpio6_rework = 1 ;
806+ gpio_set_flags (GPIO_PM_SLP_S0_L , GPIO_OUTPUT );
807+ } else if (argc == 2 && !strcasecmp (argv [1 ], "disable" )) {
808+ force_gpio6_rework = 0 ;
809+ if (board_get_version () <= BOARD_VERSION_8 )
810+ gpio_set_flags (GPIO_PM_SLP_S0_L , GPIO_INPUT );
811+ } else {
812+ return EC_ERROR_PARAM1 ;
813+ }
814+ return EC_SUCCESS ;
815+ }
816+ DECLARE_CONSOLE_COMMAND (forcegpio6 , cmd_forcegpio6 ,
817+ "[enable/disable]" ,
818+ "Force retimer GPIO6 control on early boards with rework" );
819+
800820void board_hibernate (void )
801821{
802822 board_power_off_deferred ();
0 commit comments