summaryrefslogtreecommitdiff
path: root/CorebootModulePkg/CbSupportPei/CbSupportPei.c
diff options
context:
space:
mode:
authorMaurice Ma <maurice.ma@intel.com>2015-06-03 02:44:28 +0000
committermauricema <mauricema@Edk2>2015-06-03 02:44:28 +0000
commit7b7fc3e78352284721ba722ac3b1e288e29f9af5 (patch)
tree1abd7b1032b365f7a32b1d86e2e4092ed0371cca /CorebootModulePkg/CbSupportPei/CbSupportPei.c
parent8e5015c217f0db852165de370742e165d7fd0723 (diff)
downloadedk2-platforms-7b7fc3e78352284721ba722ac3b1e288e29f9af5.tar.xz
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 <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
Diffstat (limited to 'CorebootModulePkg/CbSupportPei/CbSupportPei.c')
-rw-r--r--CorebootModulePkg/CbSupportPei/CbSupportPei.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
index 148062ff39..8ec7ba8d90 100644
--- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c
+++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
@@ -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 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#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 @@ CbPeiEntryPoint (
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;
}