1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <cpu/x86/smm.h>
6 #include <southbridge/intel/bd82x6x/pch.h>
7 #include <southbridge/intel/bd82x6x/me.h>
8 #include <northbridge/intel/sandybridge/sandybridge.h>
9 #include <ec/smsc/mec1308/ec.h>
12 static u8
mainboard_smi_ec(void)
16 cmd
= read_ec_command_byte(EC_GET_SMI_CAUSE
);
20 printk(BIOS_DEBUG
, "LID CLOSED, SHUTDOWN\n");
30 void mainboard_smi_gpi(u32 gpi_sts
)
32 if (gpi_sts
& (1 << EC_SMI_GPI
)) {
33 /* Process all pending EC requests */
34 ec_set_ports(EC_MAILBOX_PORT
, EC_MAILBOX_PORT
+1);
35 while (mainboard_smi_ec() != 0xff);
37 /* The EC may keep asserting SMI# for some
38 * period unless we kick it here.
40 send_ec_command(EC_SMI_DISABLE
);
41 send_ec_command(EC_SMI_ENABLE
);
45 int mainboard_smi_apmc(u8 apmc
)
47 ec_set_ports(EC_MAILBOX_PORT
, EC_MAILBOX_PORT
+1);
50 case APM_CNT_ACPI_ENABLE
:
51 send_ec_command(EC_SMI_DISABLE
);
52 send_ec_command(EC_ACPI_ENABLE
);
55 case APM_CNT_ACPI_DISABLE
:
56 send_ec_command(EC_SMI_ENABLE
);
57 send_ec_command(EC_ACPI_DISABLE
);