diff options
Diffstat (limited to 'ReferenceCode/Chipset/LynxPoint/ActiveBios')
8 files changed, 762 insertions, 0 deletions
diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.c b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.c new file mode 100644 index 0000000..700d6b4 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.c @@ -0,0 +1,292 @@ +/** @file + Source file for the ActiveBios ActiveBios protocol implementation + +@copyright + Copyright (c) 2005 - 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and uniquely + identified as "Intel Reference Module" and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement + +**/ +#include "ActiveBios.h" + +// +// Prototypes for our ActiveBios protocol functions +// +static +EFI_STATUS +EFIAPI +SetState ( + IN EFI_ACTIVE_BIOS_PROTOCOL *This, + IN EFI_ACTIVE_BIOS_STATE DesiredState, + IN UINTN Key + ); + +static +EFI_STATUS +EFIAPI +LockState ( + IN EFI_ACTIVE_BIOS_PROTOCOL *This, + IN BOOLEAN Lock, + IN OUT UINTN *Key + ); + +// +// Function implementations +// + +/** + Change the current active BIOS settings to the requested state. + The caller is responsible for requesting a supported state from + the EFI_ACTIVE_BIOS_STATE selections. + This will fail if someone has locked the interface and the correct key is + not provided. + + @param[in] This Pointer to the EFI_ACTIVE_BIOS_PROTOCOL instance. + @param[in] DesiredState The requested state to configure the system for. + @param[in] Key If the interface is locked, Key must be the Key + returned from the LockState function call. + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_ACCESS_DENIED The interface is currently locked. +**/ +static +EFI_STATUS +EFIAPI +SetState ( + IN EFI_ACTIVE_BIOS_PROTOCOL *This, + IN EFI_ACTIVE_BIOS_STATE DesiredState, + IN UINTN Key + ) +{ + PCH_SERIES PchSeries; + PchSeries = GetPchSeries(); + /// + /// Verify requested state is allowed + /// + ASSERT (DesiredState < ActiveBiosStateMax); + + /// + /// Check if the interface is locked by another + /// + if (mPrivateData.Locked && Key != mPrivateData.CurrentKey) { + return EFI_ACCESS_DENIED; + } + + if ((MmioRead32 (mPchRootComplexBar + R_PCH_RCRB_GCS) & B_PCH_RCRB_GCS_BILD) == B_PCH_RCRB_GCS_BILD) { + return EFI_ACCESS_DENIED; + } + /// + /// Set the requested state + /// + switch (DesiredState) { + + case ActiveBiosStateSpi: + if (PchSeries == PchH) { + MmioAndThenOr16 ( + (UINTN) (mPchRootComplexBar + R_PCH_RCRB_GCS), + (UINT16) (~B_PCH_H_RCRB_GCS_BBS), + (UINT16) (V_PCH_H_RCRB_GCS_BBS_SPI) + ); + } + if (PchSeries == PchLp) { + MmioAndThenOr16 ( + (UINTN) (mPchRootComplexBar + R_PCH_RCRB_GCS), + (UINT16) (~B_PCH_LP_RCRB_GCS_BBS), + (UINT16) (V_PCH_LP_RCRB_GCS_BBS_SPI) + ); + } + break; + + case ActiveBiosStateLpc: + if (PchSeries == PchH) { + MmioAndThenOr16 ( + (UINTN) (mPchRootComplexBar + R_PCH_RCRB_GCS), + (UINT16) (~B_PCH_H_RCRB_GCS_BBS), + (UINT16) (V_PCH_H_RCRB_GCS_BBS_LPC) + ); + } + if (PchSeries == PchLp) { + MmioAndThenOr16 ( + (UINTN) (mPchRootComplexBar + R_PCH_RCRB_GCS), + (UINT16) (~B_PCH_LP_RCRB_GCS_BBS), + (UINT16) (V_PCH_LP_RCRB_GCS_BBS_LPC) + ); + } + break; + + default: + /// + /// This is an invalid use of the protocol + /// See definition, but caller must call with valid value + /// + ASSERT (!EFI_UNSUPPORTED); + break; + } + /// + /// Read state back + /// This ensures the chipset MMIO was flushed and updates the protocol state + /// + MmioRead16 (mPchRootComplexBar + R_PCH_RCRB_GCS); + + /// + /// Record current state + /// + mPrivateData.ActiveBiosProtocol.State = DesiredState; + + return EFI_SUCCESS; +} + +/** + Lock or unlock the current active BIOS state. + Key is a simple incrementing number. + + @param[in] This Pointer to the EFI_ACTIVE_BIOS_PROTOCOL instance. + @param[in] Lock TRUE to lock the current state, FALSE to unlock. + @param[in, out] Key If Lock is TRUE, then a key will be returned. If + Lock is FALSE, the key returned from the prior call + to lock the protocol must be provided to unlock the + protocol. The value of Key is undefined except that + it cannot be 0. + + @retval EFI_SUCCESS Command succeed. + @exception EFI_UNSUPPORTED The function is not supported. + @retval EFI_ACCESS_DENIED The interface is currently locked. +**/ +static +EFI_STATUS +EFIAPI +LockState ( + IN EFI_ACTIVE_BIOS_PROTOCOL *This, + IN BOOLEAN Lock, + IN OUT UINTN *Key + ) +{ + /// + /// Check if lock or unlock requesed + /// + if (Lock) { + /// + /// Check if already locked + /// + if (mPrivateData.Locked) { + return EFI_ACCESS_DENIED; + } + /// + /// Lock the interface + /// + mPrivateData.Locked = TRUE; + + /// + /// Increment the key + /// + mPrivateData.CurrentKey++; + + /// + /// Update the caller's copy + /// + *Key = mPrivateData.CurrentKey; + } else { + /// + /// Verify caller "owns" the current lock + /// + if (*Key == mPrivateData.CurrentKey) { + mPrivateData.Locked = FALSE; + } else { + return EFI_ACCESS_DENIED; + } + } + + return EFI_SUCCESS; +} + +/** + Initialization function for the ActiveBios protocol implementation. + + @param[in] This Pointer to the protocol + + @retval EFI_SUCCESS The function completed successfully +**/ +EFI_STATUS +ActiveBiosProtocolConstructor ( + IN EFI_ACTIVE_BIOS_PROTOCOL *This + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + EFI_GUID EfiActiveBiosProtocolGuid = EFI_ACTIVE_BIOS_PROTOCOL_GUID; + PCH_SERIES PchSeries; + PchSeries = GetPchSeries(); + + /// + /// Read current state from the PCH + /// + if (PchSeries == PchH) { + switch (MmioRead16 (mPchRootComplexBar + R_PCH_RCRB_GCS) & B_PCH_H_RCRB_GCS_BBS) { + + case V_PCH_H_RCRB_GCS_BBS_SPI: + mPrivateData.ActiveBiosProtocol.State = ActiveBiosStateSpi; + break; + + case V_PCH_H_RCRB_GCS_BBS_LPC: + mPrivateData.ActiveBiosProtocol.State = ActiveBiosStateLpc; + break; + + default: + /// + /// This is an invalid use of the protocol + /// See definition, but caller must call with valid value + /// + ASSERT (!EFI_UNSUPPORTED); + break; + } + } + + if (PchSeries == PchLp) { + switch (MmioRead16 (mPchRootComplexBar + R_PCH_RCRB_GCS) & B_PCH_LP_RCRB_GCS_BBS) { + + case V_PCH_LP_RCRB_GCS_BBS_SPI: + mPrivateData.ActiveBiosProtocol.State = ActiveBiosStateSpi; + break; + + case V_PCH_LP_RCRB_GCS_BBS_LPC: + mPrivateData.ActiveBiosProtocol.State = ActiveBiosStateLpc; + break; + + default: + /// + /// This is an invalid use of the protocol + /// See definition, but caller must call with valid value + /// + ASSERT (!EFI_UNSUPPORTED); + break; + } + } + mPrivateData.ActiveBiosProtocol.SetState = SetState; + mPrivateData.ActiveBiosProtocol.LockState = LockState; + mPrivateData.CurrentKey = 1; + mPrivateData.Locked = FALSE; + + /// + /// Install the protocol + /// + Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &EfiActiveBiosProtocolGuid, + &mPrivateData.ActiveBiosProtocol, + NULL + ); + return Status; +} diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.cif b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.cif new file mode 100644 index 0000000..92ebf07 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.cif @@ -0,0 +1,14 @@ +<component> + name = "ActiveBios" + category = ModulePart + LocalRoot = "ReferenceCode\Chipset\LynxPoint\ActiveBios\Dxe" + RefName = "ActiveBios" +[files] +"ActiveBios.sdl" +"ActiveBios.mak" +"ActiveBiosMain.c" +"ActiveBios.c" +"ActiveBios.h" +"ActiveBiosDepex.dxs" +"ActiveBios.inf" +<endComponent> diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.h b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.h new file mode 100644 index 0000000..49efbff --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.h @@ -0,0 +1,104 @@ +/** @file + Defines and prototypes for the ActiveBios driver. + This driver implements the ActiveBios protocol for the PCH. + It provides a simple implementation that allows for basic control + of the PCH flash mapping state. + +@copyright + Copyright (c) 2005 - 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and uniquely + identified as "Intel Reference Module" and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +**/ +#ifndef _ACTIVE_BIOS_H_ +#define _ACTIVE_BIOS_H_ + +// +// Include files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) + +#include "EdkIIGlueDxe.h" + +#include EFI_PROTOCOL_PRODUCER (ActiveBios) +#include "PchAccess.h" +#include "PchPlatformLib.h" +#endif +// +// Active BIOS private data +// +#define ACTIVE_BIOS_SIGNATURE EFI_SIGNATURE_32 ('D', 'P', 'B', 'A') + +typedef struct { + UINT32 Signature; + EFI_HANDLE Handle; + EFI_ACTIVE_BIOS_PROTOCOL ActiveBiosProtocol; + UINTN CurrentKey; + BOOLEAN Locked; +} ACTIVE_BIOS_INSTANCE; + +#define ACTIVE_BIOS_INSTANCE_FROM_ACTIVE_BIOS_THIS(a) \ + CR ( \ + a, \ + ACTIVE_BIOS_INSTANCE, \ + ActiveBiosProtocol, \ + ACTIVE_BIOS_SIGNATURE \ + ) + +// +// Driver global data +// +extern ACTIVE_BIOS_INSTANCE mPrivateData; +extern UINT32 mPchRootComplexBar; + +// +// Protocol constructor +// + +/** + Initialization function for the ActiveBios protocol implementation. + + @param[in] This Pointer to the protocol + + @retval EFI_SUCCESS The function completed successfully +**/ +EFI_STATUS +ActiveBiosProtocolConstructor ( + IN EFI_ACTIVE_BIOS_PROTOCOL *This + ); + +// +// Driver entry point +// + +/** + ActiveBios driver entry point function. + + @param[in] ImageHandle Image handle for this driver image + @param[in] SystemTable Pointer to the EFI System Table + + @retval EFI_SUCCESS Application completed successfully + @exception EFI_UNSUPPORTED Unsupported chipset detected +**/ +EFI_STATUS +InstallActiveBios ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + +#endif diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.inf b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.inf new file mode 100644 index 0000000..c8cc9f7 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.inf @@ -0,0 +1,77 @@ +## @file +# Component description file for the ActiveBios BS_DRIVER +# +#@copyright +# Copyright (c) 2005 - 2012 Intel Corporation. All rights reserved +# This software and associated documentation (if any) is furnished +# under a license and may only be used or copied in accordance +# with the terms of the license. Except as permitted by such +# license, no part of this software or documentation may be +# reproduced, stored in a retrieval system, or transmitted in any +# form or by any means without the express written consent of +# Intel Corporation. +# +# This file contains a 'Sample Driver' and is licensed as such +# under the terms of your license agreement with Intel or your +# vendor. This file may be modified by the user, subject to +# the additional terms of the license agreement +# + +[Defines] +BASE_NAME = ActiveBios +FILE_GUID = BFD59D42-FE0F-4251-B772-4B098A1AEC85 +COMPONENT_TYPE = BS_DRIVER + +[Sources.Common] + ActiveBios.c + ActiveBiosMain.c + ActiveBios.h +# +# Edk II Glue Driver Entry Point +# + EdkIIGlueDxeDriverEntryPoint.c + +[Libraries.Common] + EdkIIGlueBaseIoLibIntrinsic + EdkIIGlueDxeReportStatusCodeLib + EdkIIGlueDxeDebugLibReportStatusCode + EdkIIGlueUefiBootServicesTableLib + EdkIIGlueUefiRuntimeServicesTableLib + EdkIIGlueBasePciLibPciExpress + EdkProtocolLib + $(PROJECT_PCH_FAMILY)ProtocolLib + PchPlatformLib + +[Includes.Common] + $(EDK_SOURCE)/Foundation/Include + $(EDK_SOURCE)/Foundation/Efi/Include + $(EDK_SOURCE)/Foundation/Framework/Include + $(EDK_SOURCE)/Foundation/Efi + $(EFI_SOURCE)/$(PROJECT_PCH_ROOT) + $(EFI_SOURCE)/$(PROJECT_PCH_ROOT)/Include + $(EFI_SOURCE)/$(PROJECT_PCH_ROOT)/Include/Library +# +# EDK II Glue Library utilizes some standard headers from EDK +# + $(EFI_SOURCE) + $(EDK_SOURCE)/Foundation + $(EDK_SOURCE)/Foundation/Framework + $(EDK_SOURCE)/Foundation/Include/IndustryStandard + $(EDK_SOURCE)/Foundation/Core/Dxe + $(EDK_SOURCE)/Foundation/Include/Pei + $(EDK_SOURCE)/Foundation/Library/Dxe/Include + $(EDK_SOURCE)/Foundation/Library/EdkIIGlueLib/Include + +[Nmake.Common] + IMAGE_ENTRY_POINT = _ModuleEntryPoint + DPX_SOURCE = ActiveBiosDepex.dxs +# +# Module Entry Point +# + C_FLAGS = $(C_FLAGS) -D __EDKII_GLUE_MODULE_ENTRY_POINT__=InstallActiveBios + C_FLAGS = $(C_FLAGS) -D __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__ \ + -D __EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__ \ + -D __EDKII_GLUE_DXE_DEBUG_LIB_REPORT_STATUS_CODE__ \ + -D __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__ \ + -D __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__ \ + -D __EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__ diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.mak b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.mak new file mode 100644 index 0000000..9bc4a73 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.mak @@ -0,0 +1,96 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (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 Refcode/ActiveBios/ActiveBios.mak 2 2/24/12 2:09a Victortu $ +# +# $Revision: 2 $ +# +# $Date: 2/24/12 2:09a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Refcode/ActiveBios/ActiveBios.mak $ +# +# 2 2/24/12 2:09a Victortu +# Updated to support 4.6.5.3_IntelEDK_1117_Patch7_00. +# +# 1 2/08/12 8:40a Yurenlai +# Intel Lynx Point/SB eChipset initially releases. +# +#************************************************************************* +#--------------------------------------------------------------------------- +# CreateActiveBios Driver +#--------------------------------------------------------------------------- +EDK : ActiveBios +ActiveBios : $(BUILD_DIR)\ActiveBios.mak ActiveBiosBin + + +$(BUILD_DIR)\ActiveBios.mak : $(ActiveBios_DIR)\$(@B).cif $(ActiveBios_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(ActiveBios_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +ActiveBios_INCLUDES=\ + $(INTEL_PCH_INCLUDES)\ + $(EdkIIGlueLib_INCLUDES)\ + +ActiveBios_DEFINES = $(MY_DEFINES)\ + /D"__EDKII_GLUE_MODULE_ENTRY_POINT__=InstallActiveBios"\ + /D __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__ \ + /D __EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__ \ + /D __EDKII_GLUE_DXE_DEBUG_LIB_REPORT_STATUS_CODE__ \ + /D __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__ \ + /D __EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__ \ + /D __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__ \ + +ActiveBios_LIB_LINKS =\ +!IF "$(x64_BUILD)"=="1" + $(EdkIIGlueBaseLibX64_LIB)\ +!ELSE + $(EdkIIGlueBaseLibIA32_LIB)\ +!ENDIF + $(EdkIIGlueBaseIoLibIntrinsic_LIB)\ + $(EdkIIGlueDxeReportStatusCodeLib_LIB)\ + $(EdkIIGlueDxeDebugLibReportStatusCode_LIB)\ + $(EdkIIGlueUefiBootServicesTableLib_LIB)\ + $(EdkIIGlueBasePciLibPciExpress_LIB)\ + $(EDKPROTOCOLLIB)\ + $(INTEL_PCH_PROTOCOL_LIB)\ + $(PchPlatformDxeLib_LIB)\ + $(EdkIIGlueUefiRuntimeServicesTableLib_LIB)\ + +ActiveBiosBin: $(ActiveBios_LIB_LINKS) + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\ActiveBios.mak all \ + "MY_INCLUDES=$(ActiveBios_INCLUDES)" \ + "MY_DEFINES=$(ActiveBios_DEFINES)" \ + GUID=BFD59D42-FE0F-4251-B772-4B098A1AEC85\ + ENTRY_POINT=_ModuleEntryPoint \ + TYPE=BS_DRIVER \ + EDKIIModule=DXEDRIVER\ + DEPEX1=$(ActiveBios_DIR)\ActiveBiosDepex.dxs\ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX \ + COMPRESS=1 +#************************************************************************* +#************************************************************************* +#** ** +#** (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/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.sdl b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.sdl new file mode 100644 index 0000000..c53e064 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBios.sdl @@ -0,0 +1,67 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (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 Refcode/ActiveBios/ActiveBios.sdl 1 2/08/12 8:40a Yurenlai $ +# +# $Revision: 1 $ +# +# $Date: 2/08/12 8:40a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Refcode/ActiveBios/ActiveBios.sdl $ +# +# 1 2/08/12 8:40a Yurenlai +# Intel Lynx Point/SB eChipset initially releases. +# +#************************************************************************* +TOKEN + Name = "ActiveBios_SUPPORT" + Value = "1" + Help = "Main switch to enable ActiveBios support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +MODULE + File = "ActiveBios.mak" + Help = "Includes ActiveBios to Project" +End + +PATH + Name = "ActiveBios_DIR" + Help = "ActiveBios file source directory" +End + +ELINK + Name = "$(BUILD_DIR)\ActiveBios.ffs" + Parent = "FV_MAIN" + 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 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBiosDepex.dxs b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBiosDepex.dxs new file mode 100644 index 0000000..d7180b7 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBiosDepex.dxs @@ -0,0 +1,39 @@ +/** @file + Dispatch dependency expression file for the ActiveBios driver. + +@copyright + Copyright (c) 2005 - 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement + +**/ + +// +// Common for R8 and R9 codebase +// +#include "AutoGen.h" +#include "DxeDepex.h" + +// +// BUILD_WITH_GLUELIB and BUILD_WITH_EDKII_GLUE_LIB are both "defined" in R8 codebase; +// BUILD_WITH_EDKII_GLUE_LIB is defined in Edk-Dev-Snapshot-20070228 and later version +// BUILD_WITH_GLUELIB and BUILD_WITH_EDKII_GLUE_LIB are "not defined" in R9 codebase. +// +#if defined (BUILD_WITH_GLUELIB) || defined (BUILD_WITH_EDKII_GLUE_LIB) +#include "EfiDepex.h" +#endif + +DEPENDENCY_START + TRUE +DEPENDENCY_END + diff --git a/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBiosMain.c b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBiosMain.c new file mode 100644 index 0000000..7fd6a45 --- /dev/null +++ b/ReferenceCode/Chipset/LynxPoint/ActiveBios/Dxe/ActiveBiosMain.c @@ -0,0 +1,73 @@ +/** @file + Main implementation source file for the ActiveBios driver + +@copyright + Copyright (c) 2005 - 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and uniquely + identified as "Intel Reference Module" and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +**/ +#include "ActiveBios.h" + +// +// Global data +// +ACTIVE_BIOS_INSTANCE mPrivateData; +UINT32 mPchRootComplexBar; + +/** + ActiveBios driver entry point function. + + @param[in] ImageHandle Image handle for this driver image + @param[in] SystemTable Pointer to the EFI System Table + + @retval EFI_SUCCESS Application completed successfully + @exception EFI_UNSUPPORTED Unsupported chipset detected +**/ +EFI_STATUS +InstallActiveBios ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + Status = EFI_SUCCESS; + Handle = NULL; + + if (!IsPchSupported ()) { + DEBUG ((EFI_D_ERROR, "Active BIOS Protocol not supported due to no proper PCH LPC found!\n")); + return EFI_UNSUPPORTED; + } + /// + /// PCH RCBA must be initialized prior to run this driver. + /// + mPchRootComplexBar = PCH_RCRB_BASE; + ASSERT (mPchRootComplexBar != 0); + + /// + /// Initialize private data + /// + mPrivateData.Signature = ACTIVE_BIOS_SIGNATURE; + mPrivateData.Handle = ImageHandle; + + /// + /// Initialize our ActiveBios protocol + /// + Status = ActiveBiosProtocolConstructor (&mPrivateData.ActiveBiosProtocol); + ASSERT_EFI_ERROR (Status); + + return Status; +} |