mb/google/guybrush: Add smihandler
BUG=b:180507707 TEST=builds Signed-off-by: Mathew King <mathewk@chromium.org> Change-Id: I25ce0ca869ca854ff33242d2c416319e9688cc6f Reviewed-on: https://review.coreboot.org/c/coreboot/+/51264 Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com> Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
ad83023425
commit
ee10ce6268
|
@ -0,0 +1,29 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
|
||||||
|
#include <baseboard/variants.h>
|
||||||
|
#include <cpu/x86/smm.h>
|
||||||
|
#include <ec/google/chromeec/smm.h>
|
||||||
|
#include <variant/ec.h>
|
||||||
|
|
||||||
|
void mainboard_smi_gpi(u32 gpi_sts)
|
||||||
|
{
|
||||||
|
chromeec_smi_process_events();
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainboard_smi_sleep(u8 slp_typ)
|
||||||
|
{
|
||||||
|
size_t num_gpios;
|
||||||
|
const struct soc_amd_gpio *gpios;
|
||||||
|
|
||||||
|
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS);
|
||||||
|
|
||||||
|
gpios = variant_sleep_gpio_table(&num_gpios);
|
||||||
|
program_gpios(gpios, num_gpios);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mainboard_smi_apmc(u8 apmc)
|
||||||
|
{
|
||||||
|
chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, MAINBOARD_EC_SMI_EVENTS);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
bootblock-y += gpio.c
|
bootblock-y += gpio.c
|
||||||
|
|
||||||
ramstage-y += gpio.c
|
ramstage-y += gpio.c
|
||||||
|
|
||||||
|
smm-y += gpio.c
|
||||||
|
|
|
@ -168,6 +168,11 @@ static const struct soc_amd_gpio bootblock_gpio_table[] = {
|
||||||
/* TODO: Fill bootblock gpio configuration */
|
/* TODO: Fill bootblock gpio configuration */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* GPIO configuration for sleep */
|
||||||
|
static const struct soc_amd_gpio sleep_gpio_table[] = {
|
||||||
|
/* TODO: Fill sleep gpio configuration */
|
||||||
|
};
|
||||||
|
|
||||||
const struct soc_amd_gpio *__weak variant_base_gpio_table(size_t *size)
|
const struct soc_amd_gpio *__weak variant_base_gpio_table(size_t *size)
|
||||||
{
|
{
|
||||||
*size = ARRAY_SIZE(base_gpio_table);
|
*size = ARRAY_SIZE(base_gpio_table);
|
||||||
|
@ -184,3 +189,9 @@ const struct soc_amd_gpio *__weak variant_bootblock_gpio_table(size_t *size)
|
||||||
*size = ARRAY_SIZE(bootblock_gpio_table);
|
*size = ARRAY_SIZE(bootblock_gpio_table);
|
||||||
return bootblock_gpio_table;
|
return bootblock_gpio_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const __weak struct soc_amd_gpio *variant_sleep_gpio_table(size_t *size)
|
||||||
|
{
|
||||||
|
*size = ARRAY_SIZE(sleep_gpio_table);
|
||||||
|
return sleep_gpio_table;
|
||||||
|
}
|
||||||
|
|
|
@ -21,4 +21,7 @@ const struct soc_amd_gpio *variant_override_gpio_table(size_t *size);
|
||||||
/* This function provides GPIO init in bootblock. */
|
/* This function provides GPIO init in bootblock. */
|
||||||
const struct soc_amd_gpio *variant_bootblock_gpio_table(size_t *size);
|
const struct soc_amd_gpio *variant_bootblock_gpio_table(size_t *size);
|
||||||
|
|
||||||
|
/* This function provides GPIO settings before entering sleep. */
|
||||||
|
const struct soc_amd_gpio *variant_sleep_gpio_table(size_t *size);
|
||||||
|
|
||||||
#endif /* __BASEBOARD_VARIANTS_H__ */
|
#endif /* __BASEBOARD_VARIANTS_H__ */
|
||||||
|
|
Loading…
Reference in New Issue