summaryrefslogtreecommitdiff
path: root/src/mainboard/prodrive/hermes/smihandler.c
blob: 50b8e8b0a0f6e19bdea8780fe6958992c1ca5edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* SPDX-License-Identifier: GPL-2.0-only */

#include <acpi/acpi.h>
#include <cpu/x86/smm.h>
#include <intelblocks/gpio.h>
#include <intelblocks/smihandler.h>
#include <soc/gpio.h>

static const struct pad_config sgpio_table[] = {
	PAD_CFG_GPO(GPP_F10, 0, DEEP),
	PAD_CFG_GPO(GPP_F11, 0, DEEP),
	PAD_CFG_GPO(GPP_F12, 0, DEEP),
	PAD_CFG_GPO(GPP_F13, 0, DEEP),
};

void mainboard_smi_sleep(u8 slp_typ)
{
	/*
	 * Pull SGPIO pins low to prevent cross-powering the +5V rail
	 * through the SATA backplane when the power supply is off.
	 */
	if (slp_typ >= ACPI_S3)
		gpio_configure_pads(sgpio_table, ARRAY_SIZE(sgpio_table));
}