From 0476770659485ad42a91a1975eac15fb7bee559a Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Sat, 15 Feb 2025 19:45:22 +0000 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/86450 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/soc/intel/common/block/cnvi/cnvi.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/soc/intel/common/block/cnvi/cnvi.c b/src/soc/intel/common/block/cnvi/cnvi.c index e0a9566b1f..f0821973f2 100644 --- a/src/soc/intel/common/block/cnvi/cnvi.c +++ b/src/soc/intel/common/block/cnvi/cnvi.c @@ -129,11 +129,13 @@ static void cnvw_fill_ssdt(const struct device *dev) * 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 @@ static void cnvw_fill_ssdt(const struct device *dev) 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();