From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.6895.1603674442137987747 for ; Sun, 25 Oct 2020 18:07:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: heng.luo@intel.com) IronPort-SDR: NkuhGnKcBWAveEQbXdnUpYdBjsSuGATSKWzIf0H2wnxlXU8JSU8wLqWc4Fvvaps2McOnCD0b7V mtcwxVtHNxOg== X-IronPort-AV: E=McAfee;i="6000,8403,9785"; a="252565341" X-IronPort-AV: E=Sophos;i="5.77,417,1596524400"; d="scan'208";a="252565341" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2020 18:07:21 -0700 IronPort-SDR: 8i0F6uvAsZjl/eajJ3FlblhT8lLS/LZzJB92A7WiW6avvRGG9p88dIHFPWMj1/qfRWOg8QgN5i R/2l7EMPVIMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,417,1596524400"; d="scan'208";a="525333818" Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.154]) by fmsmga005.fm.intel.com with ESMTP; 25 Oct 2020 18:07:20 -0700 From: "Heng Luo" To: devel@edk2.groups.io Cc: Eric Dong , Chasel Chiu , Nate DeSimone Subject: [Patch V2] BoardModulePkg: Early connect PCI Root Bridge in BoardBdsHookLib Date: Mon, 26 Oct 2020 09:07:17 +0800 Message-Id: <20201026010717.5240-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: 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