Sean Rhodes has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86450?usp=email )
Change subject: soc/intel/cnvi: Deref BTRK as it might not exist ......................................................................
soc/intel/cnvi: Deref BTRK as it might not exist
Check for the existence of BTRK method before attempting to call it, as coreboot doesn't enforce its creation.
Change-Id: Ibb0dace635c6a014ce65ae3d1c96a92ff991ce5b Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/86450 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/common/block/cnvi/cnvi.c 1 file changed, 16 insertions(+), 10 deletions(-)
Approvals: Matt DeVillier: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/soc/intel/common/block/cnvi/cnvi.c b/src/soc/intel/common/block/cnvi/cnvi.c index e0a9566..f082197 100644 --- a/src/soc/intel/common/block/cnvi/cnvi.c +++ b/src/soc/intel/common/block/cnvi/cnvi.c @@ -129,11 +129,13 @@ * If (((PCRR (CNVI_SIDEBAND_ID, CNVI_ABORT_PLDR) & CNVI_ABORT_REQUEST) == Zero)) * { * Local2 = Zero - * If ((_SB.PCI0.GBTR() == One)) - * { - * _SB.PCI0.BTRK (Zero) - * Sleep (105) - * Local2 = One + * If (CondRefOf (_SB.PCI0.GBTR)) { + * If ((_SB.PCI0.GBTR() == One)) + * { + * _SB.PCI0.BTRK (Zero) + * Sleep (105) + * Local2 = One + * } * } * PCRO (CNVI_SIDEBAND_ID, CNVI_ABORT_PLDR, CNVI_ABORT_REQUEST | CNVI_ABORT_ENABLE) * Sleep (10) @@ -233,14 +235,18 @@ acpigen_write_if_lequal_op_int(LOCAL0_OP, 0); { acpigen_write_store_int_to_op(0, LOCAL2_OP); - acpigen_write_if_lequal_namestr_int("\_SB.PCI0.GBTR", 1); + acpigen_write_if_cond_ref_of("\_SB.PCI0.GBTR"); { - acpigen_emit_namestring("\_SB.PCI0.BTRK"); - acpigen_emit_byte(0); + acpigen_write_if_lequal_namestr_int("\_SB.PCI0.GBTR", 1); + { + acpigen_emit_namestring("\_SB.PCI0.BTRK"); + acpigen_emit_byte(0);
- acpigen_write_sleep(105); + acpigen_write_sleep(105);
- acpigen_write_store_ops(1, LOCAL2_OP); + acpigen_write_store_ops(1, LOCAL2_OP); + } + acpigen_pop_len(); } acpigen_pop_len();