Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52874 )
Change subject: soc/intel/{adl,tgl,jsl}: Enable power button smi after BS_CHIPS_EXIT
......................................................................
soc/intel/{adl,tgl,jsl}: Enable power button smi after BS_CHIPS_EXIT
On tgl, we noticed system hang if a shutdown is triggered before fsps.
The dut is unable to shutdown properly due to tcss is stuck before
tcss_init in fsps.
This change enable power button smi on jsl, tgl, adl after fsps.
it can also prevent a shutdown failure due to lack of fsps init on
certain ip.
BUG=b:186194102, b:186815114
TEST=Power on the system and pressing power button repeatedly doesn't
cause the system hang during shutdown.
Change-Id: I70b871f2676a89bc782116e02beba5c20ec51eef
Signed-off-by: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52874
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
---
M src/soc/intel/alderlake/cpu.c
M src/soc/intel/alderlake/pmc.c
M src/soc/intel/jasperlake/cpu.c
M src/soc/intel/jasperlake/pmc.c
M src/soc/intel/tigerlake/cpu.c
M src/soc/intel/tigerlake/pmc.c
6 files changed, 38 insertions(+), 6 deletions(-)
Approvals:
build bot (Jenkins): Verified
Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c
index 6de1cb0..b975212 100644
--- a/src/soc/intel/alderlake/cpu.c
+++ b/src/soc/intel/alderlake/cpu.c
@@ -99,10 +99,12 @@
cpu_set_max_ratio();
/*
- * Now that all APs have been relocated as well as the BSP let SMIs
+ * 1. Now that all APs have been relocated as well as the BSP let SMIs
* start flowing.
+ * 2. Skip enabling power button SMI and enable it after BS_CHIPS_INIT
+ * to avoid shutdown hang due to lack of init on certain IP in FSP-S.
*/
- global_smi_enable();
+ global_smi_enable_no_pwrbtn();
}
static const struct mp_ops mp_ops = {
diff --git a/src/soc/intel/alderlake/pmc.c b/src/soc/intel/alderlake/pmc.c
index e4c1009..03399c3 100644
--- a/src/soc/intel/alderlake/pmc.c
+++ b/src/soc/intel/alderlake/pmc.c
@@ -18,6 +18,7 @@
#include <soc/pm.h>
#include <soc/soc_chip.h>
#include <stdint.h>
+#include <bootstate.h>
#define PMC_HID "INTC1026"
@@ -141,6 +142,14 @@
pmc_set_acpi_mode();
}
+static void pm1_enable_pwrbtn_smi(void *unused)
+{
+ /* Enable power button SMI after BS_DEV_INIT_CHIPS (FSP-S) is done. */
+ pmc_update_pm1_enable(PWRBTN_EN);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_DEV_INIT_CHIPS, BS_ON_EXIT, pm1_enable_pwrbtn_smi, NULL);
+
struct device_operations pmc_ops = {
.read_resources = soc_pmc_read_resources,
.set_resources = noop_set_resources,
diff --git a/src/soc/intel/jasperlake/cpu.c b/src/soc/intel/jasperlake/cpu.c
index 8e54eaa..86077ff 100644
--- a/src/soc/intel/jasperlake/cpu.c
+++ b/src/soc/intel/jasperlake/cpu.c
@@ -93,10 +93,12 @@
cpu_set_max_ratio();
/*
- * Now that all APs have been relocated as well as the BSP let SMIs
+ * 1. Now that all APs have been relocated as well as the BSP let SMIs
* start flowing.
+ * 2. Skip enabling power button SMI and enable it after BS_CHIPS_INIT
+ * to avoid shutdown hang due to lack of init on certain IP in FSP-S.
*/
- global_smi_enable();
+ global_smi_enable_no_pwrbtn();
}
static const struct mp_ops mp_ops = {
diff --git a/src/soc/intel/jasperlake/pmc.c b/src/soc/intel/jasperlake/pmc.c
index c0507d6..dce791c 100644
--- a/src/soc/intel/jasperlake/pmc.c
+++ b/src/soc/intel/jasperlake/pmc.c
@@ -93,6 +93,14 @@
pmc_set_acpi_mode();
}
+static void pm1_enable_pwrbtn_smi(void *unused)
+{
+ /* Enable power button SMI after BS_DEV_INIT_CHIPS (FSP-S) is done. */
+ pmc_update_pm1_enable(PWRBTN_EN);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_DEV_INIT_CHIPS, BS_ON_EXIT, pm1_enable_pwrbtn_smi, NULL);
+
struct device_operations pmc_ops = {
.read_resources = soc_pmc_read_resources,
.set_resources = noop_set_resources,
diff --git a/src/soc/intel/tigerlake/cpu.c b/src/soc/intel/tigerlake/cpu.c
index 925bddb..7bb9e61 100644
--- a/src/soc/intel/tigerlake/cpu.c
+++ b/src/soc/intel/tigerlake/cpu.c
@@ -99,10 +99,12 @@
cpu_set_max_ratio();
/*
- * Now that all APs have been relocated as well as the BSP let SMIs
+ * 1. Now that all APs have been relocated as well as the BSP let SMIs
* start flowing.
+ * 2. Skip enabling power button SMI and enable it after BS_CHIPS_INIT
+ * to avoid shutdown hang due to lack of init on certain IP in FSP-S.
*/
- global_smi_enable();
+ global_smi_enable_no_pwrbtn();
}
static const struct mp_ops mp_ops = {
diff --git a/src/soc/intel/tigerlake/pmc.c b/src/soc/intel/tigerlake/pmc.c
index c5a4ae5..190f3ff 100644
--- a/src/soc/intel/tigerlake/pmc.c
+++ b/src/soc/intel/tigerlake/pmc.c
@@ -18,6 +18,7 @@
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/soc_chip.h>
+#include <bootstate.h>
#define PMC_HID "INTC1026"
@@ -145,6 +146,14 @@
pmc_set_acpi_mode();
}
+static void pm1_enable_pwrbtn_smi(void *unused)
+{
+ /* Enable power button SMI after BS_DEV_INIT_CHIPS (FSP-S) is done. */
+ pmc_update_pm1_enable(PWRBTN_EN);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_DEV_INIT_CHIPS, BS_ON_EXIT, pm1_enable_pwrbtn_smi, NULL);
+
struct device_operations pmc_ops = {
.read_resources = soc_pmc_read_resources,
.set_resources = noop_set_resources,
--
To view, visit https://review.coreboot.org/c/coreboot/+/52874
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I70b871f2676a89bc782116e02beba5c20ec51eef
Gerrit-Change-Number: 52874
Gerrit-PatchSet: 8
Gerrit-Owner: Kane Chen <kane.chen(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Rasheed Hsueh <rasheed.hsueh(a)lcfc.corp-partner.google.com>
Gerrit-CC: Stanley Wu <stanley1.wu(a)lcfc.corp-partner.google.com>
Gerrit-CC: Sunshine Chao <sunshine.chao(a)lcfc.corp-partner.google.com>
Gerrit-MessageType: merged
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52873 )
Change subject: soc/intel/{adl,tgl,jsl}: Add smihandler_soc_disable_busmaster
......................................................................
soc/intel/{adl,tgl,jsl}: Add smihandler_soc_disable_busmaster
If a power button SMI is triggered between where it is currently
enabled and before FSP-S exits, when the SMI handler disables
bus mastering for all devices, it inadvertently also disables
the PMC's I/O decoding, so the register write to actually go into
S5 does not succeed, and the system hangs.
This can be solved by skipping the PMC when disabling bus
mastering in the SMI handler, for which a callback,
smihandler_soc_disable_busmaster is provided.
BUG=b:186194102, b:186815114
TEST=Power on the system and pressing power button repeatedly doesn't
cause the system hang during shutdown.
Change-Id: I1cf5cf91ebad4a49df6679e01fc88ff60c81526c
Signed-off-by: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52873
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
---
M src/soc/intel/alderlake/smihandler.c
M src/soc/intel/jasperlake/smihandler.c
M src/soc/intel/tigerlake/smihandler.c
3 files changed, 24 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/soc/intel/alderlake/smihandler.c b/src/soc/intel/alderlake/smihandler.c
index a072138..5b53038 100644
--- a/src/soc/intel/alderlake/smihandler.c
+++ b/src/soc/intel/alderlake/smihandler.c
@@ -24,6 +24,14 @@
heci_disable();
}
+int smihandler_soc_disable_busmaster(pci_devfn_t dev)
+{
+ /* Skip disabling PMC bus master to keep IO decode enabled */
+ if (dev == PCH_DEV_PMC)
+ return 0;
+ return 1;
+}
+
const smi_handler_t southbridge_smi[SMI_STS_BITS] = {
[SMI_ON_SLP_EN_STS_BIT] = smihandler_southbridge_sleep,
[APM_STS_BIT] = smihandler_southbridge_apmc,
diff --git a/src/soc/intel/jasperlake/smihandler.c b/src/soc/intel/jasperlake/smihandler.c
index 448c053..2e38b68 100644
--- a/src/soc/intel/jasperlake/smihandler.c
+++ b/src/soc/intel/jasperlake/smihandler.c
@@ -24,6 +24,14 @@
heci_disable();
}
+int smihandler_soc_disable_busmaster(pci_devfn_t dev)
+{
+ /* Skip disabling PMC bus master to keep IO decode enabled */
+ if (dev == PCH_DEV_PMC)
+ return 0;
+ return 1;
+}
+
const smi_handler_t southbridge_smi[SMI_STS_BITS] = {
[SMI_ON_SLP_EN_STS_BIT] = smihandler_southbridge_sleep,
[APM_STS_BIT] = smihandler_southbridge_apmc,
diff --git a/src/soc/intel/tigerlake/smihandler.c b/src/soc/intel/tigerlake/smihandler.c
index 67d21f8..6280fb2 100644
--- a/src/soc/intel/tigerlake/smihandler.c
+++ b/src/soc/intel/tigerlake/smihandler.c
@@ -24,6 +24,14 @@
heci_disable();
}
+int smihandler_soc_disable_busmaster(pci_devfn_t dev)
+{
+ /* Skip disabling PMC bus master to keep IO decode enabled */
+ if (dev == PCH_DEV_PMC)
+ return 0;
+ return 1;
+}
+
const smi_handler_t southbridge_smi[SMI_STS_BITS] = {
[SMI_ON_SLP_EN_STS_BIT] = smihandler_southbridge_sleep,
[APM_STS_BIT] = smihandler_southbridge_apmc,
--
To view, visit https://review.coreboot.org/c/coreboot/+/52873
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1cf5cf91ebad4a49df6679e01fc88ff60c81526c
Gerrit-Change-Number: 52873
Gerrit-PatchSet: 7
Gerrit-Owner: Kane Chen <kane.chen(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Rasheed Hsueh <rasheed.hsueh(a)lcfc.corp-partner.google.com>
Gerrit-CC: Stanley Wu <stanley1.wu(a)lcfc.corp-partner.google.com>
Gerrit-CC: Sunshine Chao <sunshine.chao(a)lcfc.corp-partner.google.com>
Gerrit-MessageType: merged
Attention is currently required from: Star Labs.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/52798 )
Change subject: soc/mainboard: Add Star Labs labtop series
......................................................................
Patch Set 14:
(1 comment)
File src/mainboard/starlabs/labtop/Kconfig:
https://review.coreboot.org/c/coreboot/+/52798/comment/512fd2b4_0fa2e287
PS14, Line 26: HAVE_IFD_BIN
resolve commented options
--
To view, visit https://review.coreboot.org/c/coreboot/+/52798
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I37c74d03d86fb124ed96e45d1bf137eb2ec57251
Gerrit-Change-Number: 52798
Gerrit-PatchSet: 14
Gerrit-Owner: Star Labs <admin(a)starlabs.systems>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Star Labs <admin(a)starlabs.systems>
Gerrit-Comment-Date: Fri, 07 May 2021 06:00:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Hung-Te Lin, Yidi Lin.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/53895 )
Change subject: soc/mediatek/mt8195: Configure eMMC and SDCard
......................................................................
Patch Set 1:
(6 comments)
File src/mainboard/google/cherry/mainboard.c:
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-118645):
https://review.coreboot.org/c/coreboot/+/53895/comment/6f2a5865_363c7525
PS1, Line 88: MSDC1_GPIO_MODE0_0, MSDC1_GPIO_MODE0_VALUE,
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-118645):
https://review.coreboot.org/c/coreboot/+/53895/comment/444d3757_090c2a10
PS1, Line 89: MSDC1_GPIO_MODE0_1, MSDC1_GPIO_MODE0_VALUE);
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-118645):
https://review.coreboot.org/c/coreboot/+/53895/comment/b0149bd8_60a9221d
PS1, Line 93: MSDC1_GPIO_MODE1_0, MSDC1_GPIO_MODE1_VALUE,
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-118645):
https://review.coreboot.org/c/coreboot/+/53895/comment/9182a24d_6b6a4728
PS1, Line 94: MSDC1_GPIO_MODE1_1, MSDC1_GPIO_MODE1_VALUE,
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-118645):
https://review.coreboot.org/c/coreboot/+/53895/comment/ef30a62c_59f098be
PS1, Line 95: MSDC1_GPIO_MODE1_2, MSDC1_GPIO_MODE1_VALUE,
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-118645):
https://review.coreboot.org/c/coreboot/+/53895/comment/65229edd_c6b011a8
PS1, Line 96: MSDC1_GPIO_MODE1_3, MSDC1_GPIO_MODE1_VALUE);
code indent should use tabs where possible
--
To view, visit https://review.coreboot.org/c/coreboot/+/53895
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0ed82e860612e8a62f361e60d217280f775ab239
Gerrit-Change-Number: 53895
Gerrit-PatchSet: 1
Gerrit-Owner: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Yidi Lin <yidi.lin(a)mediatek.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Yidi Lin <yidi.lin(a)mediatek.com>
Gerrit-Comment-Date: Fri, 07 May 2021 05:57:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment