mainboards: align on using ACPI_Sx definitions
The mainboard_smi_sleep() function takes ACPI sleep values
of the form S3=3, S4=4, S5=5, etc. All the chipsets ensure
that whatever hardware PM1 control register values are used
the interface to the mainboard is the same. Move all the
SMI handlers in the mainboard directory to not open code
the literal values 3 and 5 for ACPI_S3 and ACPI_S5.
There were a few notable exceptions where the code was
attempting to use the hardware values and not the common
translated values. The few users of SLEEP_STATE_X were
updated to align with ACPI_SX as those defines are
already equal. The removal of SLEEP_STATE_X defines is
forthcoming in a subsequent patch.
BUG=chrome-os-partner:54977
Change-Id: I76592c9107778cce5995e5af764760453f54dc50
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/15664
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
diff --git a/src/mainboard/google/auron/smihandler.c b/src/mainboard/google/auron/smihandler.c
index fac07b1..c962bb9 100644
--- a/src/mainboard/google/auron/smihandler.c
+++ b/src/mainboard/google/auron/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -73,7 +74,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0) {
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -87,7 +88,7 @@
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0) {
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/auron_paine/smihandler.c b/src/mainboard/google/auron_paine/smihandler.c
index d68c87a..b34a69a 100644
--- a/src/mainboard/google/auron_paine/smihandler.c
+++ b/src/mainboard/google/auron_paine/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -73,7 +74,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0) {
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -86,7 +87,7 @@
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0) {
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/bolt/smihandler.c b/src/mainboard/google/bolt/smihandler.c
index 51cddda..91213eb 100644
--- a/src/mainboard/google/bolt/smihandler.c
+++ b/src/mainboard/google/bolt/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -87,7 +88,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -95,7 +96,7 @@
google_chromeec_set_usb_charge_mode(
1, USB_CHARGE_MODE_DISABLED);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/chell/romstage.c b/src/mainboard/google/chell/romstage.c
index 65c095d..5360da6 100644
--- a/src/mainboard/google/chell/romstage.c
+++ b/src/mainboard/google/chell/romstage.c
@@ -16,6 +16,7 @@
*/
#include <string.h>
+#include <arch/acpi.h>
#include <ec/google/chromeec/ec.h>
#include <soc/pei_data.h>
#include <soc/pei_wrapper.h>
@@ -25,7 +26,7 @@
void mainboard_romstage_entry(struct romstage_params *params)
{
/* Turn on keyboard backlight to indicate we are booting */
- if (params->power_state->prev_sleep_state != SLEEP_STATE_S3)
+ if (params->power_state->prev_sleep_state != ACPI_S3)
google_chromeec_kbbacklight(25);
/* Fill out PEI DATA */
diff --git a/src/mainboard/google/chell/smihandler.c b/src/mainboard/google/chell/smihandler.c
index cd0cc19..ff98b36 100644
--- a/src/mainboard/google/chell/smihandler.c
+++ b/src/mainboard/google/chell/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -84,11 +85,11 @@
static void google_ec_smi_sleep(u8 slp_typ)
{
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
break;
diff --git a/src/mainboard/google/cyan/smihandler.c b/src/mainboard/google/cyan/smihandler.c
index 9b363ca..1a0fcee 100644
--- a/src/mainboard/google/cyan/smihandler.c
+++ b/src/mainboard/google/cyan/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -103,7 +104,7 @@
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
@@ -118,7 +119,7 @@
/* Enable wake pin in GPE block. */
enable_gpe(WAKE_GPIO_EN);
break;
- case 5:
+ case ACPI_S5:
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
@@ -154,7 +155,7 @@
if (smm_get_gnvs()->bdid == BOARD_PRE_EVT) {
/* Set LPC lines to low power in S3/S5. */
- if ((slp_typ == SLEEP_STATE_S3) || (slp_typ == SLEEP_STATE_S5))
+ if ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5))
lpc_set_low_power();
}
diff --git a/src/mainboard/google/falco/smihandler.c b/src/mainboard/google/falco/smihandler.c
index 6f17e40..342ca0c 100644
--- a/src/mainboard/google/falco/smihandler.c
+++ b/src/mainboard/google/falco/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -71,7 +72,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -87,7 +88,7 @@
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/glados/smihandler.c b/src/mainboard/google/glados/smihandler.c
index cd0cc19..ff98b36 100644
--- a/src/mainboard/google/glados/smihandler.c
+++ b/src/mainboard/google/glados/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -84,11 +85,11 @@
static void google_ec_smi_sleep(u8 slp_typ)
{
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
break;
diff --git a/src/mainboard/google/guado/smihandler.c b/src/mainboard/google/guado/smihandler.c
index 9fe9dfa..d37cc33 100644
--- a/src/mainboard/google/guado/smihandler.c
+++ b/src/mainboard/google/guado/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -59,13 +60,13 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
it8772f_gpio_led(IT8772F_GPIO_DEV, 1 /* set */, 0x01 /* select */,
0x01 /* polarity */, 0x01 /* 1=pullup */,
0x01 /* output */, 0x00, /* 0=Alternate function */
SIO_GPIO_BLINK_GPIO10, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
break;
- case 5:
+ case ACPI_S5:
it8772f_gpio_led(IT8772F_GPIO_DEV, 1 /* set */, 0x01 /* select */,
0x00 /* polarity: non-inverting */, 0x00 /* 0=pulldown */,
0x01 /* output */, 0x01 /* 1=Simple IO function */,
diff --git a/src/mainboard/google/jecht/smihandler.c b/src/mainboard/google/jecht/smihandler.c
index f7a6643..3b47ac6 100644
--- a/src/mainboard/google/jecht/smihandler.c
+++ b/src/mainboard/google/jecht/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -56,9 +57,9 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
break;
- case 5:
+ case ACPI_S5:
break;
}
}
diff --git a/src/mainboard/google/lars/smihandler.c b/src/mainboard/google/lars/smihandler.c
index 4b903ea..9ddf8d0 100644
--- a/src/mainboard/google/lars/smihandler.c
+++ b/src/mainboard/google/lars/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -84,11 +85,11 @@
{
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
break;
diff --git a/src/mainboard/google/link/mainboard_smi.c b/src/mainboard/google/link/mainboard_smi.c
index d281742..a0d3803 100644
--- a/src/mainboard/google/link/mainboard_smi.c
+++ b/src/mainboard/google/link/mainboard_smi.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -64,7 +65,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -72,7 +73,7 @@
google_chromeec_set_usb_charge_mode(
1, USB_CHARGE_MODE_DISABLED);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/ninja/mainboard_smi.c b/src/mainboard/google/ninja/mainboard_smi.c
index bb0f4fb..ba145a0 100644
--- a/src/mainboard/google/ninja/mainboard_smi.c
+++ b/src/mainboard/google/ninja/mainboard_smi.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -88,7 +89,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -101,7 +102,7 @@
/* Enable wake pin in GPE block. */
enable_gpe(WAKE_GPIO_EN);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/peppy/smihandler.c b/src/mainboard/google/peppy/smihandler.c
index 8f265a0..f3e69f9 100644
--- a/src/mainboard/google/peppy/smihandler.c
+++ b/src/mainboard/google/peppy/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -72,7 +73,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -86,7 +87,7 @@
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/rambi/mainboard_smi.c b/src/mainboard/google/rambi/mainboard_smi.c
index a3d5273..bd6f91e 100644
--- a/src/mainboard/google/rambi/mainboard_smi.c
+++ b/src/mainboard/google/rambi/mainboard_smi.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -67,7 +68,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -80,7 +81,7 @@
/* Enable wake pin in GPE block. */
enable_gpe(WAKE_GPIO_EN);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/reef/smihandler.c b/src/mainboard/google/reef/smihandler.c
index 3b855f2..edf8190 100644
--- a/src/mainboard/google/reef/smihandler.c
+++ b/src/mainboard/google/reef/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <cpu/x86/smm.h>
#include <ec/google/chromeec/ec.h>
#include <soc/pm.h>
@@ -25,12 +26,12 @@
return;
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
enable_gpe(GPIO_TIER_1_SCI);
break;
- case 5:
+ case ACPI_S5:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
break;
diff --git a/src/mainboard/google/rikku/smihandler.c b/src/mainboard/google/rikku/smihandler.c
index c0b8186..4331a1f 100644
--- a/src/mainboard/google/rikku/smihandler.c
+++ b/src/mainboard/google/rikku/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -58,13 +59,13 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
it8772f_gpio_led(IT8772F_GPIO_DEV, 1 /* set */, 0x01 /* select */,
0x01 /* polarity */, 0x01 /* 1=pullup */,
0x01 /* output */, 0x00, /* 0=Alternate function */
SIO_GPIO_BLINK_GPIO10, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
break;
- case 5:
+ case ACPI_S5:
it8772f_gpio_led(IT8772F_GPIO_DEV, 1 /* set */, 0x01 /* select */,
0x00 /* polarity: non-inverting */, 0x00 /* 0=pulldown */,
0x01 /* output */, 0x01 /* 1=Simple IO function */,
diff --git a/src/mainboard/google/samus/romstage.c b/src/mainboard/google/samus/romstage.c
index 02b78a9..2306a29 100644
--- a/src/mainboard/google/samus/romstage.c
+++ b/src/mainboard/google/samus/romstage.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <cbfs.h>
#include <console/console.h>
#include <string.h>
@@ -35,7 +36,7 @@
post_code(0x31);
- if (rp->power_state->prev_sleep_state != SLEEP_STATE_S3)
+ if (rp->power_state->prev_sleep_state != ACPI_S3)
google_chromeec_kbbacklight(100);
printk(BIOS_INFO, "MLB: board version %s\n", samus_board_version());
diff --git a/src/mainboard/google/samus/smihandler.c b/src/mainboard/google/samus/smihandler.c
index 121e8a0..b0595cc 100644
--- a/src/mainboard/google/samus/smihandler.c
+++ b/src/mainboard/google/samus/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -67,7 +68,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0) {
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -85,7 +86,7 @@
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0) {
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/slippy/smihandler.c b/src/mainboard/google/slippy/smihandler.c
index 0d0557e..9cd0cd2 100644
--- a/src/mainboard/google/slippy/smihandler.c
+++ b/src/mainboard/google/slippy/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -66,7 +67,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
@@ -76,7 +77,7 @@
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
0, USB_CHARGE_MODE_DISABLED);
diff --git a/src/mainboard/google/tidus/smihandler.c b/src/mainboard/google/tidus/smihandler.c
index 92c8a2e..68bc2c2 100644
--- a/src/mainboard/google/tidus/smihandler.c
+++ b/src/mainboard/google/tidus/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -61,13 +62,13 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
set_power_led(SIO_GPIO_BLINK_GPIO10, LED_BLINK);
/* Enable DCP mode */
set_gpio(GPIO_USB_CTL_1, 0);
break;
- case 5:
+ case ACPI_S5:
set_power_led(SIO_GPIO_BLINK_GPIO10, LED_OFF);
break;
}
diff --git a/src/mainboard/intel/amenia/smihandler.c b/src/mainboard/intel/amenia/smihandler.c
index 3b855f2..edf8190 100644
--- a/src/mainboard/intel/amenia/smihandler.c
+++ b/src/mainboard/intel/amenia/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <cpu/x86/smm.h>
#include <ec/google/chromeec/ec.h>
#include <soc/pm.h>
@@ -25,12 +26,12 @@
return;
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
enable_gpe(GPIO_TIER_1_SCI);
break;
- case 5:
+ case ACPI_S5:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
break;
diff --git a/src/mainboard/intel/baskingridge/mainboard_smi.c b/src/mainboard/intel/baskingridge/mainboard_smi.c
index b78dd67..229085d 100644
--- a/src/mainboard/intel/baskingridge/mainboard_smi.c
+++ b/src/mainboard/intel/baskingridge/mainboard_smi.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -33,11 +34,11 @@
u8 reg8;
switch (slp_typ) {
- case SLP_TYP_S3:
- case SLP_TYP_S4:
+ case ACPI_S3:
+ case ACPI_S4:
break;
- case SLP_TYP_S5:
+ case ACPI_S5:
/* Turn off LED */
reg8 = inb(SIO_GPIO_BASE_SET4);
reg8 |= (1 << 5);
diff --git a/src/mainboard/intel/cougar_canyon2/mainboard_smi.c b/src/mainboard/intel/cougar_canyon2/mainboard_smi.c
index db9d198..5edcf13 100644
--- a/src/mainboard/intel/cougar_canyon2/mainboard_smi.c
+++ b/src/mainboard/intel/cougar_canyon2/mainboard_smi.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -34,11 +35,11 @@
u8 reg8;
switch (slp_typ) {
- case SLP_TYP_S3:
- case SLP_TYP_S4:
+ case ACPI_S3:
+ case ACPI_S4:
break;
- case SLP_TYP_S5:
+ case ACPI_S5:
/* Turn off LED */
reg8 = inb(SIO_GPIO_BASE_SET4);
reg8 |= (1 << 5);
diff --git a/src/mainboard/intel/emeraldlake2/smihandler.c b/src/mainboard/intel/emeraldlake2/smihandler.c
index ecc6dd3..3662e6e 100644
--- a/src/mainboard/intel/emeraldlake2/smihandler.c
+++ b/src/mainboard/intel/emeraldlake2/smihandler.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -33,11 +34,11 @@
u8 reg8;
switch (slp_typ) {
- case 3:
- case 4:
+ case ACPI_S3:
+ case ACPI_S4:
break;
- case 5:
+ case ACPI_S5:
/* Turn off LED */
reg8 = inb(SIO_GPIO_BASE_SET4);
reg8 |= (1 << 5);
diff --git a/src/mainboard/intel/kunimitsu/smihandler.c b/src/mainboard/intel/kunimitsu/smihandler.c
index 4b903ea..9ddf8d0 100644
--- a/src/mainboard/intel/kunimitsu/smihandler.c
+++ b/src/mainboard/intel/kunimitsu/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -84,11 +85,11 @@
{
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
break;
- case 5:
+ case ACPI_S5:
/* Enable wake events */
google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS);
break;
diff --git a/src/mainboard/intel/stargo2/mainboard_smi.c b/src/mainboard/intel/stargo2/mainboard_smi.c
index 014fa07..0e7e986 100644
--- a/src/mainboard/intel/stargo2/mainboard_smi.c
+++ b/src/mainboard/intel/stargo2/mainboard_smi.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -28,9 +29,9 @@
u8 reg8;
switch (slp_typ) {
- case SLP_TYP_S3:
- case SLP_TYP_S4:
- case SLP_TYP_S5:
+ case ACPI_S3:
+ case ACPI_S4:
+ case ACPI_S5:
break;
}
}
diff --git a/src/mainboard/intel/strago/smihandler.c b/src/mainboard/intel/strago/smihandler.c
index 0f77bf3..6cd01e2 100644
--- a/src/mainboard/intel/strago/smihandler.c
+++ b/src/mainboard/intel/strago/smihandler.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -100,7 +101,7 @@
{
/* Disable USB charging if required */
switch (slp_typ) {
- case 3:
+ case ACPI_S3:
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s3u0 == 0)
google_chromeec_set_usb_charge_mode(
@@ -115,7 +116,7 @@
/* Enable wake pin in GPE block. */
enable_gpe(WAKE_GPIO_EN);
break;
- case 5:
+ case ACPI_S5:
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)
if (smm_get_gnvs()->s5u0 == 0)
google_chromeec_set_usb_charge_mode(
@@ -140,7 +141,7 @@
;
/* Set LPC lines to low power in S3/S5. */
- if ((slp_typ == SLEEP_STATE_S3) || (slp_typ == SLEEP_STATE_S5))
+ if ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5))
lpc_set_low_power();
#endif
}
diff --git a/src/mainboard/samsung/stumpy/smihandler.c b/src/mainboard/samsung/stumpy/smihandler.c
index 2e0f0dd..215af8f 100644
--- a/src/mainboard/samsung/stumpy/smihandler.c
+++ b/src/mainboard/samsung/stumpy/smihandler.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
@@ -33,15 +34,15 @@
{
printk(BIOS_DEBUG, "SMI: sleep S%d\n", slp_typ);
switch (slp_typ) {
- case 3:
- case 4:
+ case ACPI_S3:
+ case ACPI_S4:
it8772f_gpio_led(DUMMY_DEV, 4 /* set */, (0x1<<5) /* select */,
(0x1<<5) /* polarity */, (0x1<<5) /* 1=pullup */,
(0x1<<5) /* output */, 0x00, /* 0=Alternate function */
SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
break;
- case 5:
+ case ACPI_S5:
it8772f_gpio_led(DUMMY_DEV, 4 /* set */, (0x1<<5) /* select */,
0x00 /* polarity: non-inverting */, 0x00 /* 0=pulldown */,
(0x1<<5) /* output */, (0x1<<5) /* 1=Simple IO function */,