summaryrefslogtreecommitdiff
path: root/Chipset/SB/PchWrap/WdtApp/Pei
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Chipset/SB/PchWrap/WdtApp/Pei
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Chipset/SB/PchWrap/WdtApp/Pei')
-rw-r--r--Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.CIF11
-rw-r--r--Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.c136
-rw-r--r--Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.dxs47
-rw-r--r--Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.mak66
-rw-r--r--Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.sdl68
5 files changed, 328 insertions, 0 deletions
diff --git a/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.CIF b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.CIF
new file mode 100644
index 0000000..0fabb1c
--- /dev/null
+++ b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.CIF
@@ -0,0 +1,11 @@
+<component>
+ name = "WdtAppPei"
+ category = ModulePart
+ LocalRoot = "Chipset\SB\PchWrap\WdtApp\Pei\"
+ RefName = "WdtAppPei"
+[files]
+"WdtAppPei.sdl"
+"WdtAppPei.mak"
+"WdtAppPei.c"
+"WdtAppPei.dxs"
+<endComponent>
diff --git a/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.c b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.c
new file mode 100644
index 0000000..7171b49
--- /dev/null
+++ b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.c
@@ -0,0 +1,136 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.c 1 2/08/12 8:34a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:34a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.c $
+//
+// 1 2/08/12 8:34a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+
+#include <Efi.h>
+#include <Pei.h>
+#include <Token.h>
+#include <AmiPeiLib.h>
+#include <AmiCspLib.h>
+
+#include "PchAccess.h"
+#include "WdtAppVariable.h"
+#include <Ppi\Wdt\Wdt.h>
+#include <PPI\ReadOnlyVariable.h>
+
+#ifdef EFI_DEBUG
+#define WDT_TIMEOUT_BETWEEN_PEI_DXE 30
+#else
+#define WDT_TIMEOUT_BETWEEN_PEI_DXE 10
+#endif
+
+EFI_GUID gWdtPpiGuid = WDT_PPI_GUID;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: WdtAppPeiEntryPoint
+//
+// Description: Turns on WDT during PEI phase according to requests made by
+// OS overclocking application (through WDT status) and BIOS
+// modules (through flash variable)
+//
+// Input: *FfsHeader - Pointer to Firmware File System file header.
+// *PeiServices - General purpose services available to every PEIM.
+//
+// Output: EFI_SUCCESS if everything's OK
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS
+WdtAppPeiEntryPoint (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+{
+ EFI_STATUS Status;
+ WDT_PPI *WdtPei;
+ EFI_GUID WdtPersistentData = WDT_PERSISTENT_DATA_GUID;
+ EFI_GUID gPeiReadOnlyVariablePpiGuid = EFI_PEI_READ_ONLY_VARIABLE_PPI_GUID;
+ WDT_PERSISTENT_DATA WdtStateData;
+ EFI_PEI_READ_ONLY_VARIABLE_PPI *ReadOnlyVariable;
+ UINTN VariableSize;
+
+ PEI_TRACE((-1, PeiServices, "(WdtApp) WdtAppPei Entry Point\n"));
+
+ Status = (*PeiServices)->LocatePpi (
+ PeiServices,
+ &gPeiReadOnlyVariablePpiGuid,
+ 0, NULL,
+ &ReadOnlyVariable
+ );
+ ASSERT_PEI_ERROR (PeiServices, Status);
+
+ VariableSize = sizeof(WdtStateData);
+
+ Status = ReadOnlyVariable->GetVariable (
+ PeiServices,
+ WDT_PERSISTENT_DATA_C_NAME,
+ &WdtPersistentData,
+ NULL,
+ &VariableSize,
+ &WdtStateData
+ );
+
+ if (EFI_ERROR(Status)) {
+ WdtStateData.Enable = 0;
+ }
+
+ Status = (*PeiServices)->LocatePpi (
+ PeiServices,
+ &gWdtPpiGuid,
+ 0,
+ NULL,
+ &WdtPei
+ );
+
+ ASSERT_PEI_ERROR (PeiServices, Status);
+
+ if (WdtPei->IsWdtRequired() == TRUE || WdtStateData.Enable == 1) {
+ WdtPei->ReloadAndStart(WDT_TIMEOUT_BETWEEN_PEI_DXE);
+ }
+
+ return EFI_SUCCESS;
+}
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
diff --git a/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.dxs b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.dxs
new file mode 100644
index 0000000..e78218e
--- /dev/null
+++ b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.dxs
@@ -0,0 +1,47 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.dxs 1 2/08/12 8:34a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:34a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.dxs $
+//
+// 1 2/08/12 8:34a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+#include <Ppi\Wdt\Wdt.h>
+
+DEPENDENCY_START
+WDT_PPI_GUID
+DEPENDENCY_END
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.mak b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.mak
new file mode 100644
index 0000000..c6f3127
--- /dev/null
+++ b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.mak
@@ -0,0 +1,66 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
+
+#*************************************************************************
+# $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.mak 1 2/08/12 8:34a Yurenlai $
+#
+# $Revision: 1 $
+#
+# $Date: 2/08/12 8:34a $
+#*************************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.mak $
+#
+# 1 2/08/12 8:34a Yurenlai
+# Intel Lynx Point/SB eChipset initially releases.
+#
+#*************************************************************************
+all : WdtAppPei
+
+$(BUILD_DIR)\WdtAppPei.mak : $(WdtAppPei_DIR)\$(@B).cif $(BUILD_RULES)
+ $(CIF2MAK) $(WdtAppPei_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+WdtAppPei : $(BUILD_DIR)\WdtAppPei.mak WdtAppPeiBin
+
+WdtAppPei_INCLUDES=\
+ $(INTEL_PCH_INCLUDES)\
+ $(WDT_APP_INCLUDES)\
+
+WdtAppPeiBin : $(AMIPEILIB) $(AMICSPLib)
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS) \
+ /f $(BUILD_DIR)\WdtAppPei.mak all \
+ "MY_INCLUDES = $(WdtAppPei_INCLUDES)" \
+ NAME=WdtAppPei\
+ MAKEFILE=$(BUILD_DIR)\WdtAppPei.mak \
+ GUID=0F69F6D7-0E4B-43a6-BFC2-6871694369B0 \
+ ENTRY_POINT=WdtAppPeiEntryPoint \
+ TYPE=PEIM \
+ DEPEX1=$(WdtAppPei_DIR)\WdtAppPei.dxs \
+ DEPEX1_TYPE=EFI_SECTION_PEI_DEPEX \
+ COMPRESS=0
+
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
diff --git a/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.sdl b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.sdl
new file mode 100644
index 0000000..8f0c3b9
--- /dev/null
+++ b/Chipset/SB/PchWrap/WdtApp/Pei/WdtAppPei.sdl
@@ -0,0 +1,68 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
+
+#*************************************************************************
+# $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.sdl 1 2/08/12 8:34a Yurenlai $
+#
+# $Revision: 1 $
+#
+# $Date: 2/08/12 8:34a $
+#*************************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/PchWrap/WdtApp/WdtAppPei/WdtAppPei.sdl $
+#
+# 1 2/08/12 8:34a Yurenlai
+# Intel Lynx Point/SB eChipset initially releases.
+#
+#*************************************************************************
+TOKEN
+ Name = "WdtAppPei_SUPPORT"
+ Value = "1"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+ Help = "Main switch to enable WDT APP support in Project in PEI Phase"
+End
+
+MODULE
+ Help = "Includes WdtAppPei.mak to Project"
+ File = "WdtAppPei.mak"
+End
+
+PATH
+ Name = "WdtAppPei_DIR"
+ Help = "WdtAppPei dir"
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\WdtAppPei.ffs"
+ Parent = "FV_BB"
+ InvokeOrder = AfterParent
+End
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************