summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2025-04-09 12:34:52 +0100
committerMatt DeVillier <matt.devillier@gmail.com>2025-04-18 14:59:30 +0000
commitba7ed69583e772e13bc27b5560498524e3d08ef8 (patch)
treed89160304014793450d5d6d2a18ee02f763c8264 /src
parent9b80b36c4af38c620a3dfcfc6ca61d3dcdb61286 (diff)
downloadcoreboot-ba7ed69583e772e13bc27b5560498524e3d08ef8.tar.gz
coreboot-ba7ed69583e772e13bc27b5560498524e3d08ef8.tar.bz2
coreboot-ba7ed69583e772e13bc27b5560498524e3d08ef8.zip
soc/intel/cnvi: Skip calling _ON when device is already enabled
Add a check in the _ON method, similar to coreboot's ONSK handling in its RTD3 driver, to determine whether the enable GPIO is already asserted. This prevents the OS from repeatedly invoking _ON, which can happen because CNVi takes around 300ms to initialize after the GPIO is enabled. Change-Id: I53986aa11714666c12056460aa47396266a00a1c Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87240 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/common/block/cnvi/cnvi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/cnvi/cnvi.c b/src/soc/intel/common/block/cnvi/cnvi.c
index 1c668ba7365a..6d7bbad4e8fa 100644
--- a/src/soc/intel/common/block/cnvi/cnvi.c
+++ b/src/soc/intel/common/block/cnvi/cnvi.c
@@ -113,6 +113,9 @@ static void cnvw_fill_ssdt(const struct device *dev)
* Method(_ON, 0)
* {
* If (CondRefOf (\_SB.PCI0.CNVC)) {
+ * If ((\_SB.PCI0.CNVS() == 1)) {
+ * Return (1)
+ * }
* \_SB.PCI0.CNVS(1)
* }
* }
@@ -194,6 +197,17 @@ static void cnvw_fill_ssdt(const struct device *dev)
{
acpigen_write_if_cond_ref_of("\\_SB.PCI0.CNVC");
{
+
+ acpigen_write_store();
+ acpigen_emit_namestring("\\_SB.PCI0.CNVS");
+ acpigen_emit_byte(LOCAL0_OP);
+
+ acpigen_write_if_lequal_op_int(LOCAL0_OP, 1);
+ {
+ acpigen_write_return_integer(1);
+ }
+ acpigen_pop_len();
+
acpigen_emit_namestring("\\_SB.PCI0.CNVC");
acpigen_emit_byte(1);
}