From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web09.5202.1603244122507605543 for ; Tue, 20 Oct 2020 18:35:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: heng.luo@intel.com) IronPort-SDR: wyxYmDo/xhPFu5OwmGoLs1GmN2/YIpmRnnmcoKHgXi4u+t4ewWFMQbucEDR0g4BRpeJITGaevm 4QHHnswF48lA== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="147158162" X-IronPort-AV: E=Sophos;i="5.77,399,1596524400"; d="scan'208";a="147158162" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 18:35:22 -0700 IronPort-SDR: 46NPu+dhhWcstsJ9boaCmUHx10xCNvTCB2+tFUU85DISxm7XSTKBxfOTmbihN6cG5tRp5y1c0H EMAXuV9KH4yQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,399,1596524400"; d="scan'208";a="316215475" Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.154]) by orsmga003.jf.intel.com with ESMTP; 20 Oct 2020 18:35:19 -0700 From: "Heng Luo" To: devel@edk2.groups.io Cc: Eric Dong , Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [PATCH] BoardModulePkg: Early connect PCI Root Bridge in BoardBdsHookLib Date: Wed, 21 Oct 2020 09:35:05 +0800 Message-Id: <20201021013505.3073-1-heng.luo@intel.com> X-Mailer: git-send-email 2.24.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3016 Trigger PCI Bus scanning at BdsBeforeConsoleAfterTrustedConsoleCallback(). Move the call to EnumUsbKeyboard() to after PciEnumComplete. Cc: Eric Dong Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Heng Luo --- Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | = 77 ++++++++++++++++++++++++++++++++++++++----------------------------------= ----- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBds= HookLib.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsH= ookLib.c index 9d42a8c27f..d7612fb80a 100644 --- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib= .c +++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib= .c @@ -1141,11 +1141,6 @@ BdsPciEnumCompleteCallback ( =0D gBootMode =3D GetBootModeHob ();=0D =0D - //=0D - // Connect Root Bridge to make PCI BAR resource allocated and all PciIo = created=0D - //=0D - ConnectRootBridge (FALSE);=0D -=0D //=0D // Fill ConIn/ConOut in Full Configuration boot mode=0D //=0D @@ -1180,6 +1175,42 @@ BdsPciEnumCompleteCallback ( }=0D }=0D =0D + //=0D + // Enumerate USB keyboard=0D + //=0D + EnumUsbKeyboard ();=0D +=0D + //=0D + // For trusted console it must be handled here.=0D + //=0D + UpdateGraphicConOut (TRUE);=0D +=0D + //=0D + // Register Boot Options=0D + //=0D + RegisterDefaultBootOption ();=0D +=0D + //=0D + // Register Static Hot keys=0D + //=0D + RegisterStaticHotkey ();=0D +=0D + //=0D + // Process Physical Preo=0D + //=0D + PERF_START_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7010);=0D + if (PcdGetBool (PcdTpm2Enable)) {=0D + ProcessTcgPp ();=0D + ProcessTcgMor ();=0D + }=0D + PERF_END_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7011);=0D +=0D + //=0D + // Perform memory test=0D + // We should make all UEFI memory and GCD information populated before E= xitPmAuth.=0D + // SMM may consume these information.=0D + //=0D + MemoryTest((EXTENDMEM_COVERAGE_LEVEL) PcdGet32 (PcdPlatformMemoryCheckLe= vel));=0D }=0D =0D /**=0D @@ -1265,41 +1296,9 @@ BdsBeforeConsoleAfterTrustedConsoleCallback ( DEBUG ((DEBUG_INFO, "Event gBdsEventBeforeConsoleBeforeEndOfDxeGuid call= back starts\n"));=0D =0D //=0D - // Enumerate USB keyboard=0D - //=0D - EnumUsbKeyboard ();=0D -=0D - //=0D - // For trusted console it must be handled here.=0D - //=0D - UpdateGraphicConOut (TRUE);=0D -=0D - //=0D - // Register Boot Options=0D - //=0D - RegisterDefaultBootOption ();=0D -=0D - //=0D - // Register Static Hot keys=0D - //=0D - RegisterStaticHotkey ();=0D -=0D - //=0D - // Process Physical Preo=0D - //=0D - PERF_START_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7010);=0D - if (PcdGetBool (PcdTpm2Enable)) {=0D - ProcessTcgPp ();=0D - ProcessTcgMor ();=0D - }=0D - PERF_END_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7011);=0D -=0D - //=0D - // Perform memory test=0D - // We should make all UEFI memory and GCD information populated before E= xitPmAuth.=0D - // SMM may consume these information.=0D + // Connect Root Bridge to make PCI BAR resource allocated and all PciIo = created=0D //=0D - MemoryTest((EXTENDMEM_COVERAGE_LEVEL) PcdGet32 (PcdPlatformMemoryCheckLe= vel));=0D + ConnectRootBridge (FALSE);=0D }=0D =0D =0D --=20 2.24.0.windows.2