]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CorebootModulePkg/CbSupportPei: Mask off all legacy 8259 interrupt sources
authorMaurice Ma <maurice.ma@intel.com>
Wed, 3 Jun 2015 02:44:28 +0000 (02:44 +0000)
committermauricema <mauricema@Edk2>
Wed, 3 Jun 2015 02:44:28 +0000 (02:44 +0000)
The current coreboot UEFI payload has an assumption that all interrupt
sources should be masked off before transferring control to the payload.
However, it is not the case on some platforms, such as QEMU. It will
cause boot failure due to unexpected pending interrupt in the payload.

To resolve it all legacy 8259 interrupt sources need to be masked
piror to the DXE phase. The fix was tested on QEMU virtual platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17550 6f19259b-4bc3-4df7-8a09-765794883524

CorebootModulePkg/CbSupportPei/CbSupportPei.c
CorebootModulePkg/CbSupportPei/CbSupportPei.h
CorebootModulePkg/CbSupportPei/CbSupportPei.inf

index 148062ff399171c369696605626b5c2ff9a8d192..8ec7ba8d903058b6ddaef606b93c601094fcbe5e 100644 (file)
@@ -2,7 +2,7 @@
   This PEIM will parse coreboot table in memory and report resource information into pei core. \r
   This file contains the main entrypoint of the PEIM.\r
   \r
   This PEIM will parse coreboot table in memory and report resource information into pei core. \r
   This file contains the main entrypoint of the PEIM.\r
   \r
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,6 +14,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 #include "CbSupportPei.h"\r
 \r
 **/\r
 #include "CbSupportPei.h"\r
 \r
+#define LEGACY_8259_MASK_REGISTER_MASTER  0x21\r
+#define LEGACY_8259_MASK_REGISTER_SLAVE   0xA1\r
+\r
 EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {\r
   { EfiACPIReclaimMemory,   0x008 },     \r
   { EfiACPIMemoryNVS,       0x004 },     \r
 EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {\r
   { EfiACPIReclaimMemory,   0x008 },     \r
   { EfiACPIMemoryNVS,       0x004 },     \r
@@ -374,7 +377,13 @@ CbPeiEntryPoint (
                CopyMem (pFbInfo, &FbInfo, sizeof (FRAME_BUFFER_INFO)); \r
                DEBUG ((EFI_D_ERROR, "Create frame buffer info guid hob\n"));           \r
        }\r
                CopyMem (pFbInfo, &FbInfo, sizeof (FRAME_BUFFER_INFO)); \r
                DEBUG ((EFI_D_ERROR, "Create frame buffer info guid hob\n"));           \r
        }\r
-         \r
+\r
+  //\r
+  // Mask off all legacy 8259 interrupt sources\r
+  //\r
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);\r
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE,  0xFF);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
index 544838523b6af1f68beacb4958cc1c8be95a183f..3c9a3fe61ec47ca7b44d7a0622b3a81c13d0e248 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file of Coreboot Support PEIM.\r
 \r
 /** @file\r
   The header file of Coreboot Support PEIM.\r
 \r
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -27,6 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PcdLib.h>\r
 #include <Library/CbParseLib.h>\r
 #include <Library/MtrrLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/CbParseLib.h>\r
 #include <Library/MtrrLib.h>\r
+#include <Library/IoLib.h>\r
 \r
 #include <Guid/SmramMemoryReserve.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
 \r
 #include <Guid/SmramMemoryReserve.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
index 93281515549320780b62969fd39f10c40877ae57..b88b6f07ffe3089eafdd60f6cf0e49b73d46bd17 100644 (file)
@@ -4,7 +4,7 @@
 # Parses coreboot table in memory and report resource information into pei core. It will install\r
 # the memory as required.\r
 #\r
 # Parses coreboot table in memory and report resource information into pei core. It will install\r
 # the memory as required.\r
 #\r
-#  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -51,6 +51,7 @@
   PcdLib\r
   CbParseLib\r
   MtrrLib\r
   PcdLib\r
   CbParseLib\r
   MtrrLib\r
+  IoLib\r
 \r
 [Guids]\r
   gEfiSmmPeiSmramMemoryReserveGuid\r
 \r
 [Guids]\r
   gEfiSmmPeiSmramMemoryReserveGuid\r