mb/google/cyan,intel/strago: Remove EC_GOOGLE_CHROMEEC tests

Boards have unconditional select EC_GOOGLE_CHROMEEC.

Change-Id: Id444c83fc40f908d2257e8ec2606f149722a9bde
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41982
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Kyösti Mälkki 2020-06-02 01:00:54 +03:00 committed by Patrick Georgi
parent 94e04658ce
commit 31d86c48de
4 changed files with 2 additions and 32 deletions

View File

@ -19,7 +19,6 @@ void mainboard_ec_init(void)
printk(BIOS_DEBUG, "mainboard_ec_init\n"); printk(BIOS_DEBUG, "mainboard_ec_init\n");
post_code(0xf0); post_code(0xf0);
if (CONFIG(EC_GOOGLE_CHROMEEC))
google_chromeec_events_init(&info, acpi_is_wakeup_s3()); google_chromeec_events_init(&info, acpi_is_wakeup_s3());
post_code(0xf1); post_code(0xf1);

View File

@ -41,7 +41,6 @@ int mainboard_io_trap_handler(int smif)
return 1; return 1;
} }
#if CONFIG(EC_GOOGLE_CHROMEEC)
static uint8_t mainboard_smi_ec(void) static uint8_t mainboard_smi_ec(void)
{ {
uint8_t cmd = google_chromeec_get_event(); uint8_t cmd = google_chromeec_get_event();
@ -65,7 +64,6 @@ static uint8_t mainboard_smi_ec(void)
return cmd; return cmd;
} }
#endif
/* /*
* The entire 32-bit ALT_GPIO_SMI register is passed as a parameter. Note, that * The entire 32-bit ALT_GPIO_SMI register is passed as a parameter. Note, that
@ -73,13 +71,11 @@ static uint8_t mainboard_smi_ec(void)
*/ */
void mainboard_smi_gpi(uint32_t alt_gpio_smi) void mainboard_smi_gpi(uint32_t alt_gpio_smi)
{ {
#if CONFIG(EC_GOOGLE_CHROMEEC)
if (alt_gpio_smi & (1 << EC_SMI_GPI)) { if (alt_gpio_smi & (1 << EC_SMI_GPI)) {
/* Process all pending events */ /* Process all pending events */
while (mainboard_smi_ec() != 0) while (mainboard_smi_ec() != 0)
; ;
} }
#endif
} }
void mainboard_smi_sleep(uint8_t slp_typ) void mainboard_smi_sleep(uint8_t slp_typ)
@ -90,7 +86,6 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Disable USB charging if required */ /* Disable USB charging if required */
switch (slp_typ) { switch (slp_typ) {
case ACPI_S3: case ACPI_S3:
#if CONFIG(EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s3u0 == 0) if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode( google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED); 0, USB_CHARGE_MODE_DISABLED);
@ -100,12 +95,10 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Enable wake events */ /* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS); google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
#endif
/* Enable wake pin in GPE block. */ /* Enable wake pin in GPE block. */
enable_gpe(WAKE_GPIO_EN); enable_gpe(WAKE_GPIO_EN);
break; break;
case ACPI_S5: case ACPI_S5:
#if CONFIG(EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s5u0 == 0) if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode( google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED); 0, USB_CHARGE_MODE_DISABLED);
@ -115,7 +108,6 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Enable wake events */ /* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS); google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
#endif
/* Disabling wake from SUS_GPIO1 (TOUCH INT) and /* Disabling wake from SUS_GPIO1 (TOUCH INT) and
* SUS_GPIO7 (TRACKPAD INT) in North bank as they are not * SUS_GPIO7 (TRACKPAD INT) in North bank as they are not
@ -129,7 +121,6 @@ void mainboard_smi_sleep(uint8_t slp_typ)
break; break;
} }
#if CONFIG(EC_GOOGLE_CHROMEEC)
/* Disable SCI and SMI events */ /* Disable SCI and SMI events */
google_chromeec_set_smi_mask(0); google_chromeec_set_smi_mask(0);
google_chromeec_set_sci_mask(0); google_chromeec_set_sci_mask(0);
@ -142,29 +133,24 @@ void mainboard_smi_sleep(uint8_t slp_typ)
if ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5)) { if ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5)) {
lpc_set_low_power(); lpc_set_low_power();
} }
#endif
} }
int mainboard_smi_apmc(uint8_t apmc) int mainboard_smi_apmc(uint8_t apmc)
{ {
switch (apmc) { switch (apmc) {
case APM_CNT_ACPI_ENABLE: case APM_CNT_ACPI_ENABLE:
#if CONFIG(EC_GOOGLE_CHROMEEC)
google_chromeec_set_smi_mask(0); google_chromeec_set_smi_mask(0);
/* Clear all pending events */ /* Clear all pending events */
while (google_chromeec_get_event() != 0) while (google_chromeec_get_event() != 0)
; ;
google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS); google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS);
#endif
break; break;
case APM_CNT_ACPI_DISABLE: case APM_CNT_ACPI_DISABLE:
#if CONFIG(EC_GOOGLE_CHROMEEC)
google_chromeec_set_sci_mask(0); google_chromeec_set_sci_mask(0);
/* Clear all pending events */ /* Clear all pending events */
while (google_chromeec_get_event() != 0) while (google_chromeec_get_event() != 0)
; ;
google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS); google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS);
#endif
break; break;
} }
return 0; return 0;

View File

@ -19,7 +19,6 @@ void mainboard_ec_init(void)
printk(BIOS_DEBUG, "mainboard_ec_init\n"); printk(BIOS_DEBUG, "mainboard_ec_init\n");
post_code(0xf0); post_code(0xf0);
if (CONFIG(EC_GOOGLE_CHROMEEC))
google_chromeec_events_init(&info, acpi_is_wakeup_s3()); google_chromeec_events_init(&info, acpi_is_wakeup_s3());
post_code(0xf1); post_code(0xf1);

View File

@ -40,7 +40,6 @@ int mainboard_io_trap_handler(int smif)
return 1; return 1;
} }
#if CONFIG(EC_GOOGLE_CHROMEEC)
static uint8_t mainboard_smi_ec(void) static uint8_t mainboard_smi_ec(void)
{ {
uint8_t cmd = google_chromeec_get_event(); uint8_t cmd = google_chromeec_get_event();
@ -64,7 +63,6 @@ static uint8_t mainboard_smi_ec(void)
return cmd; return cmd;
} }
#endif
/* /*
* The entire 32-bit ALT_GPIO_SMI register is passed as a parameter. Note, that * The entire 32-bit ALT_GPIO_SMI register is passed as a parameter. Note, that
@ -72,13 +70,11 @@ static uint8_t mainboard_smi_ec(void)
*/ */
void mainboard_smi_gpi(uint32_t alt_gpio_smi) void mainboard_smi_gpi(uint32_t alt_gpio_smi)
{ {
#if CONFIG(EC_GOOGLE_CHROMEEC)
if (alt_gpio_smi & (1 << EC_SMI_GPI)) { if (alt_gpio_smi & (1 << EC_SMI_GPI)) {
/* Process all pending events */ /* Process all pending events */
while (mainboard_smi_ec() != 0) while (mainboard_smi_ec() != 0)
; ;
} }
#endif
} }
void mainboard_smi_sleep(uint8_t slp_typ) void mainboard_smi_sleep(uint8_t slp_typ)
@ -86,7 +82,6 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Disable USB charging if required */ /* Disable USB charging if required */
switch (slp_typ) { switch (slp_typ) {
case ACPI_S3: case ACPI_S3:
#if CONFIG(EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s3u0 == 0) if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode( google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED); 0, USB_CHARGE_MODE_DISABLED);
@ -96,12 +91,10 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Enable wake events */ /* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS); google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
#endif
/* Enable wake pin in GPE block. */ /* Enable wake pin in GPE block. */
enable_gpe(WAKE_GPIO_EN); enable_gpe(WAKE_GPIO_EN);
break; break;
case ACPI_S5: case ACPI_S5:
#if CONFIG(EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s5u0 == 0) if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode( google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED); 0, USB_CHARGE_MODE_DISABLED);
@ -111,11 +104,9 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Enable wake events */ /* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS); google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
#endif
break; break;
} }
#if CONFIG(EC_GOOGLE_CHROMEEC)
/* Disable SCI and SMI events */ /* Disable SCI and SMI events */
google_chromeec_set_smi_mask(0); google_chromeec_set_smi_mask(0);
google_chromeec_set_sci_mask(0); google_chromeec_set_sci_mask(0);
@ -127,29 +118,24 @@ void mainboard_smi_sleep(uint8_t slp_typ)
/* Set LPC lines to low power in S3/S5. */ /* Set LPC lines to low power in S3/S5. */
if ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5)) if ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5))
lpc_set_low_power(); lpc_set_low_power();
#endif
} }
int mainboard_smi_apmc(uint8_t apmc) int mainboard_smi_apmc(uint8_t apmc)
{ {
switch (apmc) { switch (apmc) {
case APM_CNT_ACPI_ENABLE: case APM_CNT_ACPI_ENABLE:
#if CONFIG(EC_GOOGLE_CHROMEEC)
google_chromeec_set_smi_mask(0); google_chromeec_set_smi_mask(0);
/* Clear all pending events */ /* Clear all pending events */
while (google_chromeec_get_event() != 0) while (google_chromeec_get_event() != 0)
; ;
google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS); google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS);
#endif
break; break;
case APM_CNT_ACPI_DISABLE: case APM_CNT_ACPI_DISABLE:
#if CONFIG(EC_GOOGLE_CHROMEEC)
google_chromeec_set_sci_mask(0); google_chromeec_set_sci_mask(0);
/* Clear all pending events */ /* Clear all pending events */
while (google_chromeec_get_event() != 0) while (google_chromeec_get_event() != 0)
; ;
google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS); google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS);
#endif
break; break;
} }
return 0; return 0;