Revision: 17550
          http://sourceforge.net/p/edk2/code/17550
Author:   mauricema
Date:     2015-06-03 02:44:28 +0000 (Wed, 03 Jun 2015)
Log Message:
-----------
CorebootModulePkg/CbSupportPei: Mask off all legacy 8259 interrupt sources

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 <[email protected]>
Reviewed-by: Prince Agyeman <[email protected]>

Modified Paths:
--------------
    trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.c
    trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.h
    trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.inf

Modified: trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.c
===================================================================
--- trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.c    2015-06-02 
14:02:39 UTC (rev 17549)
+++ trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.c    2015-06-03 
02:44:28 UTC (rev 17550)
@@ -2,7 +2,7 @@
   This PEIM will parse coreboot table in memory and report resource 
information into pei core. 
   This file contains the main entrypoint of the PEIM.
   
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -14,6 +14,9 @@
 **/
 #include "CbSupportPei.h"
 
+#define LEGACY_8259_MASK_REGISTER_MASTER  0x21
+#define LEGACY_8259_MASK_REGISTER_SLAVE   0xA1
+
 EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
   { EfiACPIReclaimMemory,   0x008 },     
   { EfiACPIMemoryNVS,       0x004 },     
@@ -374,7 +377,13 @@
                CopyMem (pFbInfo, &FbInfo, sizeof (FRAME_BUFFER_INFO)); 
                DEBUG ((EFI_D_ERROR, "Create frame buffer info guid hob\n"));   
        
        }
-         
+
+  //
+  // Mask off all legacy 8259 interrupt sources
+  //
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE,  0xFF);
+
   return EFI_SUCCESS;
 }
 

Modified: trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.h
===================================================================
--- trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.h    2015-06-02 
14:02:39 UTC (rev 17549)
+++ trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.h    2015-06-03 
02:44:28 UTC (rev 17550)
@@ -1,7 +1,7 @@
 /** @file
   The header file of Coreboot Support PEIM.
 
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -27,6 +27,7 @@
 #include <Library/PcdLib.h>
 #include <Library/CbParseLib.h>
 #include <Library/MtrrLib.h>
+#include <Library/IoLib.h>
 
 #include <Guid/SmramMemoryReserve.h>
 #include <Guid/MemoryTypeInformation.h>

Modified: trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.inf
===================================================================
--- trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.inf  2015-06-02 
14:02:39 UTC (rev 17549)
+++ trunk/edk2/CorebootModulePkg/CbSupportPei/CbSupportPei.inf  2015-06-03 
02:44:28 UTC (rev 17550)
@@ -4,7 +4,7 @@
 # Parses coreboot table in memory and report resource information into pei 
core. It will install
 # the memory as required.
 #
-#  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -51,6 +51,7 @@
   PcdLib
   CbParseLib
   MtrrLib
+  IoLib
 
 [Guids]
   gEfiSmmPeiSmramMemoryReserveGuid


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to