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>
This commit is contained in:
Sean Rhodes 2025-04-09 12:34:52 +01:00 committed by Matt DeVillier
commit ba7ed69583

View file

@ -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);
}