public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Heng Luo" <heng.luo@intel.com>
To: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>,
	Chasel Chiu <chasel.chiu@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: [Patch V2] BoardModulePkg: Early connect PCI Root Bridge in BoardBdsHookLib
Date: Mon, 26 Oct 2020 09:07:17 +0800	[thread overview]
Message-ID: <20201026010717.5240-1-heng.luo@intel.com> (raw)

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3016

Trigger PCI Bus scanning at BdsBeforeConsoleAfterTrustedConsoleCallback().
Move the call to EnumUsbKeyboard() to after PciEnumComplete.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 77 ++++++++++++++++++++++++++++++++++++++---------------------------------------
 1 file changed, 38 insertions(+), 39 deletions(-)

diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.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 (
 
   gBootMode                  = GetBootModeHob ();
 
-  //
-  // Connect Root Bridge to make PCI BAR resource allocated and all PciIo created
-  //
-  ConnectRootBridge (FALSE);
-
   //
   // Fill ConIn/ConOut in Full Configuration boot mode
   //
@@ -1180,6 +1175,42 @@ BdsPciEnumCompleteCallback (
     }
   }
 
+  //
+  // Enumerate USB keyboard
+  //
+  EnumUsbKeyboard ();
+
+  //
+  // For trusted console it must be handled here.
+  //
+  UpdateGraphicConOut (TRUE);
+
+  //
+  // Register Boot Options
+  //
+  RegisterDefaultBootOption ();
+
+  //
+  // Register Static Hot keys
+  //
+  RegisterStaticHotkey ();
+
+  //
+  // Process Physical Preo
+  //
+  PERF_START_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7010);
+  if (PcdGetBool (PcdTpm2Enable)) {
+    ProcessTcgPp ();
+    ProcessTcgMor ();
+  }
+  PERF_END_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7011);
+
+  //
+  // Perform memory test
+  // We should make all UEFI memory and GCD information populated before ExitPmAuth.
+  // SMM may consume these information.
+  //
+  MemoryTest((EXTENDMEM_COVERAGE_LEVEL) PcdGet32 (PcdPlatformMemoryCheckLevel));
 }
 
 /**
@@ -1265,41 +1296,9 @@ BdsBeforeConsoleAfterTrustedConsoleCallback (
   DEBUG ((DEBUG_INFO, "Event gBdsEventBeforeConsoleBeforeEndOfDxeGuid callback starts\n"));
 
   //
-  // Enumerate USB keyboard
-  //
-  EnumUsbKeyboard ();
-
-  //
-  // For trusted console it must be handled here.
-  //
-  UpdateGraphicConOut (TRUE);
-
-  //
-  // Register Boot Options
-  //
-  RegisterDefaultBootOption ();
-
-  //
-  // Register Static Hot keys
-  //
-  RegisterStaticHotkey ();
-
-  //
-  // Process Physical Preo
-  //
-  PERF_START_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7010);
-  if (PcdGetBool (PcdTpm2Enable)) {
-    ProcessTcgPp ();
-    ProcessTcgMor ();
-  }
-  PERF_END_EX(NULL,"EventRec", NULL, AsmReadTsc(), 0x7011);
-
-  //
-  // Perform memory test
-  // We should make all UEFI memory and GCD information populated before ExitPmAuth.
-  // SMM may consume these information.
+  // Connect Root Bridge to make PCI BAR resource allocated and all PciIo created
   //
-  MemoryTest((EXTENDMEM_COVERAGE_LEVEL) PcdGet32 (PcdPlatformMemoryCheckLevel));
+  ConnectRootBridge (FALSE);
 }
 
 
-- 
2.24.0.windows.2


             reply	other threads:[~2020-10-26  1:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  1:07 Heng Luo [this message]
2020-10-26  3:17 ` [Patch V2] BoardModulePkg: Early connect PCI Root Bridge in BoardBdsHookLib Chiu, Chasel
2020-10-26 21:49 ` Nate DeSimone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201026010717.5240-1-heng.luo@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox