coreboot-kgpe-d16/src/mainboard/google/guybrush/ec.c
Raul E Rangel 15ddb363d4 mb/google/guybrush: Fix EC SCI configuration
This change fixes two problems:
1) We had the enum values for .direction and .level swapped. The naming
is very confusing...
2) ESPI_SYS is not a good event to use for EC SCI. It is a level/low
event that is only cleared by reading the eSPI status register 0x9C.
Cezanne has added a new event source that directly exposes the SCI bit.
This is the correct event source to use for EC SCI.

BUG=b:186045622, b:181139095
TEST=`lpc sci` on EC console and see /proc/interrupts increase by 1

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I764b9ec202376d5124331a320767cbf79371dc07
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52673
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-04-27 23:36:05 +00:00

33 lines
918 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <acpi/acpi.h>
#include <amdblocks/gpio_banks.h>
#include <amdblocks/smi.h>
#include <ec/google/chromeec/ec.h>
#include <soc/smi.h>
#include <variant/ec.h>
static const struct sci_source espi_sci_sources[] = {
{
.scimap = SMITYPE_ESPI_SCI_B,
.gpe = EC_SCI_GPI,
.direction = SMI_SCI_LVL_HIGH, /* enum smi_sci_lvl */
.level = SMI_SCI_EDG, /* enum smi_sci_dir */
}
};
void mainboard_ec_init(void)
{
const struct google_chromeec_event_info info = {
.log_events = MAINBOARD_EC_LOG_EVENTS,
.sci_events = MAINBOARD_EC_SCI_EVENTS,
.s3_wake_events = MAINBOARD_EC_S3_WAKE_EVENTS,
.s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS,
.s0ix_wake_events = MAINBOARD_EC_S0IX_WAKE_EVENTS,
};
google_chromeec_events_init(&info, acpi_is_wakeup_s3());
/* Configure eSPI VW SCI events */
gpe_configure_sci(espi_sci_sources, ARRAY_SIZE(espi_sci_sources));
}