]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
Add PcdFastPS2Detection to improve PS2 keyboard driver start performance.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2Keyboard.c
index c73cf936131830a75148cc95550ce7ed2f6a6b5d..4f8799087684332445329ea18c19af28e516580f 100644 (file)
@@ -263,15 +263,17 @@ KbdControllerDriverStart (
   //\r
   // Return code is ignored on purpose.\r
   //\r
-  KeyboardRead (ConsoleIn, &Data);\r
-  if ((KeyReadStatusRegister (ConsoleIn) & (KBC_PARE | KBC_TIM)) == (KBC_PARE | KBC_TIM)) {\r
-    //\r
-    // If nobody decodes KBC I/O port, it will read back as 0xFF.\r
-    // Check the Time-Out and Parity bit to see if it has an active KBC in system\r
-    //\r
-    Status      = EFI_DEVICE_ERROR;\r
-    StatusCode  = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED;\r
-    goto ErrorExit;\r
+  if (!PcdGetBool (PcdFastPS2Detection)) {\r
+    KeyboardRead (ConsoleIn, &Data);\r
+    if ((KeyReadStatusRegister (ConsoleIn) & (KBC_PARE | KBC_TIM)) == (KBC_PARE | KBC_TIM)) {\r
+      //\r
+      // If nobody decodes KBC I/O port, it will read back as 0xFF.\r
+      // Check the Time-Out and Parity bit to see if it has an active KBC in system\r
+      //\r
+      Status      = EFI_DEVICE_ERROR;\r
+      StatusCode  = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED;\r
+      goto ErrorExit;\r
+    }\r
   }\r
   \r
   //\r