From 0be419947eca04967a9f36d1f843026534cc3569 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Fri, 8 Jan 2021 13:58:10 +0200 Subject: arch/x86: Use wildcard for mb/smihandler.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I306f8cd74af62c0cd30f445d20c47f774f122481 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/49247 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/arch/x86/Makefile.inc | 4 +- src/mainboard/dell/optiplex_9010/Makefile.inc | 2 - src/mainboard/google/auron/Makefile.inc | 2 - src/mainboard/google/beltino/Makefile.inc | 2 +- src/mainboard/google/brya/Makefile.inc | 2 - src/mainboard/google/butterfly/Makefile.inc | 2 - src/mainboard/google/butterfly/mainboard_smi.c | 54 ----------- src/mainboard/google/butterfly/smihandler.c | 54 +++++++++++ src/mainboard/google/cyan/Makefile.inc | 2 - src/mainboard/google/dedede/Makefile.inc | 2 - src/mainboard/google/deltaur/Makefile.inc | 2 - src/mainboard/google/drallion/Makefile.inc | 2 - src/mainboard/google/eve/Makefile.inc | 2 - src/mainboard/google/fizz/Makefile.inc | 2 - src/mainboard/google/glados/Makefile.inc | 2 - src/mainboard/google/hatch/Makefile.inc | 1 - src/mainboard/google/jecht/Makefile.inc | 2 +- src/mainboard/google/kahlee/Makefile.inc | 2 - src/mainboard/google/link/Makefile.inc | 2 - src/mainboard/google/link/mainboard_smi.c | 97 ------------------ src/mainboard/google/link/smihandler.c | 97 ++++++++++++++++++ src/mainboard/google/octopus/Makefile.inc | 1 - src/mainboard/google/poppy/Makefile.inc | 1 - src/mainboard/google/rambi/Makefile.inc | 2 - src/mainboard/google/rambi/mainboard_smi.c | 108 --------------------- src/mainboard/google/rambi/smihandler.c | 108 +++++++++++++++++++++ src/mainboard/google/reef/Makefile.inc | 1 - src/mainboard/google/sarien/Makefile.inc | 2 - src/mainboard/google/slippy/Makefile.inc | 2 - src/mainboard/google/stout/Makefile.inc | 1 - src/mainboard/google/stout/mainboard_smi.c | 94 ------------------ src/mainboard/google/stout/smihandler.c | 94 ++++++++++++++++++ src/mainboard/google/volteer/Makefile.inc | 2 - src/mainboard/google/zork/Makefile.inc | 2 - src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc | 2 - .../hp/pavilion_m6_1035dx/mainboard_smi.c | 106 -------------------- src/mainboard/hp/pavilion_m6_1035dx/smihandler.c | 106 ++++++++++++++++++++ src/mainboard/intel/adlrvp/Makefile.inc | 2 - src/mainboard/intel/baskingridge/Makefile.inc | 2 - src/mainboard/intel/baskingridge/mainboard_smi.c | 34 ------- src/mainboard/intel/baskingridge/smihandler.c | 34 +++++++ src/mainboard/intel/dcp847ske/Makefile.inc | 1 - src/mainboard/intel/glkrvp/Makefile.inc | 1 - src/mainboard/intel/jasperlake_rvp/Makefile.inc | 2 - src/mainboard/intel/kblrvp/Makefile.inc | 2 - src/mainboard/intel/kunimitsu/Makefile.inc | 2 - src/mainboard/intel/strago/Makefile.inc | 2 - src/mainboard/intel/tglrvp/Makefile.inc | 2 - src/mainboard/lenovo/g505s/Makefile.inc | 2 - src/mainboard/lenovo/g505s/mainboard_smi.c | 106 -------------------- src/mainboard/lenovo/g505s/smihandler.c | 106 ++++++++++++++++++++ src/mainboard/lenovo/l520/Makefile.inc | 1 - src/mainboard/lenovo/s230u/Makefile.inc | 1 - src/mainboard/lenovo/t410/Makefile.inc | 1 - src/mainboard/lenovo/t420/Makefile.inc | 1 - src/mainboard/lenovo/t420s/Makefile.inc | 1 - src/mainboard/lenovo/t430/Makefile.inc | 1 - src/mainboard/lenovo/t430s/Makefile.inc | 1 - src/mainboard/lenovo/t440p/Makefile.inc | 1 - src/mainboard/lenovo/t520/Makefile.inc | 1 - src/mainboard/lenovo/t530/Makefile.inc | 1 - src/mainboard/lenovo/x1_carbon_gen1/Makefile.inc | 1 - src/mainboard/lenovo/x201/Makefile.inc | 1 - src/mainboard/lenovo/x220/Makefile.inc | 1 - src/mainboard/lenovo/x230/Makefile.inc | 1 - src/mainboard/packardbell/ms2290/Makefile.inc | 1 - 66 files changed, 602 insertions(+), 680 deletions(-) delete mode 100644 src/mainboard/google/butterfly/mainboard_smi.c create mode 100644 src/mainboard/google/butterfly/smihandler.c delete mode 100644 src/mainboard/google/link/mainboard_smi.c create mode 100644 src/mainboard/google/link/smihandler.c delete mode 100644 src/mainboard/google/rambi/mainboard_smi.c create mode 100644 src/mainboard/google/rambi/smihandler.c delete mode 100644 src/mainboard/google/stout/mainboard_smi.c create mode 100644 src/mainboard/google/stout/smihandler.c delete mode 100644 src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c create mode 100644 src/mainboard/hp/pavilion_m6_1035dx/smihandler.c delete mode 100644 src/mainboard/intel/baskingridge/mainboard_smi.c create mode 100644 src/mainboard/intel/baskingridge/smihandler.c delete mode 100644 src/mainboard/lenovo/g505s/mainboard_smi.c create mode 100644 src/mainboard/lenovo/g505s/smihandler.c diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index 2d3cda7e78..cfefec605f 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -294,6 +294,4 @@ smm-y += memmove.c smm-y += memset.c smm-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c -ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/smihandler.c),) -smm-srcs += src/mainboard/$(MAINBOARDDIR)/smihandler.c -endif +smm-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/smihandler.c) diff --git a/src/mainboard/dell/optiplex_9010/Makefile.inc b/src/mainboard/dell/optiplex_9010/Makefile.inc index 7a8a68423a..964a7af97a 100644 --- a/src/mainboard/dell/optiplex_9010/Makefile.inc +++ b/src/mainboard/dell/optiplex_9010/Makefile.inc @@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c - bootblock-y += gpio.c romstage-y += gpio.c diff --git a/src/mainboard/google/auron/Makefile.inc b/src/mainboard/google/auron/Makefile.inc index b8db4a0d20..f642243667 100644 --- a/src/mainboard/google/auron/Makefile.inc +++ b/src/mainboard/google/auron/Makefile.inc @@ -6,8 +6,6 @@ romstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-$(CONFIG_CHROMEOS) += chromeos.c bootblock-$(CONFIG_CHROMEOS) += chromeos.c -smm-y += smihandler.c - romstage-$(CONFIG_HAVE_SPD_IN_CBFS) += spd.c romstage-y += variants/$(VARIANT_DIR)/pei_data.c diff --git a/src/mainboard/google/beltino/Makefile.inc b/src/mainboard/google/beltino/Makefile.inc index 8c5d6c5eb9..e12aa15e69 100644 --- a/src/mainboard/google/beltino/Makefile.inc +++ b/src/mainboard/google/beltino/Makefile.inc @@ -7,7 +7,7 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c verstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += chromeos.c ramstage-y += lan.c -smm-y += smihandler.c variants/$(VARIANT_DIR)/led.c +smm-y += variants/$(VARIANT_DIR)/led.c romstage-y += variants/$(VARIANT_DIR)/gpio.c diff --git a/src/mainboard/google/brya/Makefile.inc b/src/mainboard/google/brya/Makefile.inc index a186bfc324..a7bc42587c 100644 --- a/src/mainboard/google/brya/Makefile.inc +++ b/src/mainboard/google/brya/Makefile.inc @@ -9,8 +9,6 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += mainboard.c ramstage-y += ec.c -smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c - VARIANT_DIR:=$(call strip_quotes,$(CONFIG_VARIANT_DIR)) subdirs-y += variants/baseboard diff --git a/src/mainboard/google/butterfly/Makefile.inc b/src/mainboard/google/butterfly/Makefile.inc index 342c9f7dde..33a97f5e07 100644 --- a/src/mainboard/google/butterfly/Makefile.inc +++ b/src/mainboard/google/butterfly/Makefile.inc @@ -7,8 +7,6 @@ ramstage-y += chromeos.c bootblock-y += gpio.c romstage-y += gpio.c -smm-y += mainboard_smi.c - ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads bootblock-y += early_init.c romstage-y += early_init.c diff --git a/src/mainboard/google/butterfly/mainboard_smi.c b/src/mainboard/google/butterfly/mainboard_smi.c deleted file mode 100644 index 1f45055b0e..0000000000 --- a/src/mainboard/google/butterfly/mainboard_smi.c +++ /dev/null @@ -1,54 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* Include EC functions */ -#include -#include "ec.h" - -void mainboard_smi_gpi(u32 gpi_sts) -{ - printk(BIOS_DEBUG, "warn: unknown mainboard_smi_gpi: %x\n", gpi_sts); -} - -void mainboard_smi_sleep(u8 slp_typ) -{ - printk(BIOS_DEBUG, "mainboard_smi_sleep: %x\n", slp_typ); - - /* Tell the EC to Enable USB power for S3 if requested */ - if (gnvs->s3u0 != 0 || gnvs->s3u1 != 0) - ec_mem_write(EC_EC_PSW, ec_mem_read(EC_EC_PSW) | EC_PSW_USB); - - /* Disable wake on USB, LAN & RTC */ - /* Enable Wake from Keyboard */ - if ((slp_typ == 4) || (slp_typ == 5)) { - printk(BIOS_DEBUG, "Disabling wake on RTC\n"); - ec_mem_write(EC_EC_PSW, EC_PSW_IKB); - } -} - -int mainboard_smi_apmc(u8 apmc) -{ - printk(BIOS_DEBUG, "mainboard_smi_apmc: %x\n", apmc); - switch (apmc) { - case APM_CNT_ACPI_ENABLE: - printk(BIOS_DEBUG, "APMC: ACPI_EN\n"); - /* Clear all pending events and enable SCI */ - ec_write_cmd(EC_CMD_ENABLE_ACPI_MODE); - break; - - case APM_CNT_ACPI_DISABLE: - printk(BIOS_DEBUG, "APMC: ACPI_DIS\n"); - /* Clear all pending events and tell the EC that ACPI is disabled */ - ec_write_cmd(EC_CMD_DISABLE_ACPI_MODE); - break; - } - return 0; -} diff --git a/src/mainboard/google/butterfly/smihandler.c b/src/mainboard/google/butterfly/smihandler.c new file mode 100644 index 0000000000..1f45055b0e --- /dev/null +++ b/src/mainboard/google/butterfly/smihandler.c @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Include EC functions */ +#include +#include "ec.h" + +void mainboard_smi_gpi(u32 gpi_sts) +{ + printk(BIOS_DEBUG, "warn: unknown mainboard_smi_gpi: %x\n", gpi_sts); +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + printk(BIOS_DEBUG, "mainboard_smi_sleep: %x\n", slp_typ); + + /* Tell the EC to Enable USB power for S3 if requested */ + if (gnvs->s3u0 != 0 || gnvs->s3u1 != 0) + ec_mem_write(EC_EC_PSW, ec_mem_read(EC_EC_PSW) | EC_PSW_USB); + + /* Disable wake on USB, LAN & RTC */ + /* Enable Wake from Keyboard */ + if ((slp_typ == 4) || (slp_typ == 5)) { + printk(BIOS_DEBUG, "Disabling wake on RTC\n"); + ec_mem_write(EC_EC_PSW, EC_PSW_IKB); + } +} + +int mainboard_smi_apmc(u8 apmc) +{ + printk(BIOS_DEBUG, "mainboard_smi_apmc: %x\n", apmc); + switch (apmc) { + case APM_CNT_ACPI_ENABLE: + printk(BIOS_DEBUG, "APMC: ACPI_EN\n"); + /* Clear all pending events and enable SCI */ + ec_write_cmd(EC_CMD_ENABLE_ACPI_MODE); + break; + + case APM_CNT_ACPI_DISABLE: + printk(BIOS_DEBUG, "APMC: ACPI_DIS\n"); + /* Clear all pending events and tell the EC that ACPI is disabled */ + ec_write_cmd(EC_CMD_DISABLE_ACPI_MODE); + break; + } + return 0; +} diff --git a/src/mainboard/google/cyan/Makefile.inc b/src/mainboard/google/cyan/Makefile.inc index 1ecc55e697..4d10b660a0 100644 --- a/src/mainboard/google/cyan/Makefile.inc +++ b/src/mainboard/google/cyan/Makefile.inc @@ -10,8 +10,6 @@ ramstage-y += ec.c ramstage-y += irqroute.c ramstage-y += w25q64.c -smm-y += smihandler.c - subdirs-y += variants/$(VARIANT_DIR) CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include diff --git a/src/mainboard/google/dedede/Makefile.inc b/src/mainboard/google/dedede/Makefile.inc index cd73bb08a1..1b5503d40f 100644 --- a/src/mainboard/google/dedede/Makefile.inc +++ b/src/mainboard/google/dedede/Makefile.inc @@ -10,8 +10,6 @@ ramstage-y += mainboard.c ramstage-y += ec.c ramstage-y += board_info.c -smm-y += smihandler.c - VARIANT_DIR:=$(call strip_quotes,$(CONFIG_VARIANT_DIR)) subdirs-y += variants/baseboard diff --git a/src/mainboard/google/deltaur/Makefile.inc b/src/mainboard/google/deltaur/Makefile.inc index 5881615cc6..8adb584599 100644 --- a/src/mainboard/google/deltaur/Makefile.inc +++ b/src/mainboard/google/deltaur/Makefile.inc @@ -16,8 +16,6 @@ ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) += hda_verb.c verstage-$(CONFIG_CHROMEOS) += chromeos.c verstage-y += ec.c -smm-y += smihandler.c - subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/drallion/Makefile.inc b/src/mainboard/google/drallion/Makefile.inc index 4c8b888aad..3c355c5a2e 100644 --- a/src/mainboard/google/drallion/Makefile.inc +++ b/src/mainboard/google/drallion/Makefile.inc @@ -6,8 +6,6 @@ ramstage-y += ramstage.c romstage-y += romstage.c -smm-y += smihandler.c - bootblock-$(CONFIG_CHROMEOS) += chromeos.c ramstage-$(CONFIG_CHROMEOS) += chromeos.c romstage-$(CONFIG_CHROMEOS) += chromeos.c diff --git a/src/mainboard/google/eve/Makefile.inc b/src/mainboard/google/eve/Makefile.inc index ef8b0bd110..fc6dc660f1 100644 --- a/src/mainboard/google/eve/Makefile.inc +++ b/src/mainboard/google/eve/Makefile.inc @@ -13,5 +13,3 @@ ramstage-y += mainboard.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads - -smm-y += smihandler.c diff --git a/src/mainboard/google/fizz/Makefile.inc b/src/mainboard/google/fizz/Makefile.inc index 13bf370c40..e192cffd3d 100644 --- a/src/mainboard/google/fizz/Makefile.inc +++ b/src/mainboard/google/fizz/Makefile.inc @@ -13,8 +13,6 @@ ramstage-y += mainboard.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -smm-y += smihandler.c - subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/glados/Makefile.inc b/src/mainboard/google/glados/Makefile.inc index 9bf68727de..9fd41f89a7 100644 --- a/src/mainboard/google/glados/Makefile.inc +++ b/src/mainboard/google/glados/Makefile.inc @@ -15,8 +15,6 @@ ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c ramstage-y += mainboard.c -smm-y += smihandler.c - ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads subdirs-y += variants/$(VARIANT_DIR) diff --git a/src/mainboard/google/hatch/Makefile.inc b/src/mainboard/google/hatch/Makefile.inc index f82325f177..debe94295f 100644 --- a/src/mainboard/google/hatch/Makefile.inc +++ b/src/mainboard/google/hatch/Makefile.inc @@ -12,7 +12,6 @@ romstage-$(CONFIG_ROMSTAGE_SPD_SMBUS) += romstage_spd_smbus.c romstage-$(CONFIG_CHROMEOS) += chromeos.c verstage-$(CONFIG_CHROMEOS) += chromeos.c -smm-y += smihandler.c subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/jecht/Makefile.inc b/src/mainboard/google/jecht/Makefile.inc index 845fb0bd2c..ed74d75109 100644 --- a/src/mainboard/google/jecht/Makefile.inc +++ b/src/mainboard/google/jecht/Makefile.inc @@ -6,7 +6,7 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c verstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += lan.c -smm-y += smihandler.c led.c +smm-y += led.c romstage-y += variants/$(VARIANT_DIR)/pei_data.c ramstage-y += variants/$(VARIANT_DIR)/pei_data.c diff --git a/src/mainboard/google/kahlee/Makefile.inc b/src/mainboard/google/kahlee/Makefile.inc index faa2496a19..94705922a6 100644 --- a/src/mainboard/google/kahlee/Makefile.inc +++ b/src/mainboard/google/kahlee/Makefile.inc @@ -16,8 +16,6 @@ ramstage-y += OemCustomize.c verstage-y += chromeos.c verstage-y += ec.c -smm-y += smihandler.c - subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/link/Makefile.inc b/src/mainboard/google/link/Makefile.inc index ee411c2f28..6b3f1b568c 100644 --- a/src/mainboard/google/link/Makefile.inc +++ b/src/mainboard/google/link/Makefile.inc @@ -6,8 +6,6 @@ romstage-y += chromeos.c ramstage-y += chromeos.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -smm-y += mainboard_smi.c - # Order of names in SPD_SOURCES is important! SPD_SOURCES = elpida_4Gb_1600_x16 SPD_SOURCES += samsung_4Gb_1600_1.35v_x16 diff --git a/src/mainboard/google/link/mainboard_smi.c b/src/mainboard/google/link/mainboard_smi.c deleted file mode 100644 index 8d4b4bd5af..0000000000 --- a/src/mainboard/google/link/mainboard_smi.c +++ /dev/null @@ -1,97 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Include EC functions */ -#include -#include "ec.h" - -static u8 mainboard_smi_ec(void) -{ - u8 cmd = google_chromeec_get_event(); - - /* Log this event */ - if (cmd) - elog_gsmi_add_event_byte(ELOG_TYPE_EC_EVENT, cmd); - - switch (cmd) { - case EC_HOST_EVENT_LID_CLOSED: - printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n"); - - /* Go to S5 */ - write_pmbase32(PM1_CNT, read_pmbase32(PM1_CNT) | (0xf << 10)); - break; - } - - return cmd; -} - -void mainboard_smi_gpi(u32 gpi_sts) -{ - if (gpi_sts & (1 << EC_SMI_GPI)) { - /* Process all pending events */ - while (mainboard_smi_ec() != 0); - } -} - -void mainboard_smi_sleep(u8 slp_typ) -{ - /* Disable USB charging if required */ - switch (slp_typ) { - case ACPI_S3: - if (gnvs->s3u0 == 0) - google_chromeec_set_usb_charge_mode( - 0, USB_CHARGE_MODE_DISABLED); - if (gnvs->s3u1 == 0) - google_chromeec_set_usb_charge_mode( - 1, USB_CHARGE_MODE_DISABLED); - break; - case ACPI_S5: - if (gnvs->s5u0 == 0) - google_chromeec_set_usb_charge_mode( - 0, USB_CHARGE_MODE_DISABLED); - if (gnvs->s5u1 == 0) - google_chromeec_set_usb_charge_mode( - 1, USB_CHARGE_MODE_DISABLED); - break; - } - - /* Disable SCI and SMI events */ - google_chromeec_set_smi_mask(0); - google_chromeec_set_sci_mask(0); - - /* Clear pending events that may trigger immediate wake */ - while (google_chromeec_get_event() != 0); - - /* Enable wake events */ - google_chromeec_set_wake_mask(LINK_EC_S3_WAKE_EVENTS); -} - -int mainboard_smi_apmc(u8 apmc) -{ - switch (apmc) { - case APM_CNT_ACPI_ENABLE: - google_chromeec_set_smi_mask(0); - /* Clear all pending events */ - while (google_chromeec_get_event() != 0); - google_chromeec_set_sci_mask(LINK_EC_SCI_EVENTS); - break; - case APM_CNT_ACPI_DISABLE: - google_chromeec_set_sci_mask(0); - /* Clear all pending events */ - while (google_chromeec_get_event() != 0); - google_chromeec_set_smi_mask(LINK_EC_SMI_EVENTS); - break; - } - return 0; -} diff --git a/src/mainboard/google/link/smihandler.c b/src/mainboard/google/link/smihandler.c new file mode 100644 index 0000000000..8d4b4bd5af --- /dev/null +++ b/src/mainboard/google/link/smihandler.c @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Include EC functions */ +#include +#include "ec.h" + +static u8 mainboard_smi_ec(void) +{ + u8 cmd = google_chromeec_get_event(); + + /* Log this event */ + if (cmd) + elog_gsmi_add_event_byte(ELOG_TYPE_EC_EVENT, cmd); + + switch (cmd) { + case EC_HOST_EVENT_LID_CLOSED: + printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n"); + + /* Go to S5 */ + write_pmbase32(PM1_CNT, read_pmbase32(PM1_CNT) | (0xf << 10)); + break; + } + + return cmd; +} + +void mainboard_smi_gpi(u32 gpi_sts) +{ + if (gpi_sts & (1 << EC_SMI_GPI)) { + /* Process all pending events */ + while (mainboard_smi_ec() != 0); + } +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + /* Disable USB charging if required */ + switch (slp_typ) { + case ACPI_S3: + if (gnvs->s3u0 == 0) + google_chromeec_set_usb_charge_mode( + 0, USB_CHARGE_MODE_DISABLED); + if (gnvs->s3u1 == 0) + google_chromeec_set_usb_charge_mode( + 1, USB_CHARGE_MODE_DISABLED); + break; + case ACPI_S5: + if (gnvs->s5u0 == 0) + google_chromeec_set_usb_charge_mode( + 0, USB_CHARGE_MODE_DISABLED); + if (gnvs->s5u1 == 0) + google_chromeec_set_usb_charge_mode( + 1, USB_CHARGE_MODE_DISABLED); + break; + } + + /* Disable SCI and SMI events */ + google_chromeec_set_smi_mask(0); + google_chromeec_set_sci_mask(0); + + /* Clear pending events that may trigger immediate wake */ + while (google_chromeec_get_event() != 0); + + /* Enable wake events */ + google_chromeec_set_wake_mask(LINK_EC_S3_WAKE_EVENTS); +} + +int mainboard_smi_apmc(u8 apmc) +{ + switch (apmc) { + case APM_CNT_ACPI_ENABLE: + google_chromeec_set_smi_mask(0); + /* Clear all pending events */ + while (google_chromeec_get_event() != 0); + google_chromeec_set_sci_mask(LINK_EC_SCI_EVENTS); + break; + case APM_CNT_ACPI_DISABLE: + google_chromeec_set_sci_mask(0); + /* Clear all pending events */ + while (google_chromeec_get_event() != 0); + google_chromeec_set_smi_mask(LINK_EC_SMI_EVENTS); + break; + } + return 0; +} diff --git a/src/mainboard/google/octopus/Makefile.inc b/src/mainboard/google/octopus/Makefile.inc index aa055246d2..1acd8c688e 100644 --- a/src/mainboard/google/octopus/Makefile.inc +++ b/src/mainboard/google/octopus/Makefile.inc @@ -8,7 +8,6 @@ ramstage-y += ec.c ramstage-y += mainboard.c verstage-$(CONFIG_CHROMEOS) += chromeos.c -smm-y += smihandler.c subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/poppy/Makefile.inc b/src/mainboard/google/poppy/Makefile.inc index 3b54531625..9f36e79463 100644 --- a/src/mainboard/google/poppy/Makefile.inc +++ b/src/mainboard/google/poppy/Makefile.inc @@ -13,7 +13,6 @@ ramstage-y += mainboard.c ramstage-y += ramstage.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -smm-y += smihandler.c smm-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c subdirs-y += variants/baseboard diff --git a/src/mainboard/google/rambi/Makefile.inc b/src/mainboard/google/rambi/Makefile.inc index da2e474614..e0d552476e 100644 --- a/src/mainboard/google/rambi/Makefile.inc +++ b/src/mainboard/google/rambi/Makefile.inc @@ -6,8 +6,6 @@ ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c ramstage-y += irqroute.c ramstage-y += w25q64.c -smm-y += mainboard_smi.c - ramstage-y += variants/$(VARIANT_DIR)/gpio.c ramstage-$(CONFIG_BOARD_GOOGLE_NINJA) += variants/$(VARIANT_DIR)/lan.c diff --git a/src/mainboard/google/rambi/mainboard_smi.c b/src/mainboard/google/rambi/mainboard_smi.c deleted file mode 100644 index c434860ea5..0000000000 --- a/src/mainboard/google/rambi/mainboard_smi.c +++ /dev/null @@ -1,108 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include - -#include -#include "ec.h" - -#include -#include - -/* The wake gpio is SUS_GPIO[0]. */ -#define WAKE_GPIO_EN SUS_GPIO_EN0 - -static uint8_t mainboard_smi_ec(void) -{ - uint8_t cmd = google_chromeec_get_event(); - uint16_t pmbase = get_pmbase(); - uint32_t pm1_cnt; - - /* Log this event */ - if (cmd) - elog_gsmi_add_event_byte(ELOG_TYPE_EC_EVENT, cmd); - - switch (cmd) { - case EC_HOST_EVENT_LID_CLOSED: - printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n"); - - /* Go to S5 */ - pm1_cnt = inl(pmbase + PM1_CNT); - pm1_cnt |= SLP_EN | (SLP_TYP_S5 << SLP_TYP_SHIFT); - outl(pm1_cnt, pmbase + PM1_CNT); - break; - } - - return cmd; -} - -/* The entire 32-bit ALT_GPIO_SMI register is passed as a parameter. Note, that - * this includes the enable bits in the lower 16 bits. */ -void mainboard_smi_gpi(uint32_t alt_gpio_smi) -{ - if (alt_gpio_smi & (1 << EC_SMI_GPI)) { - /* Process all pending events */ - while (mainboard_smi_ec() != 0); - } -} - -void mainboard_smi_sleep(uint8_t slp_typ) -{ - /* Disable USB charging if required */ - switch (slp_typ) { - case ACPI_S3: - if (gnvs->s3u0 == 0) - google_chromeec_set_usb_charge_mode( - 0, USB_CHARGE_MODE_DISABLED); - if (gnvs->s3u1 == 0) - google_chromeec_set_usb_charge_mode( - 1, USB_CHARGE_MODE_DISABLED); - - /* Enable wake events */ - google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS); - /* Enable wake pin in GPE block. */ - enable_gpe(WAKE_GPIO_EN); - break; - case ACPI_S5: - if (gnvs->s5u0 == 0) - google_chromeec_set_usb_charge_mode( - 0, USB_CHARGE_MODE_DISABLED); - if (gnvs->s5u1 == 0) - google_chromeec_set_usb_charge_mode( - 1, USB_CHARGE_MODE_DISABLED); - - /* Enable wake events */ - google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS); - break; - } - - /* Disable SCI and SMI events */ - google_chromeec_set_smi_mask(0); - google_chromeec_set_sci_mask(0); - - /* Clear pending events that may trigger immediate wake */ - while (google_chromeec_get_event() != 0); -} - -int mainboard_smi_apmc(uint8_t apmc) -{ - switch (apmc) { - case APM_CNT_ACPI_ENABLE: - google_chromeec_set_smi_mask(0); - /* Clear all pending events */ - while (google_chromeec_get_event() != 0); - google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS); - break; - case APM_CNT_ACPI_DISABLE: - google_chromeec_set_sci_mask(0); - /* Clear all pending events */ - while (google_chromeec_get_event() != 0); - google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS); - break; - } - return 0; -} diff --git a/src/mainboard/google/rambi/smihandler.c b/src/mainboard/google/rambi/smihandler.c new file mode 100644 index 0000000000..c434860ea5 --- /dev/null +++ b/src/mainboard/google/rambi/smihandler.c @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include + +#include +#include "ec.h" + +#include +#include + +/* The wake gpio is SUS_GPIO[0]. */ +#define WAKE_GPIO_EN SUS_GPIO_EN0 + +static uint8_t mainboard_smi_ec(void) +{ + uint8_t cmd = google_chromeec_get_event(); + uint16_t pmbase = get_pmbase(); + uint32_t pm1_cnt; + + /* Log this event */ + if (cmd) + elog_gsmi_add_event_byte(ELOG_TYPE_EC_EVENT, cmd); + + switch (cmd) { + case EC_HOST_EVENT_LID_CLOSED: + printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n"); + + /* Go to S5 */ + pm1_cnt = inl(pmbase + PM1_CNT); + pm1_cnt |= SLP_EN | (SLP_TYP_S5 << SLP_TYP_SHIFT); + outl(pm1_cnt, pmbase + PM1_CNT); + break; + } + + return cmd; +} + +/* The entire 32-bit ALT_GPIO_SMI register is passed as a parameter. Note, that + * this includes the enable bits in the lower 16 bits. */ +void mainboard_smi_gpi(uint32_t alt_gpio_smi) +{ + if (alt_gpio_smi & (1 << EC_SMI_GPI)) { + /* Process all pending events */ + while (mainboard_smi_ec() != 0); + } +} + +void mainboard_smi_sleep(uint8_t slp_typ) +{ + /* Disable USB charging if required */ + switch (slp_typ) { + case ACPI_S3: + if (gnvs->s3u0 == 0) + google_chromeec_set_usb_charge_mode( + 0, USB_CHARGE_MODE_DISABLED); + if (gnvs->s3u1 == 0) + google_chromeec_set_usb_charge_mode( + 1, USB_CHARGE_MODE_DISABLED); + + /* Enable wake events */ + google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS); + /* Enable wake pin in GPE block. */ + enable_gpe(WAKE_GPIO_EN); + break; + case ACPI_S5: + if (gnvs->s5u0 == 0) + google_chromeec_set_usb_charge_mode( + 0, USB_CHARGE_MODE_DISABLED); + if (gnvs->s5u1 == 0) + google_chromeec_set_usb_charge_mode( + 1, USB_CHARGE_MODE_DISABLED); + + /* Enable wake events */ + google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS); + break; + } + + /* Disable SCI and SMI events */ + google_chromeec_set_smi_mask(0); + google_chromeec_set_sci_mask(0); + + /* Clear pending events that may trigger immediate wake */ + while (google_chromeec_get_event() != 0); +} + +int mainboard_smi_apmc(uint8_t apmc) +{ + switch (apmc) { + case APM_CNT_ACPI_ENABLE: + google_chromeec_set_smi_mask(0); + /* Clear all pending events */ + while (google_chromeec_get_event() != 0); + google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS); + break; + case APM_CNT_ACPI_DISABLE: + google_chromeec_set_sci_mask(0); + /* Clear all pending events */ + while (google_chromeec_get_event() != 0); + google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS); + break; + } + return 0; +} diff --git a/src/mainboard/google/reef/Makefile.inc b/src/mainboard/google/reef/Makefile.inc index a115677773..dd49610f89 100644 --- a/src/mainboard/google/reef/Makefile.inc +++ b/src/mainboard/google/reef/Makefile.inc @@ -8,7 +8,6 @@ ramstage-y += ec.c ramstage-y += mainboard.c verstage-$(CONFIG_CHROMEOS) += chromeos.c -smm-y += smihandler.c subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/sarien/Makefile.inc b/src/mainboard/google/sarien/Makefile.inc index e7bfc53aa0..e7c23b108b 100644 --- a/src/mainboard/google/sarien/Makefile.inc +++ b/src/mainboard/google/sarien/Makefile.inc @@ -8,8 +8,6 @@ ramstage-y += sku.c romstage-y += romstage.c -smm-y += smihandler.c - bootblock-$(CONFIG_CHROMEOS) += chromeos.c ramstage-$(CONFIG_CHROMEOS) += chromeos.c romstage-$(CONFIG_CHROMEOS) += chromeos.c diff --git a/src/mainboard/google/slippy/Makefile.inc b/src/mainboard/google/slippy/Makefile.inc index 8f75d72b15..2a2541d477 100644 --- a/src/mainboard/google/slippy/Makefile.inc +++ b/src/mainboard/google/slippy/Makefile.inc @@ -5,8 +5,6 @@ ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c romstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-$(CONFIG_CHROMEOS) += chromeos.c -smm-y += smihandler.c - romstage-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/romstage.c diff --git a/src/mainboard/google/stout/Makefile.inc b/src/mainboard/google/stout/Makefile.inc index 5c196f07f0..a773a2d7dd 100644 --- a/src/mainboard/google/stout/Makefile.inc +++ b/src/mainboard/google/stout/Makefile.inc @@ -5,7 +5,6 @@ ramstage-y += ec.c romstage-y += chromeos.c ramstage-y += chromeos.c -smm-y += mainboard_smi.c smm-y += ec.c SRC_ROOT = $(src)/mainboard/google/stout diff --git a/src/mainboard/google/stout/mainboard_smi.c b/src/mainboard/google/stout/mainboard_smi.c deleted file mode 100644 index d282bc7f23..0000000000 --- a/src/mainboard/google/stout/mainboard_smi.c +++ /dev/null @@ -1,94 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Include EC functions */ -#include -#include "ec.h" - -static u8 mainboard_smi_ec(void) -{ - u8 cmd = ec_it8518_get_event(); - - switch (cmd) { - case EC_SMI_LID_CLOSED: - printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n"); - /* Go to S5 */ - write_pmbase32(PM1_CNT, read_pmbase32(PM1_CNT) | (0xf << 10)); - break; - } - - return cmd; -} - -void mainboard_smi_gpi(u32 gpi_sts) -{ - if (gpi_sts & (1 << EC_SMI_GPI)) { - /* Process all pending events */ - while (mainboard_smi_ec() != 0); - } -} - -void mainboard_smi_sleep(u8 slp_typ) -{ - /* - * Tell the EC to Enable USB power for S3 if requested. - * Bit0 of 0x0D/Bit0 of 0x26 - * 0/0 All USB port off - * 1/0 USB on, all USB port didn't support wake up - * 0/1 USB on, yellow port support wake up charge, but may not support - * charge smart phone. - * 1/1 USB on, yellow port in AUTO mode and didn't support wake up system. - */ - if (gnvs->s3u0 != 0 || gnvs->s3u1 != 0) { - ec_write(EC_PERIPH_CNTL_3, ec_read(EC_PERIPH_CNTL_3) | 0x00); - ec_write(EC_USB_S3_EN, ec_read(EC_USB_S3_EN) | 0x01); - printk(BIOS_DEBUG, "USB wake from S3 enabled.\n"); - } else { - /* - * If USB charging in suspend is disabled then also disable - * the XHCI PME to prevent wake when the port power is cut - * after the transition into suspend. - */ - if (gnvs->xhci) { - u32 reg32 = pci_read_config32(PCH_XHCI_DEV, 0x74); - reg32 &= ~(1 << 8); /* disable PME */ - reg32 |= (1 << 15); /* clear PME status */ - pci_write_config32(PCH_XHCI_DEV, 0x74, reg32); - } - } - - ec_kbc_write_cmd(EC_KBD_CMD_MUTE); - ec_it8518_enable_wake_events(); -} - -int mainboard_smi_apmc(u8 apmc) -{ - switch (apmc) { - case APM_CNT_FINALIZE: - stout_ec_finalize_smm(); - break; - case APM_CNT_ACPI_ENABLE: - /* - * TODO(kimarie) Clear all pending events and enable SCI. - */ - ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER); - break; - case APM_CNT_ACPI_DISABLE: - /* - * TODO(kimarie) Clear all pending events and enable SMI. - */ - ec_write_cmd(EC_CMD_NOTIFY_ACPI_EXIT); - break; - } - return 0; -} diff --git a/src/mainboard/google/stout/smihandler.c b/src/mainboard/google/stout/smihandler.c new file mode 100644 index 0000000000..d282bc7f23 --- /dev/null +++ b/src/mainboard/google/stout/smihandler.c @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Include EC functions */ +#include +#include "ec.h" + +static u8 mainboard_smi_ec(void) +{ + u8 cmd = ec_it8518_get_event(); + + switch (cmd) { + case EC_SMI_LID_CLOSED: + printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n"); + /* Go to S5 */ + write_pmbase32(PM1_CNT, read_pmbase32(PM1_CNT) | (0xf << 10)); + break; + } + + return cmd; +} + +void mainboard_smi_gpi(u32 gpi_sts) +{ + if (gpi_sts & (1 << EC_SMI_GPI)) { + /* Process all pending events */ + while (mainboard_smi_ec() != 0); + } +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + /* + * Tell the EC to Enable USB power for S3 if requested. + * Bit0 of 0x0D/Bit0 of 0x26 + * 0/0 All USB port off + * 1/0 USB on, all USB port didn't support wake up + * 0/1 USB on, yellow port support wake up charge, but may not support + * charge smart phone. + * 1/1 USB on, yellow port in AUTO mode and didn't support wake up system. + */ + if (gnvs->s3u0 != 0 || gnvs->s3u1 != 0) { + ec_write(EC_PERIPH_CNTL_3, ec_read(EC_PERIPH_CNTL_3) | 0x00); + ec_write(EC_USB_S3_EN, ec_read(EC_USB_S3_EN) | 0x01); + printk(BIOS_DEBUG, "USB wake from S3 enabled.\n"); + } else { + /* + * If USB charging in suspend is disabled then also disable + * the XHCI PME to prevent wake when the port power is cut + * after the transition into suspend. + */ + if (gnvs->xhci) { + u32 reg32 = pci_read_config32(PCH_XHCI_DEV, 0x74); + reg32 &= ~(1 << 8); /* disable PME */ + reg32 |= (1 << 15); /* clear PME status */ + pci_write_config32(PCH_XHCI_DEV, 0x74, reg32); + } + } + + ec_kbc_write_cmd(EC_KBD_CMD_MUTE); + ec_it8518_enable_wake_events(); +} + +int mainboard_smi_apmc(u8 apmc) +{ + switch (apmc) { + case APM_CNT_FINALIZE: + stout_ec_finalize_smm(); + break; + case APM_CNT_ACPI_ENABLE: + /* + * TODO(kimarie) Clear all pending events and enable SCI. + */ + ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER); + break; + case APM_CNT_ACPI_DISABLE: + /* + * TODO(kimarie) Clear all pending events and enable SMI. + */ + ec_write_cmd(EC_CMD_NOTIFY_ACPI_EXIT); + break; + } + return 0; +} diff --git a/src/mainboard/google/volteer/Makefile.inc b/src/mainboard/google/volteer/Makefile.inc index c01f993d02..1847d56b6a 100644 --- a/src/mainboard/google/volteer/Makefile.inc +++ b/src/mainboard/google/volteer/Makefile.inc @@ -11,8 +11,6 @@ ramstage-y += ec.c ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += mainboard.c -smm-y += smihandler.c - verstage-$(CONFIG_CHROMEOS) += chromeos.c subdirs-y += variants/baseboard diff --git a/src/mainboard/google/zork/Makefile.inc b/src/mainboard/google/zork/Makefile.inc index 96c97b68d3..8a9d7af89a 100644 --- a/src/mainboard/google/zork/Makefile.inc +++ b/src/mainboard/google/zork/Makefile.inc @@ -11,8 +11,6 @@ ramstage-y += sku_id.c verstage-y += verstage.c -smm-y += smihandler.c - subdirs-y += variants/baseboard subdirs-y += spd diff --git a/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc b/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc index 77ae870b6c..5d42edabf4 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc +++ b/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc @@ -8,5 +8,3 @@ ramstage-y += buildOpts.c ramstage-y += BiosCallOuts.c ramstage-y += OemCustomize.c ramstage-y += ec.c - -smm-y += mainboard_smi.c diff --git a/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c b/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c deleted file mode 100644 index fa81b280ee..0000000000 --- a/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c +++ /dev/null @@ -1,106 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/* - * SMI handler -- mostly takes care of SMIs from the EC - */ - -#include -#include -#include -#include -#include -#include - -#include "ec.h" - -#define ACPI_PM1_CNT_SLEEP(state) ((1 << 13) | (state & 0x7) << 10) - -enum sleep_states { - S0 = 0, - S1 = 1, - S3 = 3, - S4 = 4, - S5 = 5, -}; - -enum ec_smi_event { - EC_SMI_EVENT_IDLE = 0x80, - EC_SMI_BATTERY_LOW = 0xb3, -}; - -/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */ -static void ec_enter_apm_mode(void) -{ - ec_kbc_write_cmd(0x59); - ec_kbc_write_ib(0xE9); -} -/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */ -static void ec_enter_acpi_mode(void) -{ - ec_kbc_write_cmd(0x59); - ec_kbc_write_ib(0xE8); -} - -static uint8_t ec_get_smi_event(void) -{ - ec_kbc_write_cmd(0x56); - return ec_kbc_read_ob(); -} - -static void ec_process_smi(uint8_t src) -{ - /* Reading the SMI source satisfies the EC in terms of responding to - * the event, regardless of whether we take an action or not. - */ - - switch (src) { - case EC_SMI_BATTERY_LOW: - printk(BIOS_DEBUG, "Battery low. Shutting down\n"); - outl(ACPI_PM1_CNT_SLEEP(S5), ACPI_PM1_CNT_BLK); - break; - default: - printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src); - } -} - -static void handle_ec_smi(void) -{ - uint8_t src; - - while ((src = ec_get_smi_event()) != EC_SMI_EVENT_IDLE) - ec_process_smi(src); -} - -static void handle_lid_smi(void) -{ - /* Only triggered in non-ACPI mode on lid close. */ - outl(ACPI_PM1_CNT_SLEEP(S4), ACPI_PM1_CNT_BLK); -} - -int mainboard_smi_apmc(uint8_t data) -{ - switch (data) { - case ACPI_SMI_CMD_ENABLE: - printk(BIOS_DEBUG, "Enable ACPI mode\n"); - ec_enter_acpi_mode(); - hudson_disable_gevent_smi(EC_LID_GEVENT); - break; - case ACPI_SMI_CMD_DISABLE: - printk(BIOS_DEBUG, "Disable ACPI mode\n"); - ec_enter_apm_mode(); - hudson_configure_gevent_smi(EC_LID_GEVENT, SMI_MODE_SMI, - SMI_LVL_LOW); - break; - default: - printk(BIOS_DEBUG, "Unhandled ACPI command: 0x%x\n", data); - } - return 0; -} - -void mainboard_smi_gpi(uint32_t gpi_sts) -{ - if (gpi_sts & (1 << EC_SMI_GEVENT)) - handle_ec_smi(); - if (gpi_sts & (1 << EC_LID_GEVENT)) - handle_lid_smi(); -} diff --git a/src/mainboard/hp/pavilion_m6_1035dx/smihandler.c b/src/mainboard/hp/pavilion_m6_1035dx/smihandler.c new file mode 100644 index 0000000000..fa81b280ee --- /dev/null +++ b/src/mainboard/hp/pavilion_m6_1035dx/smihandler.c @@ -0,0 +1,106 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +/* + * SMI handler -- mostly takes care of SMIs from the EC + */ + +#include +#include +#include +#include +#include +#include + +#include "ec.h" + +#define ACPI_PM1_CNT_SLEEP(state) ((1 << 13) | (state & 0x7) << 10) + +enum sleep_states { + S0 = 0, + S1 = 1, + S3 = 3, + S4 = 4, + S5 = 5, +}; + +enum ec_smi_event { + EC_SMI_EVENT_IDLE = 0x80, + EC_SMI_BATTERY_LOW = 0xb3, +}; + +/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */ +static void ec_enter_apm_mode(void) +{ + ec_kbc_write_cmd(0x59); + ec_kbc_write_ib(0xE9); +} +/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */ +static void ec_enter_acpi_mode(void) +{ + ec_kbc_write_cmd(0x59); + ec_kbc_write_ib(0xE8); +} + +static uint8_t ec_get_smi_event(void) +{ + ec_kbc_write_cmd(0x56); + return ec_kbc_read_ob(); +} + +static void ec_process_smi(uint8_t src) +{ + /* Reading the SMI source satisfies the EC in terms of responding to + * the event, regardless of whether we take an action or not. + */ + + switch (src) { + case EC_SMI_BATTERY_LOW: + printk(BIOS_DEBUG, "Battery low. Shutting down\n"); + outl(ACPI_PM1_CNT_SLEEP(S5), ACPI_PM1_CNT_BLK); + break; + default: + printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src); + } +} + +static void handle_ec_smi(void) +{ + uint8_t src; + + while ((src = ec_get_smi_event()) != EC_SMI_EVENT_IDLE) + ec_process_smi(src); +} + +static void handle_lid_smi(void) +{ + /* Only triggered in non-ACPI mode on lid close. */ + outl(ACPI_PM1_CNT_SLEEP(S4), ACPI_PM1_CNT_BLK); +} + +int mainboard_smi_apmc(uint8_t data) +{ + switch (data) { + case ACPI_SMI_CMD_ENABLE: + printk(BIOS_DEBUG, "Enable ACPI mode\n"); + ec_enter_acpi_mode(); + hudson_disable_gevent_smi(EC_LID_GEVENT); + break; + case ACPI_SMI_CMD_DISABLE: + printk(BIOS_DEBUG, "Disable ACPI mode\n"); + ec_enter_apm_mode(); + hudson_configure_gevent_smi(EC_LID_GEVENT, SMI_MODE_SMI, + SMI_LVL_LOW); + break; + default: + printk(BIOS_DEBUG, "Unhandled ACPI command: 0x%x\n", data); + } + return 0; +} + +void mainboard_smi_gpi(uint32_t gpi_sts) +{ + if (gpi_sts & (1 << EC_SMI_GEVENT)) + handle_ec_smi(); + if (gpi_sts & (1 << EC_LID_GEVENT)) + handle_lid_smi(); +} diff --git a/src/mainboard/intel/adlrvp/Makefile.inc b/src/mainboard/intel/adlrvp/Makefile.inc index de924067d1..75c8cf8e20 100644 --- a/src/mainboard/intel/adlrvp/Makefile.inc +++ b/src/mainboard/intel/adlrvp/Makefile.inc @@ -13,8 +13,6 @@ romstage-y += romstage_fsp_params.c romstage-y += board_id.c romstage-y += memory.c -smm-y += smihandler.c - ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += ec.c ramstage-y += mainboard.c diff --git a/src/mainboard/intel/baskingridge/Makefile.inc b/src/mainboard/intel/baskingridge/Makefile.inc index 46c9af28b7..9e605009da 100644 --- a/src/mainboard/intel/baskingridge/Makefile.inc +++ b/src/mainboard/intel/baskingridge/Makefile.inc @@ -5,5 +5,3 @@ romstage-y += gpio.c romstage-y += chromeos.c ramstage-y += chromeos.c verstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += chromeos.c - -smm-y += mainboard_smi.c diff --git a/src/mainboard/intel/baskingridge/mainboard_smi.c b/src/mainboard/intel/baskingridge/mainboard_smi.c deleted file mode 100644 index 59a3c044f5..0000000000 --- a/src/mainboard/intel/baskingridge/mainboard_smi.c +++ /dev/null @@ -1,34 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Change LED_POWER# (SIO GPIO 45) state based on sleep type. - * The IO address is hardcoded as we don't have device path in SMM. - */ -#define SIO_GPIO_BASE_SET4 (0x730 + 3) -#define SIO_GPIO_BLINK_GPIO45 0x25 -void mainboard_smi_sleep(u8 slp_typ) -{ - u8 reg8; - - switch (slp_typ) { - case ACPI_S3: - case ACPI_S4: - break; - - case ACPI_S5: - /* Turn off LED */ - reg8 = inb(SIO_GPIO_BASE_SET4); - reg8 |= (1 << 5); - outb(reg8, SIO_GPIO_BASE_SET4); - break; - } -} diff --git a/src/mainboard/intel/baskingridge/smihandler.c b/src/mainboard/intel/baskingridge/smihandler.c new file mode 100644 index 0000000000..59a3c044f5 --- /dev/null +++ b/src/mainboard/intel/baskingridge/smihandler.c @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Change LED_POWER# (SIO GPIO 45) state based on sleep type. + * The IO address is hardcoded as we don't have device path in SMM. + */ +#define SIO_GPIO_BASE_SET4 (0x730 + 3) +#define SIO_GPIO_BLINK_GPIO45 0x25 +void mainboard_smi_sleep(u8 slp_typ) +{ + u8 reg8; + + switch (slp_typ) { + case ACPI_S3: + case ACPI_S4: + break; + + case ACPI_S5: + /* Turn off LED */ + reg8 = inb(SIO_GPIO_BASE_SET4); + reg8 |= (1 << 5); + outb(reg8, SIO_GPIO_BASE_SET4); + break; + } +} diff --git a/src/mainboard/intel/dcp847ske/Makefile.inc b/src/mainboard/intel/dcp847ske/Makefile.inc index 28bc7c7cc9..08aa2ddde7 100644 --- a/src/mainboard/intel/dcp847ske/Makefile.inc +++ b/src/mainboard/intel/dcp847ske/Makefile.inc @@ -3,4 +3,3 @@ romstage-y += early_southbridge.c bootblock-y += gpio.c romstage-y += gpio.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -smm-y += smihandler.c diff --git a/src/mainboard/intel/glkrvp/Makefile.inc b/src/mainboard/intel/glkrvp/Makefile.inc index ea5b2c65c6..37b60d0fae 100644 --- a/src/mainboard/intel/glkrvp/Makefile.inc +++ b/src/mainboard/intel/glkrvp/Makefile.inc @@ -10,7 +10,6 @@ ramstage-y += ec.c ramstage-y += mainboard.c verstage-$(CONFIG_CHROMEOS) += chromeos.c -smm-y += smihandler.c subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/intel/jasperlake_rvp/Makefile.inc b/src/mainboard/intel/jasperlake_rvp/Makefile.inc index 2ac1b07bef..c680b23b5b 100644 --- a/src/mainboard/intel/jasperlake_rvp/Makefile.inc +++ b/src/mainboard/intel/jasperlake_rvp/Makefile.inc @@ -15,8 +15,6 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += mainboard.c ramstage-y += board_id.c -smm-y += smihandler.c - subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/intel/kblrvp/Makefile.inc b/src/mainboard/intel/kblrvp/Makefile.inc index c168b6dbf3..80821eb645 100644 --- a/src/mainboard/intel/kblrvp/Makefile.inc +++ b/src/mainboard/intel/kblrvp/Makefile.inc @@ -19,7 +19,5 @@ ramstage-y += ramstage.c ramstage-y += hda_verb.c -smm-y += smihandler.c - subdirs-y += variants/$(VARIANT_DIR) CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include diff --git a/src/mainboard/intel/kunimitsu/Makefile.inc b/src/mainboard/intel/kunimitsu/Makefile.inc index 63c39cf5e7..f7ea681fb9 100644 --- a/src/mainboard/intel/kunimitsu/Makefile.inc +++ b/src/mainboard/intel/kunimitsu/Makefile.inc @@ -13,5 +13,3 @@ ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c ramstage-y += mainboard.c ramstage-y += ramstage.c - -smm-y += smihandler.c diff --git a/src/mainboard/intel/strago/Makefile.inc b/src/mainboard/intel/strago/Makefile.inc index bf35b669a8..21ae380e4b 100644 --- a/src/mainboard/intel/strago/Makefile.inc +++ b/src/mainboard/intel/strago/Makefile.inc @@ -10,5 +10,3 @@ ramstage-$(CONFIG_MAINBOARD_HAS_CHROMEOS) += gpio.c ramstage-y += irqroute.c ramstage-y += ramstage.c ramstage-y += w25q64.c - -smm-y += smihandler.c diff --git a/src/mainboard/intel/tglrvp/Makefile.inc b/src/mainboard/intel/tglrvp/Makefile.inc index 2ca32f3760..93c9c493e0 100644 --- a/src/mainboard/intel/tglrvp/Makefile.inc +++ b/src/mainboard/intel/tglrvp/Makefile.inc @@ -11,8 +11,6 @@ romstage-$(CONFIG_CHROMEOS) += chromeos.c romstage-y += romstage_fsp_params.c romstage-y += board_id.c -smm-y += smihandler.c - ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += ec.c ramstage-y += mainboard.c diff --git a/src/mainboard/lenovo/g505s/Makefile.inc b/src/mainboard/lenovo/g505s/Makefile.inc index 77ae870b6c..5d42edabf4 100644 --- a/src/mainboard/lenovo/g505s/Makefile.inc +++ b/src/mainboard/lenovo/g505s/Makefile.inc @@ -8,5 +8,3 @@ ramstage-y += buildOpts.c ramstage-y += BiosCallOuts.c ramstage-y += OemCustomize.c ramstage-y += ec.c - -smm-y += mainboard_smi.c diff --git a/src/mainboard/lenovo/g505s/mainboard_smi.c b/src/mainboard/lenovo/g505s/mainboard_smi.c deleted file mode 100644 index fa81b280ee..0000000000 --- a/src/mainboard/lenovo/g505s/mainboard_smi.c +++ /dev/null @@ -1,106 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/* - * SMI handler -- mostly takes care of SMIs from the EC - */ - -#include -#include -#include -#include -#include -#include - -#include "ec.h" - -#define ACPI_PM1_CNT_SLEEP(state) ((1 << 13) | (state & 0x7) << 10) - -enum sleep_states { - S0 = 0, - S1 = 1, - S3 = 3, - S4 = 4, - S5 = 5, -}; - -enum ec_smi_event { - EC_SMI_EVENT_IDLE = 0x80, - EC_SMI_BATTERY_LOW = 0xb3, -}; - -/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */ -static void ec_enter_apm_mode(void) -{ - ec_kbc_write_cmd(0x59); - ec_kbc_write_ib(0xE9); -} -/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */ -static void ec_enter_acpi_mode(void) -{ - ec_kbc_write_cmd(0x59); - ec_kbc_write_ib(0xE8); -} - -static uint8_t ec_get_smi_event(void) -{ - ec_kbc_write_cmd(0x56); - return ec_kbc_read_ob(); -} - -static void ec_process_smi(uint8_t src) -{ - /* Reading the SMI source satisfies the EC in terms of responding to - * the event, regardless of whether we take an action or not. - */ - - switch (src) { - case EC_SMI_BATTERY_LOW: - printk(BIOS_DEBUG, "Battery low. Shutting down\n"); - outl(ACPI_PM1_CNT_SLEEP(S5), ACPI_PM1_CNT_BLK); - break; - default: - printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src); - } -} - -static void handle_ec_smi(void) -{ - uint8_t src; - - while ((src = ec_get_smi_event()) != EC_SMI_EVENT_IDLE) - ec_process_smi(src); -} - -static void handle_lid_smi(void) -{ - /* Only triggered in non-ACPI mode on lid close. */ - outl(ACPI_PM1_CNT_SLEEP(S4), ACPI_PM1_CNT_BLK); -} - -int mainboard_smi_apmc(uint8_t data) -{ - switch (data) { - case ACPI_SMI_CMD_ENABLE: - printk(BIOS_DEBUG, "Enable ACPI mode\n"); - ec_enter_acpi_mode(); - hudson_disable_gevent_smi(EC_LID_GEVENT); - break; - case ACPI_SMI_CMD_DISABLE: - printk(BIOS_DEBUG, "Disable ACPI mode\n"); - ec_enter_apm_mode(); - hudson_configure_gevent_smi(EC_LID_GEVENT, SMI_MODE_SMI, - SMI_LVL_LOW); - break; - default: - printk(BIOS_DEBUG, "Unhandled ACPI command: 0x%x\n", data); - } - return 0; -} - -void mainboard_smi_gpi(uint32_t gpi_sts) -{ - if (gpi_sts & (1 << EC_SMI_GEVENT)) - handle_ec_smi(); - if (gpi_sts & (1 << EC_LID_GEVENT)) - handle_lid_smi(); -} diff --git a/src/mainboard/lenovo/g505s/smihandler.c b/src/mainboard/lenovo/g505s/smihandler.c new file mode 100644 index 0000000000..fa81b280ee --- /dev/null +++ b/src/mainboard/lenovo/g505s/smihandler.c @@ -0,0 +1,106 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +/* + * SMI handler -- mostly takes care of SMIs from the EC + */ + +#include +#include +#include +#include +#include +#include + +#include "ec.h" + +#define ACPI_PM1_CNT_SLEEP(state) ((1 << 13) | (state & 0x7) << 10) + +enum sleep_states { + S0 = 0, + S1 = 1, + S3 = 3, + S4 = 4, + S5 = 5, +}; + +enum ec_smi_event { + EC_SMI_EVENT_IDLE = 0x80, + EC_SMI_BATTERY_LOW = 0xb3, +}; + +/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */ +static void ec_enter_apm_mode(void) +{ + ec_kbc_write_cmd(0x59); + ec_kbc_write_ib(0xE9); +} +/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */ +static void ec_enter_acpi_mode(void) +{ + ec_kbc_write_cmd(0x59); + ec_kbc_write_ib(0xE8); +} + +static uint8_t ec_get_smi_event(void) +{ + ec_kbc_write_cmd(0x56); + return ec_kbc_read_ob(); +} + +static void ec_process_smi(uint8_t src) +{ + /* Reading the SMI source satisfies the EC in terms of responding to + * the event, regardless of whether we take an action or not. + */ + + switch (src) { + case EC_SMI_BATTERY_LOW: + printk(BIOS_DEBUG, "Battery low. Shutting down\n"); + outl(ACPI_PM1_CNT_SLEEP(S5), ACPI_PM1_CNT_BLK); + break; + default: + printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src); + } +} + +static void handle_ec_smi(void) +{ + uint8_t src; + + while ((src = ec_get_smi_event()) != EC_SMI_EVENT_IDLE) + ec_process_smi(src); +} + +static void handle_lid_smi(void) +{ + /* Only triggered in non-ACPI mode on lid close. */ + outl(ACPI_PM1_CNT_SLEEP(S4), ACPI_PM1_CNT_BLK); +} + +int mainboard_smi_apmc(uint8_t data) +{ + switch (data) { + case ACPI_SMI_CMD_ENABLE: + printk(BIOS_DEBUG, "Enable ACPI mode\n"); + ec_enter_acpi_mode(); + hudson_disable_gevent_smi(EC_LID_GEVENT); + break; + case ACPI_SMI_CMD_DISABLE: + printk(BIOS_DEBUG, "Disable ACPI mode\n"); + ec_enter_apm_mode(); + hudson_configure_gevent_smi(EC_LID_GEVENT, SMI_MODE_SMI, + SMI_LVL_LOW); + break; + default: + printk(BIOS_DEBUG, "Unhandled ACPI command: 0x%x\n", data); + } + return 0; +} + +void mainboard_smi_gpi(uint32_t gpi_sts) +{ + if (gpi_sts & (1 << EC_SMI_GEVENT)) + handle_ec_smi(); + if (gpi_sts & (1 << EC_LID_GEVENT)) + handle_lid_smi(); +} diff --git a/src/mainboard/lenovo/l520/Makefile.inc b/src/mainboard/lenovo/l520/Makefile.inc index 0126a75fa0..e4b6fbf0f0 100644 --- a/src/mainboard/lenovo/l520/Makefile.inc +++ b/src/mainboard/lenovo/l520/Makefile.inc @@ -2,7 +2,6 @@ bootblock-y += gpio.c romstage-y += gpio.c -smm-y += smihandler.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads bootblock-y += early_init.c diff --git a/src/mainboard/lenovo/s230u/Makefile.inc b/src/mainboard/lenovo/s230u/Makefile.inc index 12e77097e4..31bb642edf 100644 --- a/src/mainboard/lenovo/s230u/Makefile.inc +++ b/src/mainboard/lenovo/s230u/Makefile.inc @@ -1,7 +1,6 @@ bootblock-y += gpio.c romstage-y += gpio.c ramstage-y += ec.c -smm-y += smihandler.c # FIXME: SPD images for samsung_8gb and hynix_8gb are missing. # It's possible that no mainboards with that variation were manufactured. diff --git a/src/mainboard/lenovo/t410/Makefile.inc b/src/mainboard/lenovo/t410/Makefile.inc index 20ec7604c9..3b410c4858 100644 --- a/src/mainboard/lenovo/t410/Makefile.inc +++ b/src/mainboard/lenovo/t410/Makefile.inc @@ -3,7 +3,6 @@ bootblock-y += early_init.c smm-y += dock.c -smm-y += smihandler.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads romstage-y += dock.c diff --git a/src/mainboard/lenovo/t420/Makefile.inc b/src/mainboard/lenovo/t420/Makefile.inc index 991eadbff2..e4b6fbf0f0 100644 --- a/src/mainboard/lenovo/t420/Makefile.inc +++ b/src/mainboard/lenovo/t420/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += gpio.c romstage-y += gpio.c diff --git a/src/mainboard/lenovo/t420s/Makefile.inc b/src/mainboard/lenovo/t420s/Makefile.inc index 991eadbff2..e4b6fbf0f0 100644 --- a/src/mainboard/lenovo/t420s/Makefile.inc +++ b/src/mainboard/lenovo/t420s/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += gpio.c romstage-y += gpio.c diff --git a/src/mainboard/lenovo/t430/Makefile.inc b/src/mainboard/lenovo/t430/Makefile.inc index 0f49600c7d..e402ffa605 100644 --- a/src/mainboard/lenovo/t430/Makefile.inc +++ b/src/mainboard/lenovo/t430/Makefile.inc @@ -1,6 +1,5 @@ bootblock-y += gpio.c romstage-y += gpio.c -smm-y += smihandler.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads bootblock-y += early_init.c diff --git a/src/mainboard/lenovo/t430s/Makefile.inc b/src/mainboard/lenovo/t430s/Makefile.inc index 196a0981f6..43a2a92301 100644 --- a/src/mainboard/lenovo/t430s/Makefile.inc +++ b/src/mainboard/lenovo/t430s/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/romstage.c diff --git a/src/mainboard/lenovo/t440p/Makefile.inc b/src/mainboard/lenovo/t440p/Makefile.inc index fa6e7af202..ebe01aea99 100644 --- a/src/mainboard/lenovo/t440p/Makefile.inc +++ b/src/mainboard/lenovo/t440p/Makefile.inc @@ -1,3 +1,2 @@ romstage-y += gpio.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -smm-y += smihandler.c diff --git a/src/mainboard/lenovo/t520/Makefile.inc b/src/mainboard/lenovo/t520/Makefile.inc index ab5aa4de91..a3b838ba10 100644 --- a/src/mainboard/lenovo/t520/Makefile.inc +++ b/src/mainboard/lenovo/t520/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/romstage.c diff --git a/src/mainboard/lenovo/t530/Makefile.inc b/src/mainboard/lenovo/t530/Makefile.inc index ab5aa4de91..a3b838ba10 100644 --- a/src/mainboard/lenovo/t530/Makefile.inc +++ b/src/mainboard/lenovo/t530/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/romstage.c diff --git a/src/mainboard/lenovo/x1_carbon_gen1/Makefile.inc b/src/mainboard/lenovo/x1_carbon_gen1/Makefile.inc index e9e74ddf3f..ea3bd287b5 100644 --- a/src/mainboard/lenovo/x1_carbon_gen1/Makefile.inc +++ b/src/mainboard/lenovo/x1_carbon_gen1/Makefile.inc @@ -2,7 +2,6 @@ subdirs-y += spd -smm-y += smihandler.c bootblock-y += gpio.c romstage-y += gpio.c diff --git a/src/mainboard/lenovo/x201/Makefile.inc b/src/mainboard/lenovo/x201/Makefile.inc index 80e513cd72..d185f5cbe5 100644 --- a/src/mainboard/lenovo/x201/Makefile.inc +++ b/src/mainboard/lenovo/x201/Makefile.inc @@ -3,7 +3,6 @@ bootblock-y += early_init.c smm-y += dock.c -smm-y += smihandler.c romstage-y += dock.c ramstage-y += dock.c romstage-y += gpio.c diff --git a/src/mainboard/lenovo/x220/Makefile.inc b/src/mainboard/lenovo/x220/Makefile.inc index d870c4dd19..b104bb52a9 100644 --- a/src/mainboard/lenovo/x220/Makefile.inc +++ b/src/mainboard/lenovo/x220/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/romstage.c diff --git a/src/mainboard/lenovo/x230/Makefile.inc b/src/mainboard/lenovo/x230/Makefile.inc index 5316d24d88..8e801f145d 100644 --- a/src/mainboard/lenovo/x230/Makefile.inc +++ b/src/mainboard/lenovo/x230/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c bootblock-y += variants/$(VARIANT_DIR)/early_init.c bootblock-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/early_init.c diff --git a/src/mainboard/packardbell/ms2290/Makefile.inc b/src/mainboard/packardbell/ms2290/Makefile.inc index 9b1ea087bd..86b9433353 100644 --- a/src/mainboard/packardbell/ms2290/Makefile.inc +++ b/src/mainboard/packardbell/ms2290/Makefile.inc @@ -1,6 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only -smm-y += smihandler.c romstage-y += gpio.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -- cgit v1.2.3