From 31bb486c913795c8b67d1c4dbaae2bdec4943fc9 Mon Sep 17 00:00:00 2001 From: raywu Date: Thu, 13 Sep 2018 16:11:56 +0800 Subject: SLP1.0 / SLP2.0 / Default Password / Logo / Fix Boot Order --- Core/EM/Slp10/OemTable.asm | 67 ++++++++++++++++++++++++ Core/EM/Slp10/Slp10.c | 125 +++++++++++++++++++++++++++++++++++++++++++++ Core/EM/Slp10/Slp10.chm | Bin 0 -> 24774 bytes Core/EM/Slp10/Slp10.cif | 14 +++++ Core/EM/Slp10/Slp10.dxs | 18 +++++++ Core/EM/Slp10/Slp10.h | 104 +++++++++++++++++++++++++++++++++++++ Core/EM/Slp10/Slp10.mak | 83 ++++++++++++++++++++++++++++++ Core/EM/Slp10/Slp10.sdl | 43 ++++++++++++++++ 8 files changed, 454 insertions(+) create mode 100644 Core/EM/Slp10/OemTable.asm create mode 100644 Core/EM/Slp10/Slp10.c create mode 100644 Core/EM/Slp10/Slp10.chm create mode 100644 Core/EM/Slp10/Slp10.cif create mode 100644 Core/EM/Slp10/Slp10.dxs create mode 100644 Core/EM/Slp10/Slp10.h create mode 100644 Core/EM/Slp10/Slp10.mak create mode 100644 Core/EM/Slp10/Slp10.sdl (limited to 'Core/EM/Slp10') diff --git a/Core/EM/Slp10/OemTable.asm b/Core/EM/Slp10/OemTable.asm new file mode 100644 index 0000000..0eb3902 --- /dev/null +++ b/Core/EM/Slp10/OemTable.asm @@ -0,0 +1,67 @@ +;************************************************************************* +;************************************************************************* +;** ** +;** (C)Copyright 1985-2009, American Megatrends, Inc. ** +;** ** +;** All Rights Reserved. ** +;** ** +;** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +;** ** +;** Phone: (770)-246-8600 ** +;** ** +;************************************************************************* +;************************************************************************* + +;***************************************************************************** +; $Header: /Alaska/SOURCE/Modules/Slp10/OemTable.asm 1 6/18/09 5:31p Vyacheslava $ +; +; $Revision: 1 $ +; +; $Date: 6/18/09 5:31p $ +;***************************************************************************** +; Revision History +; ---------------- +; $Log: /Alaska/SOURCE/Modules/Slp10/OemTable.asm $ +; +; 1 6/18/09 5:31p Vyacheslava +; Initial Creation +; +;***************************************************************************** +; +; +; Name: OemTable.asm +; +; Description: This is OEM table binary for Aptio Firmware Volume. +; +; +;***************************************************************************** + + INCLUDE token.equ + +.686p +.model flat +.data + +slp_string_size SIZESTR MKF_SLP_STRING + + DB '$ODB$', 0 + DW 001h + DW MKF_OEM_DATA_SPACE_SIZE + DB @CATSTR(,%MKF_SLP_STRING,) + DB [MKF_OEM_DATA_SPACE_SIZE - slp_string_size] DUP (0) + +end + +;************************************************************************* +;************************************************************************* +;** ** +;** (C)Copyright 1985-2009, American Megatrends, Inc. ** +;** ** +;** All Rights Reserved. ** +;** ** +;** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +;** ** +;** Phone: (770)-246-8600 ** +;** ** +;************************************************************************* +;************************************************************************* diff --git a/Core/EM/Slp10/Slp10.c b/Core/EM/Slp10/Slp10.c new file mode 100644 index 0000000..b83edd5 --- /dev/null +++ b/Core/EM/Slp10/Slp10.c @@ -0,0 +1,125 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//***************************************************************************** +// $Header: /Alaska/SOURCE/Modules/Slp10/Slp10.c 1 6/18/09 5:31p Vyacheslava $ +// +// $Revision: 1 $ +// +// $Date: 6/18/09 5:31p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/Slp10/Slp10.c $ +// +// 1 6/18/09 5:31p Vyacheslava +// Initial Creation +// +// +//***************************************************************************** +// +// +// Name: Slp10.c +// +// Description: Implementation of the SLP 1.0 eModule. +// +// +//***************************************************************************** + +//---------------------------------------------------------------------------- + +#include +#include +#include +#include "Slp10.h" + +//---------------------------------------------------------------------------- + +// +//---------------------------------------------------------------------------- +// +// Procedure: Slp10_EntryPoint +// +// Description: This function is the entry point of the Slp10 eModule. +// +// Parameter: +// ImageHandle - Image handle for this driver image. +// SystemTable - Pointer to the EFI system table. +// +// Return value: EFI_STATUS +// +//---------------------------------------------------------------------------- +// + +EFI_STATUS Slp10_EntryPoint( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) +{ + EFI_STATUS Status; + EFI_GUID EfiLegacyBiosExtProtocolGuid = EFI_LEGACY_BIOS_EXT_PROTOCOL_GUID; + EFI_GUID BiosFeaturesSectionGuid = BIOS_FEATURES_SECTION_GUID; + EFI_LEGACY_BIOS_EXT_PROTOCOL *LegacyBiosExtProtocol = NULL; + UINT8 *DataPtr = NULL; + UINTN Size = 0; + UINTN Address; + + InitAmiLib( ImageHandle, SystemTable ); + + // Get OEM data from Aptio FV + Status = ReadImageResource( + ImageHandle, + &BiosFeaturesSectionGuid, + &DataPtr, + &Size + ); + if (EFI_ERROR(Status)) + return Status; + + // Locate the Aptio extended Legacy Protocol + Status = pBS->LocateProtocol( + &EfiLegacyBiosExtProtocolGuid, + NULL, + &LegacyBiosExtProtocol + ); + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) + return Status; + + // Copy OEM Data to Legacy Table + Address = LegacyBiosExtProtocol->CopyLegacyTable( + ((BIOS_OEM_DATA*)DataPtr)->Data, // Pointer to SLP data + OEM_DATA_SPACE_SIZE, // Size of the data + 1, // Alignment + OEM_DATA_LOCATION_BIT // Location Attribute + ); + ASSERT_EFI_ERROR(Address); + + Status = pBS->FreePool(DataPtr); + ASSERT_EFI_ERROR(Status); + return Status; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Core/EM/Slp10/Slp10.chm b/Core/EM/Slp10/Slp10.chm new file mode 100644 index 0000000..f58c4ab Binary files /dev/null and b/Core/EM/Slp10/Slp10.chm differ diff --git a/Core/EM/Slp10/Slp10.cif b/Core/EM/Slp10/Slp10.cif new file mode 100644 index 0000000..8d7ed77 --- /dev/null +++ b/Core/EM/Slp10/Slp10.cif @@ -0,0 +1,14 @@ + + name = "Slp10" + category = eModule + LocalRoot = "Core\EM\Slp10\" + RefName = "Slp10" +[files] +"Slp10.sdl" +"Slp10.mak" +"Slp10.c" +"Slp10.dxs" +"OemTable.asm" +"Slp10.h" +"Slp10.chm" + diff --git a/Core/EM/Slp10/Slp10.dxs b/Core/EM/Slp10/Slp10.dxs new file mode 100644 index 0000000..4ce0411 --- /dev/null +++ b/Core/EM/Slp10/Slp10.dxs @@ -0,0 +1,18 @@ +// +//---------------------------------------------------------------------------- +// Name: Slp10.dxs +// +// Description: This file is the dependency file for Slp10 driver +// +//---------------------------------------------------------------------------- +// + +//---------------------------------------------------------------------------- +// Header files for GUID definitions +//---------------------------------------------------------------------------- + +#include + +DEPENDENCY_START + EFI_LEGACY_BIOS_PROTOCOL_GUID +DEPENDENCY_END diff --git a/Core/EM/Slp10/Slp10.h b/Core/EM/Slp10/Slp10.h new file mode 100644 index 0000000..8a6ed2b --- /dev/null +++ b/Core/EM/Slp10/Slp10.h @@ -0,0 +1,104 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//***************************************************************************** +// $Header: /Alaska/SOURCE/Modules/Slp10/Slp10.h 1 6/18/09 5:31p Vyacheslava $ +// +// $Revision: 1 $ +// +// $Date: 6/18/09 5:31p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/Slp10/Slp10.h $ +// +// 1 6/18/09 5:31p Vyacheslava +// Initial Creation +// +// +//***************************************************************************** +// +// +// Name: Slp10.h +// +// Description: Internal header file of the Slp10 eModule. +// +// +//***************************************************************************** + +#ifndef _AMI_SLP10_MODULE_H +#define _AMI_SLP10_MODULE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// {2EBE0275-6458-4af9-91ED-D3F4EDB100AA} +#define BIOS_FEATURES_SECTION_GUID \ + {0x2ebe0275, 0x6458, 0x4af9, 0x91, 0xed, 0xd3, 0xf4, 0xed, 0xb1, 0x0, 0xaa} + +#define OEM_DATA_LOCATION_BIT 0x80 + +#pragma pack(1) + +// +//---------------------------------------------------------------------------- +// Name: BIOS_OEM_DATA +// +// Description: This structure comes out of the AMI Utility Specification. +// +// Fields: +// Name Type Description +// --------------------------------------------------------------------------- +// Guid EFI_GUID Firmware Section GUID +// Identifier CHAR8 Identifier String "$ODB$" +// Flag UINT16 Data Flag +// Size UINT16 Data Size +// Data UINT8 Data Buffer (SLP String) +// +//---------------------------------------------------------------------------- +// + +typedef struct _BIOS_OEM_DATA { + EFI_GUID Guid; + CHAR8 Identifier[6]; + UINT16 Flag; + UINT16 Size; + UINT8 Data[OEM_DATA_SPACE_SIZE]; +} BIOS_OEM_DATA; + +#pragma pack() + +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Core/EM/Slp10/Slp10.mak b/Core/EM/Slp10/Slp10.mak new file mode 100644 index 0000000..13dbef2 --- /dev/null +++ b/Core/EM/Slp10/Slp10.mak @@ -0,0 +1,83 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2009, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#***************************************************************************** +# $Header: /Alaska/SOURCE/Modules/Slp10/Slp10.mak 2 7/14/09 12:26p Vyacheslava $ +# +# $Revision: 2 $ +# +# $Date: 7/14/09 12:26p $ +#***************************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/Slp10/Slp10.mak $ +# +# 2 7/14/09 12:26p Vyacheslava +# EIP#17468: Synopsis: customers are requesting support for SLP1.0. +# Description: Mandal, We have support for SLP2.0 but not SLP1.0. Core8 +# has support for both and customers ar requesting SLP1.0 support. Please +# let us know your plans for this. +# - Removed $(BUILD_DIR)\AmiHpLibrary.lib. +# +# 1 6/18/09 5:31p Vyacheslava +# Initial Creation +# +#***************************************************************************** +# +# +# Name: Slp10.mak +# +# Description: Make file for Slp10 eModule. +# +# +#***************************************************************************** + +all : Slp10 + +Slp10 : $(BUILD_DIR)\Slp10.mak $(BUILD_DIR)\OemTable.bin Slp10Bin + +SLP10_OBJECTS = $(BUILD_DIR)\$(Slp10_DIR)\Slp10.obj + +$(BUILD_DIR)\Slp10.mak : $(Slp10_DIR)\$(@B).cif $(Slp10_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(Slp10_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +$(BUILD_DIR)\OemTable.bin : $(Slp10_DIR)\OemTable.asm + $(ASM) /c /Fo$(BUILD_DIR)\ $(Slp10_DIR)\OemTable.asm + $(ASMLINK) $(BUILD_DIR)\OemTable.obj, $*.exe, $*.map,,, + exe2bin $*.exe $@ + +Slp10Bin : $(AMIDXELIB) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\Slp10.mak all\ + GUID=8E477676-55FD-48cf-9210-15A99B27D740\ + OBJECTS="$(SLP10_OBJECTS)" \ + ENTRY_POINT=Slp10_EntryPoint\ + RESOURCE=$(BUILD_DIR)\OemTable.bin\ + SECTION_GUID=2EBE0275-6458-4af9-91ED-D3F4EDB100AA\ + TYPE=BS_DRIVER\ + COMPRESS=1 + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2009, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Core/EM/Slp10/Slp10.sdl b/Core/EM/Slp10/Slp10.sdl new file mode 100644 index 0000000..136d9b7 --- /dev/null +++ b/Core/EM/Slp10/Slp10.sdl @@ -0,0 +1,43 @@ +TOKEN + Name = Slp10_SUPPORT + Value = 1 + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes + Help = "Main switch to enable Slp10 support in Project" +End + +TOKEN + Name = "OEM_DATA_SPACE_SIZE" + Value = "0x3E" + Help = "Maximum OEM data space size." + TokenType = Integer + TargetEQU = Yes + TargetH = Yes +End + +TOKEN + Name = "SLP_STRING" + Value = "Copyright American Megatrends Inc. 1985-2009" + Help = "SLP string." + TokenType = Expression + TargetEQU = Yes +End + +PATH + Name = Slp10_DIR + Help = "Path to Slp10 Module in Project" +End + +MODULE + Help = "Includes Slp10.mak to Project" + File = "Slp10.mak" +End + +ELINK + Name = "$(BUILD_DIR)\Slp10.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + -- cgit v1.2.3