summaryrefslogtreecommitdiff
path: root/Board/EM/Setup
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 /Board/EM/Setup
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Board/EM/Setup')
-rw-r--r--Board/EM/Setup/Advanced.vfr184
-rw-r--r--Board/EM/Setup/AmiSetupProtocol.c270
-rw-r--r--Board/EM/Setup/Boot.vfr255
-rw-r--r--Board/EM/Setup/Chipset.vfr107
-rw-r--r--Board/EM/Setup/Exit.vfr212
-rw-r--r--Board/EM/Setup/Logo.bmpbin0 -> 43002 bytes
-rw-r--r--Board/EM/Setup/Main.vfr239
-rw-r--r--Board/EM/Setup/Security.vfr168
-rw-r--r--Board/EM/Setup/Setup.c1541
-rw-r--r--Board/EM/Setup/Setup.cif23
-rw-r--r--Board/EM/Setup/Setup.dxs63
-rw-r--r--Board/EM/Setup/Setup.mak259
-rw-r--r--Board/EM/Setup/Setup.sdl129
-rw-r--r--Board/EM/Setup/Setup.unibin0 -> 24774 bytes
-rw-r--r--Board/EM/Setup/SetupPrivate.h76
15 files changed, 3526 insertions, 0 deletions
diff --git a/Board/EM/Setup/Advanced.vfr b/Board/EM/Setup/Advanced.vfr
new file mode 100644
index 0000000..d6a6fe7
--- /dev/null
+++ b/Board/EM/Setup/Advanced.vfr
@@ -0,0 +1,184 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Board/Setup/Advanced.vfr 14 7/29/11 5:31p Artems $
+//
+// $Revision: 14 $
+//
+// $Date: 7/29/11 5:31p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Advanced.vfr $
+//
+// 14 7/29/11 5:31p Artems
+// EIP 63462 - driver health support from boot manager
+//
+// 13 2/14/11 11:13a Felixp
+// Enhancement (EIP 53146):
+// Support to Treat Dynamic IFR Pages as subpages
+// (not as top level menu items).
+// The changes necessary to support the corresponding TSE feature are
+// added.
+//
+// 12 6/11/10 12:22p Felixp
+// AMI_CALLBACK_VARSTORE added
+//
+// 11 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 10 6/30/09 2:33p Robert
+// comment corrections
+//
+// 9 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 8 10/30/07 10:46a Felixp
+// AMITSESETUP varstore definition added
+//
+// 7 10/19/05 2:07p Felixp
+// Support for custom varstores (in .sd files) added.
+//
+// 6 9/30/05 11:21a Yul
+// definition of varstore SYSTEM_ACCESS added
+//
+// 5 9/06/05 6:19p Girim
+// Code cleanup.
+//
+// 3 7/12/05 11:13a Felixp
+// workaround for VFR compiler bug in varstore handling
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//**********************************************************************
+//
+// Name: Advanced.vfr
+//
+// Description:
+// Setup script for the "Advanced" top level setup screen
+//
+//**********************************************************************
+//<AMI_FHDR_END>
+
+#include "SetupPrivate.h"
+#define ADVANCED_FORM_SET
+#define FORM_SET_TYPEDEF
+#include <SetupDefinitions.h>
+#undef FORM_SET_TYPEDEF
+
+formset guid = ADVANCED_FORM_SET_GUID,
+ title = STRING_TOKEN(STR_ADVANCED),
+ help = STRING_TOKEN(STR_ADVANCED_HELP),
+ class = ADVANCED_FORM_SET_CLASS,
+ subclass = 0,
+
+ SETUP_DATA_VARSTORE
+ SYSTEM_ACCESS_VARSTORE
+ AMITSESETUP_VARSTORE
+ AMI_CALLBACK_VARSTORE
+
+#if SETUP_GROUP_DYNAMIC_PAGES
+ varstore DYNAMIC_PAGE_COUNT, key = DYNAMIC_PAGE_COUNT_KEY_ID,
+ name = DynamicPageCount, guid = DYNAMIC_PAGE_COUNT_GUID;
+#endif
+
+#if DRIVER_HEALTH_SUPPORT
+ varstore DRIVER_HEALTH_ENABLE, key = DRIVER_HEALTH_ENB_KEY_ID,
+ name = DriverHlthEnable, guid = AMITSE_DRIVER_HEALTH_ENB_GUID;
+
+ varstore DRIVER_HEALTH, key = DRIVER_HEALTH_KEY_ID,
+ name = DriverHealthCount, guid = AMITSE_DRIVER_HEALTH_GUID;
+
+ varstore DRIVER_HEALTH_CTRL_COUNT, key = DRIVER_HEALTH_CTRL_KEY_ID,
+ name = DrvHealthCtrlCnt, guid = AMITSE_DRIVER_HEALTH_CTRL_GUID;
+#endif
+
+ #define FORM_SET_VARSTORE
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_VARSTORE
+
+ form formid = AUTO_ID(ADVANCED_MAIN),
+ title = STRING_TOKEN(STR_ADVANCED);
+
+ #define FORM_SET_ITEM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_ITEM
+ #define FORM_SET_GOTO
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_GOTO
+
+#if SETUP_GROUP_DYNAMIC_PAGES
+ SEPARATOR
+ suppressif ideqvallist DYNAMIC_PAGE_COUNT.PageCount == 0xFFFF;
+ goto ADVANCED_MAIN,
+ prompt = STRING_TOKEN(STR_EMPTY),
+ help = STRING_TOKEN(STR_EMPTY);
+ endif;
+#endif
+
+#if DRIVER_HEALTH_SUPPORT
+ suppressif ideqvallist DRIVER_HEALTH_ENABLE.Enable == 0xFFFF;
+ goto DRIVER_HEALTH_FORM,
+ prompt = STRING_TOKEN (STR_DRV_HEALTH),
+ help = STRING_TOKEN (STR_DRV_HEALTH_HELP);
+ endif;
+#endif
+
+ endform;
+
+#if DRIVER_HEALTH_SUPPORT
+ form
+ formid = AUTO_ID (DRIVER_HEALTH_FORM),
+ title = STRING_TOKEN (STR_DRV_HEALTH);
+
+ suppressif ideqvallist DRIVER_HEALTH.DrvHandleCount == 0xFFFF;
+ goto DRIVER_HEALTH_SUBFORM,
+ prompt = STRING_TOKEN (STR_EMPTY),
+ help = STRING_TOKEN (STR_DRV_HEALTH_HELP);
+ endif;
+ endform;
+
+ form
+ formid = AUTO_ID (DRIVER_HEALTH_SUBFORM),
+ title = STRING_TOKEN (STR_DRV_HEALTH);
+
+ suppressif ideqvallist DRIVER_HEALTH_CTRL_COUNT.DrvHealthCtrlCnt == 0xFFFF;
+ goto DRIVER_HEALTH_SUBFORM,
+ prompt = STRING_TOKEN (STR_EMPTY),
+ help = STRING_TOKEN (STR_DRV_HEALTH_HELP);
+ endif;
+ endform;
+#endif
+
+ #define FORM_SET_FORM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_FORM
+endformset;
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Board/EM/Setup/AmiSetupProtocol.c b/Board/EM/Setup/AmiSetupProtocol.c
new file mode 100644
index 0000000..d392526
--- /dev/null
+++ b/Board/EM/Setup/AmiSetupProtocol.c
@@ -0,0 +1,270 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+///**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/AmiSetupProtocol.c 3 10/04/12 4:49p Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 10/04/12 4:49p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/AmiSetupProtocol.c $
+//
+// 3 10/04/12 4:49p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Added function headers for CHM builder
+// [Files] AmiSetupProtocol.c
+//
+// 2 8/29/12 2:36p Artems
+// [TAG] EIP N/A
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] setup control interactive callback doesn't work
+// [RootCause] When there are no runtime-registered callbacks,
+// build-time callbacks don't present in callback list
+// [Solution] Fixed code logic to handle situation with no runtime
+// callbacks
+// [Files] AmiSetupProtocol.c Setup.c
+//
+// 1 8/28/12 4:10p Artems
+// [TAG] EIP N/A
+// [Category] New Feature
+// [Description] Add infrastructure to support runtime registration of
+// setup controls callbacks
+// [Files] Setup.c Setup.h Setup.cif AmiSetupProtocol.c
+// AmiSetupProtocol.h
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiSetupProtocol.c
+//
+// Description: AMI Setup protocol implementation
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#include <AmiDxeLib.h>
+#include <Setup.h>
+#include <Protocol/AmiSetupProtocol.h>
+
+typedef struct {
+ DLINK Link;
+ SETUP_ITEM_CALLBACK Data;
+} AMI_SETUP_CALLBACK_LINK;
+
+static DLIST AmiCallbackList;
+extern CALLBACK_PARAMETERS *CallbackParametersPtr;
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: AmiSetupRegisterCallback
+//
+// Description:
+// This function registers setup control callback
+//
+// Input:
+// IN UINT16 Class - setup control formset class
+// IN UINT16 SubClass - setup control formset subclass
+// IN UINT16 Key - setup control key
+// IN SETUP_ITEM_CALLBACK_HANDLER *Handler - pointer to callback function
+// OUT EFI_HANDLE *Handle - pointer to store handle of registered callback
+//
+// Output:
+// EFI_SUCCESS - operation succeeded
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+EFI_STATUS AmiSetupRegisterCallback(
+ IN UINT16 Class,
+ IN UINT16 SubClass,
+ IN UINT16 Key,
+ IN SETUP_ITEM_CALLBACK_HANDLER *Handler,
+ OUT EFI_HANDLE *Handle
+)
+{
+ EFI_STATUS Status;
+ AMI_SETUP_CALLBACK_LINK *NewLink;
+
+ Status = pBS->AllocatePool(EfiBootServicesData, sizeof(AMI_SETUP_CALLBACK_LINK), &NewLink);
+ if(EFI_ERROR(Status))
+ return Status;
+
+ NewLink->Data.Class = Class;
+ NewLink->Data.SubClass = SubClass;
+ NewLink->Data.Key = Key;
+ NewLink->Data.UpdateItem = Handler;
+
+ DListAdd(&AmiCallbackList, (DLINK *)NewLink);
+ *Handle = NewLink;
+ return EFI_SUCCESS;
+}
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: AmiSetupUnRegisterCallback
+//
+// Description:
+// This function unregisters previously registered callback
+//
+// Input:
+// IN EFI_HANDLE Handle - handle of callback to unregister
+//
+// Output:
+// EFI_SUCCESS - operation succeeded
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+EFI_STATUS AmiSetupUnRegisterCallback(
+ IN EFI_HANDLE Handle
+)
+{
+ DListDelete(&AmiCallbackList, (DLINK *)Handle);
+ pBS->FreePool(Handle);
+ return EFI_SUCCESS;
+}
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: AmiSetupGetCallbacks
+//
+// Description:
+// This function returns all registered callbacks
+//
+// Input:
+// IN OUT UINTN *BufferSize - size of buffer where to store output
+// OUT SETUP_ITEM_CALLBACK *Buffer - buffer to store output
+//
+// Output:
+// EFI_SUCCESS - operation succeeded
+// EFI_ERROR - operation failed
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+EFI_STATUS AmiSetupGetCallbacks(
+ IN OUT UINTN *BufferSize,
+ OUT SETUP_ITEM_CALLBACK *Buffer
+)
+{
+ UINTN ActualSize;
+ AMI_SETUP_CALLBACK_LINK *Link;
+
+ if(AmiCallbackList.Size == 0)
+ return EFI_NOT_FOUND;
+
+ ActualSize = sizeof(SETUP_ITEM_CALLBACK) * AmiCallbackList.Size;
+ if(*BufferSize < ActualSize) {
+ *BufferSize = ActualSize;
+ return EFI_BUFFER_TOO_SMALL;
+ }
+
+ if(Buffer == NULL)
+ return EFI_INVALID_PARAMETER;
+
+ Link = (AMI_SETUP_CALLBACK_LINK *)AmiCallbackList.pHead;
+ while(Link != NULL) {
+ Buffer->Class = Link->Data.Class;
+ Buffer->SubClass = Link->Data.SubClass;
+ Buffer->Key = Link->Data.Key;
+ Buffer->UpdateItem = Link->Data.UpdateItem;
+ Buffer++;
+ Link = (AMI_SETUP_CALLBACK_LINK *)Link->Link.pNext;
+ }
+
+ *BufferSize = ActualSize;
+ return EFI_SUCCESS;
+}
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: AmiSetupGetCallbackParameters
+//
+// Description:
+// This function returns callback parameters from FormBrowser
+//
+// Input:
+// OUT CALLBACK_PARAMETERS **Parameters - pointer to store parameters
+//
+// Output:
+// EFI_SUCCESS - protocol installed
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+EFI_STATUS AmiSetupGetCallbackParameters(
+ OUT CALLBACK_PARAMETERS **Parameters
+)
+{
+ *Parameters = CallbackParametersPtr;
+ return EFI_SUCCESS;
+}
+
+static AMI_SETUP_PROTOCOL AmiSetupProtocol = {
+ AmiSetupRegisterCallback,
+ AmiSetupUnRegisterCallback,
+ AmiSetupGetCallbacks,
+ AmiSetupGetCallbackParameters
+};
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: InitAmiSetupProtocol
+//
+// Description:
+// This function installs AMI Setup protocol
+//
+// Input:
+// None
+//
+// Output:
+// EFI_SUCCESS - protocol installed
+// EFI_ERROR - error occured during installation
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+EFI_STATUS InitAmiSetupProtocol(
+ VOID
+)
+{
+ EFI_STATUS Status;
+ EFI_HANDLE Handle = NULL;
+
+ DListInit(&AmiCallbackList);
+ Status = pBS->InstallMultipleProtocolInterfaces(
+ &Handle,
+ &AmiSetupProtocolGuid,
+ &AmiSetupProtocol,
+ NULL);
+ return Status;
+}
+
+
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/Setup/Boot.vfr b/Board/EM/Setup/Boot.vfr
new file mode 100644
index 0000000..8010c28
--- /dev/null
+++ b/Board/EM/Setup/Boot.vfr
@@ -0,0 +1,255 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Boot.vfr 24 2/27/12 6:35p Artems $
+//
+// $Revision: 24 $
+//
+// $Date: 2/27/12 6:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Boot.vfr $
+//
+// 24 2/27/12 6:35p Artems
+// EIP 83602: Added MANUFACTURING flag to setup controls
+//
+// 23 6/13/11 6:56p Artems
+// Added token to support zero boot timeout
+//
+// 22 3/24/11 12:16p Felixp
+// Enhancement(EIP: 55918)
+// Workaround for defaults processing in TSE
+// There is a peculiar problem with the AMITSESETUP.AMISilentBoot
+// checkbox.
+// The defaults for this control were not loaded in UEFI 2.1 mode.
+// The problem is caused by combination of factors:
+// - AMISilentBoot is a special variable (it holds internal TSE data);
+// - there are several ways to specify default value for a checkbox in
+// UEFI 2.1 VFR syntax
+// (old method of using flags does not work for this special variable).
+//
+// 21 11/18/10 5:46p Felixp
+// Flat Boot List support.
+// Changes necessary to support Flat Boot List
+// introduced in Core 4.6.4.1 are added.
+//
+// 20 2/24/10 11:53a Felixp
+// Fast Boot Control are removed. They are now part of the FastBoot
+// eModule.
+//
+// 19 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 18 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 17 6/06/08 11:55a Felixp
+// Fast boot support is enabled
+//
+// 16 1/31/08 11:51a Olegi
+// NumLock state added.
+//
+// 15 10/30/07 10:42a Felixp
+// SYSTEM_ACCESS varstore declaration added
+//
+// 14 9/05/07 5:26p Felixp
+// Changes needed for TSE from Core 4.6.2
+//
+// 13 2/21/07 5:01p Felixp
+// ADD_BOOT_OPTION varstore updated
+//
+// 12 12/29/06 2:38p Felixp
+//
+// 11 10/08/06 11:34a Felixp
+// Minimum boot timeout changed from 0 to 1 second.
+//
+// 10 12/12/05 8:59p Felixp
+// step for Timeout numeric added.
+//
+// 9 11/08/05 5:11a Felixp
+// Update to be complient with TSE 1.15.1044
+//
+// 8 11/07/05 10:54a Felixp
+// Support for boot with minimum configuration added
+//
+// 7 10/19/05 2:07p Felixp
+// Support for custom varstores (in .sd files) added.
+//
+// 6 9/06/05 6:20p Girim
+// Code cleanup.
+//
+// 4 7/12/05 11:13a Felixp
+// workaround for VFR compiler bug in varstore handling
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//**********************************************************************
+//
+// Name: Boot.vfr
+//
+// Description:
+// Setup script for the "Boot" top level setup screen
+//
+//**********************************************************************
+//<AMI_FHDR_END>
+
+#include "SetupPrivate.h"
+#define BOOT_FORM_SET
+#define FORM_SET_TYPEDEF
+#include <SetupDefinitions.h>
+#undef FORM_SET_TYPEDEF
+
+formset guid = BOOT_FORM_SET_GUID,
+ title = STRING_TOKEN(STR_BOOT),
+ help = STRING_TOKEN(STR_BOOT_HELP),
+ class = BOOT_FORM_SET_CLASS,
+ subclass = 0,
+
+ SETUP_DATA_VARSTORE
+ SYSTEM_ACCESS_VARSTORE
+ BOOT_MANAGER_VARSTORE
+ TIMEOUT_VARSTORE
+ BOOT_ORDER_VARSTORE
+ NEW_BOOT_OPTION_VARSTORE
+ DEL_BOOT_OPTION_VARSTORE
+ LEGACY_DEV_INFO_VARSTORE
+ LEGACY_GROUP_INFO_VARSTORE
+ LEGACY_DEV_ORDER_VARSTORE
+ AMI_CALLBACK_VARSTORE
+ AMITSESETUP_VARSTORE
+
+ #define FORM_SET_VARSTORE
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_VARSTORE
+
+ form
+ formid = AUTO_ID(BOOT_MAIN),
+ title = STRING_TOKEN(STR_BOOT);
+
+ SUBTITLE(STRING_TOKEN(STR_BOOT_CFG))
+
+ numeric varid = TIMEOUT.Value,
+ prompt = STRING_TOKEN(STR_BOOT_TIMEOUT),
+ help = STRING_TOKEN(STR_BOOT_TIMEOUT_HELP),
+#if SUPPORT_ZERO_BOOT_TIMEOUT
+ minimum = 0x0,
+#else
+ minimum = 0x1,
+#endif
+ maximum = 0xffff,
+ step = 1,
+ option text = STRING_TOKEN(STR_EMPTY), value = DEFAULT_BOOT_TIMEOUT, flags = DEFAULT | MANUFACTURING;
+ endnumeric;
+
+ oneof varid = SETUP_DATA.Numlock,
+ prompt = STRING_TOKEN(STR_CSM_BOOTUP_NUMLOCK),
+ help = STRING_TOKEN(STR_CSM_BOOTUP_NUMLOCK_HELP),
+ option text = STRING_TOKEN(STR_CSM_BOOTUP_NUMLOCK_ON), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;
+ option text = STRING_TOKEN(STR_CSM_BOOTUP_NUMLOCK_OFF), value = 0, flags = 0, key = 0;
+ endoneof;
+
+ SEPARATOR
+ checkbox varid = AMITSESETUP.AMISilentBoot,
+ prompt = STRING_TOKEN(STR_QUIET_BOOT),
+ help = STRING_TOKEN(STR_QUIET_BOOT_HELP),
+ flags = DEFAULT_QUIET_BOOT, // Flags behavior for checkbox is overloaded so that it equals a DEFAULT value. 1 = ON, 0 = off
+#if EFI_SPECIFICATION_VERSION>0x20000
+//Workaround for defaults processing in TSE.
+//There is a peculiar problem with this checkbox.
+//The defaults for this control were not loaded in UEFI 2.1 mode.
+//The problem is caused by combination of factors:
+// - AMISilentBoot is a special variable (it holds internal TSE data);
+// - there are several ways to specify default value for a checkbox in UEFI 2.1 VFR syntax
+// (old method of using flags does not work for this special variable).
+ option text = STRING_TOKEN(STR_EMPTY), value = DEFAULT_QUIET_BOOT, flags = DEFAULT | MANUFACTURING;
+#endif
+ endcheckbox;
+
+ #define FORM_SET_ITEM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_ITEM
+
+ SEPARATOR
+ SUBTITLE(STRING_TOKEN(STR_BOOT_ORDER_SUBTITLE))
+ suppressif ideqvallist BOOT_MANAGER.BootCount == 0xFFFF;
+ oneof varid = BOOT_ORDER.Value,
+ prompt = STRING_TOKEN(STR_BOOT_ORDER_X),
+ help = STRING_TOKEN(STR_BOOT_ORDER_HELP),
+ option
+ text = STRING_TOKEN(STR_EMPTY),
+ value = 0,
+ flags = DEFAULT;
+ option
+ text = STRING_TOKEN(STR_EMPTY),
+ value = 1,
+ flags = 0;
+ endoneof;
+ endif;
+
+#if !defined(GROUP_BOOT_OPTIONS_BY_TAG) || GROUP_BOOT_OPTIONS_BY_TAG==1
+ SEPARATOR
+ suppressif ideqvallist LEGACY_DEV_INFO.GroupCount == 0xFFFF;
+ goto BBS_ORDER_FORM,
+ prompt = STRING_TOKEN(STR_EMPTY),
+ help = STRING_TOKEN(STR_BBS_ORDER_HELP);
+ endif;
+#endif
+ #define FORM_SET_GOTO
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_GOTO
+ endform;
+#if !defined(GROUP_BOOT_OPTIONS_BY_TAG) || GROUP_BOOT_OPTIONS_BY_TAG==1
+ form
+ formid = AUTO_ID(BBS_ORDER_FORM),
+ title = STRING_TOKEN(STR_BOOT);
+
+ suppressif ideqvallist LEGACY_GROUP_INFO.DeviceCount == 0xFFFF;
+ oneof
+ varid = LEGACY_DEV_ORDER.Value,
+ prompt = STRING_TOKEN(STR_BOOT_ORDER_X),
+ help = STRING_TOKEN(STR_BOOT_ORDER_HELP),
+ option
+ text = STRING_TOKEN(STR_EMPTY),
+ value = 0,
+ flags = DEFAULT;
+ option
+ text = STRING_TOKEN(STR_EMPTY),
+ value = 1,
+ flags = 0;
+ endoneof;
+ endif;
+ endform;
+#endif
+ #define FORM_SET_FORM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_FORM
+endformset;
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Board/EM/Setup/Chipset.vfr b/Board/EM/Setup/Chipset.vfr
new file mode 100644
index 0000000..b1d45ff
--- /dev/null
+++ b/Board/EM/Setup/Chipset.vfr
@@ -0,0 +1,107 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Chipset.vfr 10 6/11/10 12:22p Felixp $
+//
+// $Revision: 10 $
+//
+// $Date: 6/11/10 12:22p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Chipset.vfr $
+//
+// 10 6/11/10 12:22p Felixp
+// AMI_CALLBACK_VARSTORE added
+//
+// 9 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 8 6/30/09 2:33p Robert
+// comment corrections
+//
+// 7 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 6 10/19/05 2:07p Felixp
+// Support for custom varstores (in .sd files) added.
+//
+// 5 9/06/05 6:19p Girim
+// Code cleanup.
+//
+// 3 7/12/05 11:13a Felixp
+// workaround for VFR compiler bug in varstore handling
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+
+//**********************************************************************
+//
+// Name: Chipset.vfr
+//
+// Description:
+// Setup script for the "Chipset" top level setup screen
+//
+//**********************************************************************
+//<AMI_FHDR_END>
+#include "SetupPrivate.h"
+#define CHIPSET_FORM_SET
+#define FORM_SET_TYPEDEF
+#include <SetupDefinitions.h>
+#undef FORM_SET_TYPEDEF
+
+formset guid = CHIPSET_FORM_SET_GUID,
+ title = STRING_TOKEN(STR_CHIPSET),
+ help = STRING_TOKEN(STR_CHIPSET_HELP),
+ class = CHIPSET_FORM_SET_CLASS,
+ subclass = 0,
+
+ SETUP_DATA_VARSTORE
+ SYSTEM_ACCESS_VARSTORE
+ AMI_CALLBACK_VARSTORE
+
+ #define FORM_SET_VARSTORE
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_VARSTORE
+
+ form formid = AUTO_ID(CHIPSET_MAIN),
+ title = STRING_TOKEN(STR_CHIPSET);
+
+ #define FORM_SET_ITEM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_ITEM
+ #define FORM_SET_GOTO
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_GOTO
+ endform;
+ #define FORM_SET_FORM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_FORM
+endformset;
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Board/EM/Setup/Exit.vfr b/Board/EM/Setup/Exit.vfr
new file mode 100644
index 0000000..ce6d7a8
--- /dev/null
+++ b/Board/EM/Setup/Exit.vfr
@@ -0,0 +1,212 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Exit.vfr 16 10/09/09 6:43p Felixp $
+//
+// $Revision: 16 $
+//
+// $Date: 10/09/09 6:43p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Exit.vfr $
+//
+// 16 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 15 6/30/09 2:33p Robert
+// comment corrections
+//
+// 14 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 13 2/05/09 3:54p Felixp
+// Enhancement(EIP 13637): TSE Binary 4.6.2_TSE_1_27_1118_BETA or newer
+// required.
+// Page layout is updated to support for SETUP_SHOW_ALL_BBS_DEVICES
+// TSE SDL token.
+// SETUP_SHOW_ALL_BBS_DEVICES SDL token controls legacy (BBS) devices
+// listed
+// in the "Boot Override" section of the "Exit" page.
+// When this token is enabled, all BBS devices will be listed.
+// When this token is disabled, only first device from every BBS group
+// will be listed.
+// The token is disabled by default.
+//
+// 10 2/28/07 7:34p Felixp
+// STR_EFI_SHELL_HELP token updated to specify Shell file names for
+// different build modes
+//
+// 8 1/12/06 9:50a Felixp
+// Support for start up of the shell from the filesystem
+//
+// 7 10/19/05 2:07p Felixp
+// Support for custom varstores (in .sd files) added.
+//
+// 6 10/05/05 7:10p Felixp
+// support for system reset
+//
+// 5 9/01/05 11:41a Girim
+// Added Help strings in the Exit Menu.
+//
+// 3 7/12/05 11:13a Felixp
+// workaround for VFR compiler bug in varstore handling
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//**********************************************************************
+//
+// Name: Exit.vfr
+//
+// Description:
+// Setup script for the "Exit" top level setup screen
+//
+//**********************************************************************
+//<AMI_FHDR_END>
+
+#include "SetupPrivate.h"
+#define EXIT_FORM_SET
+#define FORM_SET_TYPEDEF
+#include <SetupDefinitions.h>
+#undef FORM_SET_TYPEDEF
+
+formset guid = EXIT_FORM_SET_GUID,
+ title = STRING_TOKEN(STR_EXIT),
+ help = STRING_TOKEN(STR_EXIT_HELP),
+ class = EXIT_FORM_SET_CLASS, subclass = 0,
+
+ SETUP_DATA_VARSTORE
+ AMI_CALLBACK_VARSTORE
+ BOOT_MANAGER_VARSTORE
+ BOOT_NOW_COUNT_VARSTORE
+ EFI_SHELL_VARSTORE
+
+ #define FORM_SET_VARSTORE
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_VARSTORE
+
+ form formid = AUTO_ID(EXIT_MAIN),
+ title = STRING_TOKEN(STR_EXIT);
+
+ suppressif ideqval AMI_CALLBACK.Value == SAVE_AND_EXIT_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_SAVE_EXIT),
+ help = STRING_TOKEN(STR_SAVE_EXIT_HELP);
+ endif;
+
+ suppressif ideqval AMI_CALLBACK.Value == DISCARD_AND_EXIT_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_DISCARD_EXIT),
+ help = STRING_TOKEN(STR_DISCARD_EXIT_HELP);
+ endif;
+
+ suppressif ideqval AMI_CALLBACK.Value == SAVE_AND_RESET_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_SAVE_RESET),
+ help = STRING_TOKEN(STR_SAVE_RESET_HELP);
+ endif;
+
+ suppressif ideqval AMI_CALLBACK.Value == DISCARD_AND_RESET_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_DISCARD_RESET),
+ help = STRING_TOKEN(STR_DISCARD_RESET_HELP);
+ endif;
+
+ SEPARATOR
+ SUBTITLE(STRING_TOKEN(STR_SAVE_TITLE))
+ suppressif ideqval AMI_CALLBACK.Value == SAVE_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_SAVE),
+ help = STRING_TOKEN(STR_SAVE_HELP);
+ endif;
+
+ suppressif ideqval AMI_CALLBACK.Value == DISCARD_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_DISCARD),
+ help = STRING_TOKEN(STR_DISCARD_HELP);
+ endif;
+
+ SEPARATOR
+ suppressif ideqval AMI_CALLBACK.Value == RESTORE_DEFAULTS_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_RESTORE_DEFAULTS),
+ help = STRING_TOKEN(STR_RESTORE_DEFAULTS_HELP);
+ endif;
+
+ suppressif ideqval AMI_CALLBACK.Value == SAVE_USER_DEFAULTS_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_SAVE_USER_DEFAULTS),
+ help = STRING_TOKEN(STR_SAVE_USER_DEFAULTS_HELP);
+ endif;
+
+ suppressif ideqval AMI_CALLBACK.Value == RESTORE_USER_DEFAULTS_VALUE;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_RESTORE_USER_DEFAULTS),
+ help = STRING_TOKEN(STR_RESTORE_USER_DEFAULTS_HELP);
+ endif;
+
+ SEPARATOR
+ SUBTITLE(STRING_TOKEN(STR_BOOT_OPTIONS))
+#if SETUP_SHOW_ALL_BBS_DEVICES
+ suppressif ideqvallist BOOT_NOW_COUNT.BootCount == 0xFFFF;
+#else
+ suppressif ideqvallist BOOT_MANAGER.BootCount == 0xFFFF;
+#endif.
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_EMPTY),
+ help = STRING_TOKEN(STR_EMPTY);
+ endif;
+
+#if !Shell_SUPPORT
+ SEPARATOR
+ suppressif ideqvallist EFI_SHELL.Value == 1;
+ goto EXIT_MAIN,
+ prompt = STRING_TOKEN(STR_EFI_SHELL),
+#if EFI64
+ help = STRING_TOKEN(STR_EFI_SHELL_HELP_IPF);
+#elif EFIx64
+ help = STRING_TOKEN(STR_EFI_SHELL_HELP_X64);
+#else
+ help = STRING_TOKEN(STR_EFI_SHELL_HELP);
+#endif
+ endif;
+#endif
+
+ #define FORM_SET_ITEM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_ITEM
+ #define FORM_SET_GOTO
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_GOTO
+ endform;
+
+ #define FORM_SET_FORM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_FORM
+endformset;
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/Setup/Logo.bmp b/Board/EM/Setup/Logo.bmp
new file mode 100644
index 0000000..eb195ef
--- /dev/null
+++ b/Board/EM/Setup/Logo.bmp
Binary files differ
diff --git a/Board/EM/Setup/Main.vfr b/Board/EM/Setup/Main.vfr
new file mode 100644
index 0000000..14985b5
--- /dev/null
+++ b/Board/EM/Setup/Main.vfr
@@ -0,0 +1,239 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Main.vfr 20 2/15/11 4:33p Artems $
+//
+// $Revision: 20 $
+//
+// $Date: 2/15/11 4:33p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Main.vfr $
+//
+// 20 2/15/11 4:33p Artems
+// Replaced TABs with spaces
+//
+// 19 9/07/10 11:05p Felixp
+// Minor fix: Spelling error (EIP 39919)
+//
+// 18 6/11/10 12:22p Felixp
+// AMI_CALLBACK_VARSTORE added
+//
+// 17 6/09/10 10:54p Felixp
+// Setup Customization Support. Hidden form with list of all controls is
+// added.
+// The form is used to generate defaults.
+//
+// 16 2/24/10 11:52a Felixp
+// UEFI Specification Compliancy Level information is added.
+//
+// 15 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 14 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 13 9/26/06 8:57a Felixp
+// Language selection control is enabled
+//
+// 12 8/18/06 11:20a Felixp
+//
+// 11 11/21/05 7:32p Felixp
+// multi-language support removed
+//
+// 10 10/19/05 2:07p Felixp
+// Support for custom varstores (in .sd files) added.
+//
+// 9 10/03/05 6:33p Felixp
+// Access Mode is displayed
+//
+// 8 9/06/05 6:19p Girim
+// Code cleanup.
+//
+// 7 7/19/05 10:06p Girim
+// Moved the Memory to NBSetup.c
+//
+// 5 7/12/05 11:13a Felixp
+// workaround for VFR compiler bug in varstore handling
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//**********************************************************************
+//
+// Name: Main.vfr
+//
+// Description:
+// Setup script for the "Main" top level setup screen
+//
+//**********************************************************************
+//<AMI_FHDR_END>
+
+#include "SetupPrivate.h"
+#define MAIN_FORM_SET
+#define FORM_SET_TYPEDEF
+#include <SetupDefinitions.h>
+#undef FORM_SET_TYPEDEF
+
+formset guid = MAIN_FORM_SET_GUID,
+ title = STRING_TOKEN(STR_MAIN),
+ help = STRING_TOKEN(STR_MAIN_HELP),
+ class = MAIN_FORM_SET_CLASS,
+ subclass = 0,
+
+ SETUP_DATA_VARSTORE
+ LANGUAGE_VARSTORE
+ LANGUAGE_CODES_VARSTORE
+ SYSTEM_ACCESS_VARSTORE
+ AMI_CALLBACK_VARSTORE
+
+ #define FORM_SET_VARSTORE
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_VARSTORE
+
+ form formid = AUTO_ID(MAIN_MAIN), // MAIN
+ title = STRING_TOKEN(STR_MAIN);
+
+ SUBTITLE(STRING_TOKEN(STR_BIOS))
+ INVENTORY(STRING_TOKEN(STR_BIOS_VENDOR_NAME),STRING_TOKEN(STR_BIOS_VENDOR_VALUE))
+ INVENTORY(STRING_TOKEN(STR_BIOS_CORE_VERSION_NAME),STRING_TOKEN(STR_BIOS_CORE_VERSION_VALUE))
+ INVENTORY(STRING_TOKEN(STR_BIOS_COMPLIANCY_NAME),STRING_TOKEN(STR_BIOS_COMPLIANCY_VALUE))
+ INVENTORY(STRING_TOKEN(STR_BIOS_VERSION_NAME),STRING_TOKEN(STR_BIOS_VERSION_VALUE))
+ INVENTORY(STRING_TOKEN(STR_BIOS_DATE_NAME),STRING_TOKEN(STR_BIOS_DATE_VALUE))
+
+
+ #define FORM_SET_ITEM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_ITEM
+ #define FORM_SET_GOTO
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_GOTO
+
+ SEPARATOR
+ suppressif ideqval LANGUAGE_CODES.Value == 0xFFFF;
+ oneof varid = LANGUAGE.Value,
+ prompt = STRING_TOKEN(STR_LANGUAGE_PROMPT),
+ help = STRING_TOKEN(STR_LANGUAGE_HELP),
+ option
+ text = STRING_TOKEN(STR_EMPTY),
+ value = 0,
+ flags = DEFAULT;
+ option
+ text = STRING_TOKEN(STR_EMPTY),
+ value = 1,
+ flags = 0;
+ endoneof;
+ endif;
+
+ SEPARATOR
+ date
+ year varid = Date.Year,
+ prompt = STRING_TOKEN(STR_DATE),
+ help = STRING_TOKEN(STR_DATE_HELP),
+ minimum = 2005,
+ maximum = 2099,
+ step = 1,
+ default = 2005,
+ month varid = Date.Month,
+ prompt = STRING_TOKEN(STR_DATE),
+ help = STRING_TOKEN(STR_DATE_HELP),
+ minimum = 1,
+ maximum = 12,
+ step = 1,
+ default = 1,
+ day varid = Date.Day,
+ prompt = STRING_TOKEN(STR_DATE),
+ help = STRING_TOKEN(STR_DATE_HELP),
+ minimum = 1,
+ maximum = 31,
+ step = 1,
+ default = 1,
+ enddate;
+
+ time
+ hour varid = Time.Hours,
+ prompt = STRING_TOKEN(STR_TIME),
+ help = STRING_TOKEN(STR_TIME_HELP),
+ minimum = 0,
+ maximum = 23,
+ step = 1, default = 0,
+ minute varid = Time.Minutes,
+ prompt = STRING_TOKEN(STR_TIME),
+ help = STRING_TOKEN(STR_TIME_HELP),
+ minimum = 0,
+ maximum = 59,
+ step = 1,
+ default = 0,
+ second varid = Time.Seconds,
+ prompt = STRING_TOKEN(STR_TIME),
+ help = STRING_TOKEN(STR_TIME_HELP),
+ minimum = 0,
+ maximum = 59,
+ step = 1,
+ default = 0,
+ endtime;
+
+ SEPARATOR
+ suppressif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_ADMIN;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_ACCESS_LEVEL),
+ text = STRING_TOKEN(STR_ACCESS_USER),
+ flags = 0,
+ key = 0;
+ endif;
+ suppressif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_ACCESS_LEVEL),
+ text = STRING_TOKEN(STR_ACCESS_ADMIN),
+ flags = 0,
+ key = 0;
+ endif;
+
+ // "suppress if TRUE" is not supported by the Framework VFR Compiler
+ suppressif NOT ideqval SYSTEM_ACCESS.Access == 0x55;
+ goto MAIN_HIDDEN,
+ prompt = STRING_TOKEN(STR_EMPTY),
+ help = STRING_TOKEN(STR_EMPTY);
+ endif;
+ endform;
+ #define FORM_SET_FORM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_FORM
+
+ form formid = AUTO_ID(MAIN_HIDDEN), // MAIN
+ title = STRING_TOKEN(STR_EMPTY);
+ #define CONTROLS_WITH_DEFAULTS
+ #include <SetupDefinitions.h>
+ #undef CONTROLS_WITH_DEFAULTS
+ endform;
+endformset;
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Board/EM/Setup/Security.vfr b/Board/EM/Setup/Security.vfr
new file mode 100644
index 0000000..cd943d0
--- /dev/null
+++ b/Board/EM/Setup/Security.vfr
@@ -0,0 +1,168 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Security.vfr 19 3/08/11 12:09p Felixp $
+//
+// $Revision: 19 $
+//
+// $Date: 3/08/11 12:09p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Security.vfr $
+//
+// 19 3/08/11 12:09p Felixp
+// Bug fix (EIP 55443): Password length restriction message is updated
+// to work properly during language switch.
+//
+// 18 6/11/10 12:23p Felixp
+// AMI_CALLBACK_VARSTORE added
+//
+// 17 2/24/10 11:52a Felixp
+// Information about expected password length is added.
+//
+// 16 12/08/09 12:19p Oleksiyy
+// EIP 31784: PASSWORD_MIN_SIZE token added to Setup.sdl and Security.vfr.
+//
+// 15 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 14 6/30/09 2:33p Robert
+// comment corrections
+//
+// 13 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 12 9/05/07 5:26p Felixp
+// IDE Security changed removed (will be added with the future Core/Board
+// labels).
+//
+// 8 12/22/05 7:12p Robert
+// Added new strings for the security page so that it has a better
+// description of what setting the passwords will do
+//
+// 7 11/08/05 5:11a Felixp
+// Update to be complient with TSE 1.15.1044
+//
+// 6 10/19/05 2:07p Felixp
+// Support for custom varstores (in .sd files) added.
+//
+// 5 9/06/05 6:20p Girim
+// Added support for distinguishing the Admin and User Passwords and Code
+// cleanup.
+//
+// 3 7/12/05 11:13a Felixp
+// workaround for VFR compiler bug in varstore handling
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//**********************************************************************
+// Name: Security.vfr
+//
+// Description:
+// Setup script for the "Security" top level setup screen
+//**********************************************************************
+//<AMI_FHDR_END>
+
+#include "SetupPrivate.h"
+#define SECURITY_FORM_SET
+#define FORM_SET_TYPEDEF
+#include <SetupDefinitions.h>
+#undef FORM_SET_TYPEDEF
+
+formset guid = SECURITY_FORM_SET_GUID,
+ title = STRING_TOKEN(STR_SECURITY),
+ help = STRING_TOKEN(STR_SECURITY_HELP),
+ class = SECURITY_FORM_SET_CLASS,
+ subclass = 0,
+
+ SETUP_DATA_VARSTORE
+ SYSTEM_ACCESS_VARSTORE
+ AMITSESETUP_VARSTORE
+ AMI_CALLBACK_VARSTORE
+
+ #define FORM_SET_VARSTORE
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_VARSTORE
+
+ form formid = AUTO_ID(SECURITY_MAIN),
+ title = STRING_TOKEN(STR_SECURITY);
+
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_ONE))
+
+ SEPARATOR
+
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_TWO))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_THREE))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_FOUR))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_FIVE))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_SIX))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_SEVEN))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_EIGHT))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_NINE))
+ SUBTITLE(STRING_TOKEN(STR_SECURITY_BANNER_TEN))
+ INVENTORY(STRING_TOKEN(STR_MIN_PASSWORD_LENGTH_NAME),STRING_TOKEN(STR_MIN_PASSWORD_LENGTH__VALUE))
+ INVENTORY(STRING_TOKEN(STR_MAX_PASSWORD_LENGTH_NAME),STRING_TOKEN(STR_MAX_PASSWORD_LENGTH__VALUE))
+
+ SEPARATOR
+ SEPARATOR
+
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ password varid = AMITSESETUP.AdminPassword,
+ prompt = STRING_TOKEN(STR_ADMIN_PASSWORD),
+ help = STRING_TOKEN(STR_ADMIN_PASSWORD_HELP),
+ flags = 0,
+ minsize = PASSWORD_MIN_SIZE,
+ maxsize = PASSWORD_MAX_SIZE,
+ encoding = 1,
+ endpassword;
+ endif; // grayout
+
+ password varid = AMITSESETUP.UserPassword,
+ prompt = STRING_TOKEN(STR_USER_PASSWORD),
+ help = STRING_TOKEN(STR_USER_PASSWORD_HELP),
+ flags = 0,
+ minsize = PASSWORD_MIN_SIZE,
+ maxsize = PASSWORD_MAX_SIZE,
+ encoding = 1,
+ endpassword;
+
+ #define FORM_SET_ITEM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_ITEM
+ #define FORM_SET_GOTO
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_GOTO
+ endform;
+ #define FORM_SET_FORM
+ #include <SetupDefinitions.h>
+ #undef FORM_SET_FORM
+endformset;
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Board/EM/Setup/Setup.c b/Board/EM/Setup/Setup.c
new file mode 100644
index 0000000..5900319
--- /dev/null
+++ b/Board/EM/Setup/Setup.c
@@ -0,0 +1,1541 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Setup.c 67 10/04/12 4:50p Artems $
+//
+// $Revision: 67 $
+//
+// $Date: 10/04/12 4:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Setup.c $
+//
+// 67 10/04/12 4:50p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Added missing function headers for CHM builder
+// [Files] Setup.c
+//
+// 66 8/29/12 2:42p Artems
+// [TAG] EIP N/A
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] setup control interactive callback doesn't work
+// [RootCause] When there are no runtime-registered callbacks,
+// build-time callbacks don't present in callback list
+// [Solution] Fixed code logic to handle situation with no runtime
+// callbacks
+// [Files] AmiSetupProtocol.c Setup.c
+//
+// 65 8/28/12 4:10p Artems
+// [TAG] EIP N/A
+// [Category] New Feature
+// [Description] Add infrastructure to support runtime registration of
+// setup controls callbacks
+// [Files] Setup.c Setup.h Setup.cif AmiSetupProtocol.c
+// AmiSetupProtocol.h
+//
+// 64 4/12/12 4:41p Artems
+// [TAG] EIP81090
+// [Category] Improvement
+// [Description] Show specification version in 2 or 3 digits format
+// depending on value (i.e. 2.1 or 2.3.1)
+// [Files] Setup.c
+//
+// 63 7/01/11 3:15p Artems
+// Added project build number to project version string
+//
+// 62 6/21/11 9:24a Felixp
+// EIP58960: Callback function is updateed to return status of the eLink
+// based callback routine back to the browser.
+//
+// 61 3/21/11 4:15p Felixp
+// Enhancement: Callback function is updated to set ActionRequest to NONE.
+//
+// 60 3/08/11 12:09p Felixp
+// Bug fix (EIP 55443): Password length restriction message is updated
+// to work properly during language switch.
+//
+// 59 2/08/11 3:32p Artems
+// Reduced function header comment line to fit CHM file
+//
+// 58 2/07/11 5:25p Artems
+// EIP 53374: Replaced tabs with spaces
+//
+// 57 2/04/11 7:59p Artems
+// Added PI 1.1 support
+//
+// 1 2/02/11 5:16p Artems
+//
+// 56 9/07/10 11:05p Felixp
+// Minor fix: Spelling error (EIP 39919)
+//
+// 55 2/24/10 11:50a Felixp
+// Use CORE_COMBINED_VERSION token.
+// Initialize UEFI Specification compliancy string
+// Initialize min/max password length string
+//
+// 54 2/05/10 2:11p Felixp
+//
+// 53 2/05/10 2:10p Felixp
+// Improvements in the Setup Callback Mechanism.
+// - The definition of the type of the Setup Callback Handling
+// function,
+// registered using ITEM_CALLBACK eLink, is moved from Setup.c to
+// Setup.h(Core file).
+// The type is renamed from UPDATE_ITEM to
+// SETUP_ITEM_CALLBACK_HANDLER.
+// - The return type of the Setup Callback Handling function is changed
+// from VOID to EFI_STATUS.
+// The status only matters for UEFI 2.1 Configurations. If UEFI 2.1
+// callback handler returns
+// any status other than EFI_UNSUPPORTED, processing of the
+// callback handler list,
+// defined by the SetupItemCallbacks eLink, is terminated and
+// control is returned back to the HII browser.
+// - New GetCallbackParameters function is added. The function provides
+// access to all callback
+// parameters received from the HII browser.
+//
+// 52 11/25/09 11:40a Felixp
+//
+// 51 11/25/09 11:36a Felixp
+// Action parameter of the Callback function is updated based on UEFI
+// errata
+//
+// 50 11/23/09 5:03p Felixp
+// SetupCallBack structure is updated to use formset GUID from Setup.h.
+// DEFAULT_LANGUAGE is replaced with DEFAULT_LANGUAGE_CODE, which is
+// passed from make file using /D
+//
+// 49 10/21/09 3:21p Felixp
+// LastLang/LastLangCodes - use different variable for UEFI 2.0 and UEFI
+// 2.1 modes
+//
+// 48 10/21/09 3:15p Felixp
+//
+// 46 10/09/09 6:43p Felixp
+// UEFI 2.1 Support (the component is updated to support Framework and
+// UEFI 2.1 HII).
+//
+// 45 7/01/09 2:34p Felixp
+// SetupEntry updated to use absence of LastLangCodes variable (instead of
+// Lang or Setup) as an indication of the first boot.
+//
+// 44 6/30/09 2:33p Robert
+// comment corrections
+//
+// 43 6/30/09 2:28p Robert
+// Comment updates
+//
+// 42 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 41 5/22/09 6:46p Felixp
+// Minor bug fix in InitStrings function
+//
+// 40 2/23/09 10:18a Oleksiyy
+// Bug fix (EIP 18214) Build process failed if too many SetupItemCallbacks
+// in one command line. Solution is to
+// forward SETUP_ITEM_CALLBACK_LIST definition into SetupCallbackList.h
+// file, generated during the build process (in Setup.mak), and include it
+// into Setup.c.
+//
+// 39 10/10/08 4:44p Felixp
+// UEFI2.0 Language Variable added and code to sync up values of the new
+// and old language varaibles.
+//
+// 38 4/18/08 6:32p Felixp
+// Undo previous status code reporting changed.
+// They are not needed because the same status codes are reported by the
+// TSE included with Core 4.6.3.2
+//
+// 36 2/21/08 5:19p Felixp
+// 1. CMOS handling code removed because it's platform specific and does
+// not belong in generic Setup module.
+// 2. Core version string updated to use CORE_BUILD_NUMBER
+//
+// 33 1/24/08 1:21p Felixp
+// ALWAYS_PUBLISH_HII_RESOURCES SDL token added
+//
+// 32 10/30/07 11:24a Felixp
+// SDL tokens to hide advanced, chipset, and security formsets added
+//
+// 31 9/05/07 8:31p Felixp
+// Bug fix in Lang variable initialization.
+//
+// 28 8/31/07 12:43a Felixp
+// SetupEntry updated to support defaults generated during build process.
+//
+// 27 3/19/07 8:50a Felixp
+// Bug fix in SetupEntry
+//
+// 26 3/18/07 12:42p Felixp
+// 1. Code clean up
+// 2. Initialization of LangCodes variable when SetupCallback is not
+// invoked
+//
+// 25 3/06/07 3:12p Vyacheslava
+// Support for initialization of the Lang and LangCodes variables based on
+// available languages in HII.
+//
+// 22 12/05/06 12:25p Felixp
+// Use date/time stamps from TimeStamp.h instead of C __DATE__ macro
+//
+// 20 10/30/06 7:16p Felixp
+// Bug fix in Setup variable initialization (HII 0.92 related changes)
+//
+// 19 10/30/06 5:45p Felixp
+// Updated to be complient with HII Spec. 0.92 (used to be 0.91)
+//
+// 18 10/07/06 11:13a Felixp
+// Add "x64" to the BIOS version in x64 mode
+//
+// 17 5/23/06 4:20a Felixp
+// FW Verion extraction logic changed
+//
+// 12 2/06/06 6:30p Felixp
+// Support for Callbacks added
+//
+// 11 11/08/05 5:13a Felixp
+// 1. Now resources are only loaded if Setup is about to be launched
+// 2. Support for unconditional (w/o user intervention) launch of Setup
+// when NVRAM is blank
+//
+// 8 7/19/05 10:09p Felixp
+// 1. InitString modified to update string for all languages
+// 2. Memory information removed (moved to NB)
+//
+// 6 7/14/05 7:06p Felixp
+// Setup variable initialization with default values added
+//
+// 2 5/31/05 11:21a Felixp
+// CPU frequency display disabled
+//
+// 10 5/24/05 3:07p Felixp
+// Modular setup framework implemented
+//
+// 7 3/25/05 7:12p Felixp
+// SetupInit Protocol installed
+//
+// 5 3/17/05 7:50p Felixp
+// form callback support added
+//
+// 4 3/17/05 2:00p Felixp
+// 1. LoadResources updated to support multiple form sets
+// 2. Setup variable created
+//
+// 2 3/07/05 7:06p Felixp
+// support for embedded resources added
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Setup.c
+//
+// Description:
+// This file contains supporting functions, data types and data that
+// correspond to the Setup driver.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+//=======================================================================
+// Includes
+#include <DXE.h>
+#include <AmiDxeLib.h>
+#include <Protocol/LoadedImage.h>
+#include <Protocol/DevicePath.h>
+#include <Protocol/Cpu.h>
+#include <Protocol/SimpleTextOut.h >
+#include <Protocol/AmiSetupProtocol.h >
+#include <AmiHobs.h>
+#include <TimeStamp.h>
+#if EFI_SPECIFICATION_VERSION>0x20000
+#include <Protocol/HiiString.h>
+#include <Protocol/HiiDatabase.h>
+#else
+#include <Protocol/Hii.h>
+#endif
+#include "SetupPrivate.h"
+#include <SetupCallbackList.h>
+#include <LangList.h>
+
+//=======================================================================
+// MACROs
+#define STR CONVERT_TO_WSTRING
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+#define LastLangCodes L"PlatformLastLangCodes"
+#define LastLang L"PlatformLastLang"
+#define NativeLangCodes L"PlatformLangCodes"
+#define CompatLangCodes L"LangCodes"
+#define NativeLang L"PlatformLang"
+#define CompatLang L"Lang"
+#define LangNativeListToCompatList RfcListToIsoList
+#define LangToCompat RfcToIso
+#define LangToNative IsoToRfc
+#define GetFirstLang GetFirstRfcLang
+#else
+#define LastLangCodes L"LastLangCodes"
+#define LastLang L"LastLang"
+#define NativeLangCodes L"LangCodes"
+#define CompatLangCodes L"PlatformLangCodes"
+#define NativeLang L"Lang"
+#define CompatLang L"PlatformLang"
+#define LangNativeListToCompatList IsoListToRfcList
+#define LangToCompat IsoToRfc
+#define LangToNative RfcToIso
+#define GetFirstLang GetFirstIsoLang
+#endif
+
+//=======================================================================
+// GUIDs
+static EFI_GUID guidSetup = SETUP_GUID;
+static EFI_GUID guidEfiVar = EFI_GLOBAL_VARIABLE;
+
+//=======================================================================
+// Module specific global variables
+EFI_HANDLE ThisImageHandle = NULL;
+#if EFI_SPECIFICATION_VERSION>0x20000
+static EFI_HII_STRING_PROTOCOL *HiiString=NULL;
+static EFI_HII_DATABASE_PROTOCOL *HiiDatabase=NULL;
+#else
+EFI_HII_PROTOCOL *pHii = NULL;
+#endif
+UINT8 Setup[sizeof(SETUP_DATA)];
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: SETUP_CALLBACK
+//
+// Fields: Type Name Description
+// EFI_FORM_CALLBACK_PROTOCOL Callback - Callback Protocol Instance for the
+// Class and SubClass defined below
+// UINT16 Class - Value defined to identify a particular Hii form
+// UINT16 SubClass - Secondary value used to uniquely define the an Hii form
+//
+// Description:
+// These Data Structure define a structure used to match a specific
+// Callback Protocol to an HII Form through the use of Class and SubClass
+// values
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+typedef struct {
+#if EFI_SPECIFICATION_VERSION>0x20000
+ EFI_HII_CONFIG_ACCESS_PROTOCOL Callback;
+#else
+ EFI_FORM_CALLBACK_PROTOCOL Callback;
+#endif
+ UINT16 Class, SubClass;
+} SETUP_CALLBACK;
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+EFI_STATUS Callback(
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN EFI_BROWSER_ACTION Action,
+ IN EFI_QUESTION_ID KeyValue,
+ IN UINT8 Type,
+ IN EFI_IFR_TYPE_VALUE *Value,
+ OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
+);
+#else
+EFI_STATUS Callback(
+ IN EFI_FORM_CALLBACK_PROTOCOL *This,
+ IN UINT16 KeyValue,
+ IN EFI_IFR_DATA_ARRAY *Data,
+ OUT EFI_HII_CALLBACK_PACKET **Packet
+);
+#endif
+
+EFI_STATUS InitAmiSetupProtocol(VOID);
+
+//<AMI_GHDR_START>
+//----------------------------------------------------------------------------
+// Name: Callback_Protocols
+//
+// Description:
+// These Variable definitions define the different formsets and what Callback
+// protocol should be used for each one
+//
+//----------------------------------------------------------------------------
+//<AMI_GHDR_END>
+SETUP_CALLBACK MainCallbackProtocol = {{NULL,NULL,Callback},MAIN_FORM_SET_CLASS,0};
+SETUP_CALLBACK AdvancedCallbackProtocol = {{NULL,NULL,Callback},ADVANCED_FORM_SET_CLASS,0};
+SETUP_CALLBACK ChipsetCallbackProtocol = {{NULL,NULL,Callback},CHIPSET_FORM_SET_CLASS,0};
+SETUP_CALLBACK BootCallbackProtocol = {{NULL,NULL,Callback},BOOT_FORM_SET_CLASS,0};
+SETUP_CALLBACK SecurityCallbackProtocol = {{NULL,NULL,Callback},SECURITY_FORM_SET_CLASS,0};
+SETUP_CALLBACK ExitCallbackProtocol = {{NULL,NULL,Callback},EXIT_FORM_SET_CLASS,0};
+
+EFI_GUID MainFormSetGuid = MAIN_FORM_SET_GUID;
+EFI_GUID AdvancedFormSetGuid = ADVANCED_FORM_SET_GUID;
+EFI_GUID ChipsetFormSetGuid = CHIPSET_FORM_SET_GUID;
+EFI_GUID BootFormSetGuid = BOOT_FORM_SET_GUID;
+EFI_GUID SecurityFormSetGuid = SECURITY_FORM_SET_GUID;
+EFI_GUID ExitFormSetGuid = EXIT_FORM_SET_GUID;
+
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: SetupCallBack
+//
+// Fields: Type Name Description
+// EFI_GUID* pGuid - GUID used for future references
+// EFI_FORM_CALLBACK_PROTOCOL* pFormCallback - Structure that defines the Callback
+// that occurs for this package
+// UINT16 Class - Formset Class of the Form Callback Protocol passed in
+// UINT16 SubClass - Formset Sub Class of the Form Callback Protocol passed in
+// EFI_HII_HANDLE HiiHandle - handle that identifies used Hii Package
+//
+// Description:
+// This array contains the different Hii packages that are used in the system
+//
+// Notes:
+// The HiiHandle is updated in the LoadResources function when the Hii Packages
+// are loaded
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+CALLBACK_INFO SetupCallBack[] = {
+ // Last field in every structure will be filled by the Setup
+ { &MainFormSetGuid, &MainCallbackProtocol.Callback, MAIN_FORM_SET_CLASS, 0, 0},
+ { &AdvancedFormSetGuid, &AdvancedCallbackProtocol.Callback, ADVANCED_FORM_SET_CLASS, 0, 0},
+ { &ChipsetFormSetGuid, &ChipsetCallbackProtocol.Callback, CHIPSET_FORM_SET_CLASS, 0, 0},
+ { &BootFormSetGuid, &BootCallbackProtocol.Callback, BOOT_FORM_SET_CLASS, 0, 0},
+ { &SecurityFormSetGuid, &SecurityCallbackProtocol.Callback, SECURITY_FORM_SET_CLASS, 0, 0},
+ { &ExitFormSetGuid, &ExitCallbackProtocol.Callback, EXIT_FORM_SET_CLASS, 0, 0}
+};
+
+//<AMI_GHDR_START>
+//----------------------------------------------------------------------------
+// Name: FormsetVisible
+//
+// Description:
+// This array contains information that indicates to the system whether or not
+// a formset is visible when Setup is loaded.
+//
+// Reference:
+// SetupCallBack
+//
+// Notes:
+// Formset index in this array should match with the formset index in the
+// SetupCallBack array
+//
+//----------------------------------------------------------------------------
+//<AMI_GHDR_END>
+BOOLEAN FormsetVisible[] = {
+ TRUE, //Main formset is always displayed
+ SHOW_ADVANCED_FORMSET, //Advanced formset
+ SHOW_CHIPSET_FORMSET, //Chipset formset
+ TRUE, //Boot formset is always displayed
+ SHOW_SECURITY_FORMSET, //Security formset
+ TRUE //Exit formset is always displayed
+};
+
+#define NUMBER_OF_FORMSETS (sizeof(SetupCallBack)/sizeof(CALLBACK_INFO))
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: InitString
+//
+// Description:
+// This function updates a string defined by the StrRef Parameter in the HII
+// database with the string and data passed in.
+//
+// Input:
+// EFI_HII_HANDLE HiiHandle - handle that identifies used Hii Package
+// STRING_REF StrRef - String Token defining string in the database to update
+// CHAR16 *sFormat - string with format descriptors in it
+// ... - extra paramaters that define data that correlate to the format
+// descriptors in the String
+//
+// Output:
+// None
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+VOID InitString(EFI_HII_HANDLE HiiHandle, STRING_REF StrRef, CHAR16 *sFormat, ...)
+{
+ CHAR16 s[1024];
+ va_list ArgList = va_start(ArgList,sFormat);
+ Swprintf_s_va_list(s,sizeof(s),sFormat,ArgList);
+ va_end(ArgList);
+ HiiLibSetString(HiiHandle, StrRef, s);
+}
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: RevisionToString
+//
+// Description:
+// This function converts spec revision number to string
+//
+// Input:
+// OUT CHAR16 *String - pointer to string to store output
+// IN UINT32 Revision - spec revision number
+//
+// Output:
+// None
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+VOID RevisionToString(
+ OUT CHAR16 *String,
+ IN UINT32 Revision
+)
+{
+ UINT16 Major;
+ UINT16 MinorH;
+ UINT16 MinorL;
+ UINT16 *Walker;
+
+ Walker = (UINT16 *)&Revision;
+ Major = *(Walker + 1);
+ MinorH = *Walker / 10;
+ MinorL = *Walker % 10;
+
+ if(MinorL != 0)
+ Swprintf(String, L"%d.%d.%d", Major, MinorH, MinorL);
+ else
+ Swprintf(String, L"%d.%d", Major, MinorH);
+}
+
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: InitMain
+//
+// Description:
+// This function updates a few generic BIOS strings that are used on the
+// setup pages.
+//
+// Input:
+// EFI_HII_HANDLE HiiHandle - handle that identifies used Hii Package
+//
+// Output:
+// None
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+VOID InitMain(EFI_HII_HANDLE HiiHandle)
+{
+ DXE_SERVICES *DxeTable;
+ CHAR16 efi[10];
+ CHAR16 pi[10];
+
+ ///////////////// BIOS /////////////////////////////////////
+ CHAR16 *FirmwareVendor = (pST->FirmwareVendor)
+ ? pST->FirmwareVendor
+ : CONVERT_TO_WSTRING(CORE_VENDOR);
+ UINT32 FirmwareRevision = (pST->FirmwareRevision)
+ ? pST->FirmwareRevision
+ : CORE_COMBINED_VERSION;
+
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_BIOS_VENDOR_VALUE),
+ L"%s", FirmwareVendor
+ );
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_BIOS_CORE_VERSION_VALUE),
+ L"%d.%d.%d.%d",
+ ((UINT16*)&pST->FirmwareRevision)[1],
+ *(UINT16*)&pST->FirmwareRevision / 100,
+ *(UINT16*)&pST->FirmwareRevision % 100 / 10,
+ *(UINT16*)&pST->FirmwareRevision % 10
+ );
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_BIOS_VERSION_VALUE),
+#if PROJECT_BUILD_NUMBER_IN_TITLE_SUPPORTED && defined (PROJECT_BUILD)
+#ifdef EFIx64
+ L"%s %d.%02d.%03d x64",
+#else
+ L"%s %d.%02d.%03d",
+#endif
+ STR(PROJECT_TAG), PROJECT_MAJOR_VERSION, PROJECT_MINOR_VERSION, PROJECT_BUILD
+#else //#if PROJECT_BUILD_NUMBER_IN_TITLE_SUPPORTED && defined (PROJECT_BUILD)
+#ifdef EFIx64
+ L"%s %d.%02d x64",
+#else
+ L"%s %d.%02d",
+#endif
+ STR(PROJECT_TAG), PROJECT_MAJOR_VERSION, PROJECT_MINOR_VERSION
+#endif//#if PROJECT_BUILD_NUMBER_IN_TITLE_SUPPORTED && defined (PROJECT_BUILD)
+ );
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_BIOS_DATE_VALUE),
+ L"%s %s", L_TODAY, L_NOW
+ );
+ VERIFY_EFI_ERROR(LibGetDxeSvcTbl(&DxeTable));
+
+ RevisionToString(efi, pST->Hdr.Revision);
+ RevisionToString(pi, DxeTable->Hdr.Revision);
+
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_BIOS_COMPLIANCY_VALUE),
+ L"UEFI %s; PI %s", efi, pi
+ );
+}
+
+VOID InitParts(EFI_HII_HANDLE HiiHandle, UINT16 Class);
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: InitStrings
+//
+// Description:
+// This function is called for each Formset and initializes strings based on
+// the porting provided and then updates the HII database
+//
+// Input:
+// EFI_HII_HANDLE HiiHandle - handle that that identifies used Hii Package
+// CALLBACK_INFO *pCallBackFound - pointer to an instance of CALLBACK_INFO
+// that works with HiiHandle
+//
+// Output:
+// None
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+VOID InitStrings(
+ EFI_HII_HANDLE HiiHandle,
+ CALLBACK_INFO *pCallBackFound
+)
+{
+ if (!pCallBackFound || !pCallBackFound->HiiHandle) return;
+
+ InitParts(HiiHandle, pCallBackFound->Class);
+ switch(pCallBackFound->Class)
+ {
+ case MAIN_FORM_SET_CLASS:
+ InitMain(HiiHandle);
+ break;
+ case SECURITY_FORM_SET_CLASS:
+ {
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_MIN_PASSWORD_LENGTH__VALUE),
+ L"%d", PASSWORD_MIN_SIZE
+ );
+ InitString(
+ HiiHandle,STRING_TOKEN(STR_MAX_PASSWORD_LENGTH__VALUE),
+ L"%d", PASSWORD_MAX_SIZE
+ );
+ break;
+ }
+ }
+#if EFI_SPECIFICATION_VERSION>0x20000
+// TODO: Defaults initialization
+#else
+{
+ EFI_HII_VARIABLE_PACK_LIST *pVarPackList, *pVarPack;
+
+ // Get default values from IFR initialized with default values
+ if (EFI_ERROR(pHii->GetDefaultImage(
+ pHii, HiiHandle, EFI_IFR_FLAG_DEFAULT, &pVarPackList
+ ))) return;
+
+ // Find Setup variable(default varstore) in the returned variable list
+ for(pVarPack = pVarPackList; pVarPack->NextVariablePack != NULL; pVarPack = pVarPack->NextVariablePack)
+ {
+ EFI_HII_VARIABLE_PACK *pVar = pVarPack->VariablePack;
+ UINTN i;
+ UINT8 *p, *q;
+ //default varstore has id set to 0
+ if (pVar->VariableId != 0) continue;
+ //if size does not match, don't update the setup data
+ if (pVar->Header.Length - sizeof(*pVar) - pVar->VariableNameLength != sizeof(Setup))
+ {
+ TRACE((
+ TRACE_DXE_CORE,
+ "ERROR: Setup data size mismatch:\n\t"
+ "Setup variable size: %d\n\t"
+ "Default varstore size: %d\n",
+ sizeof(Setup),
+ pVar->Header.Length - sizeof(*pVar) - pVar->VariableNameLength
+ ));
+ break;
+ }
+ p = (UINT8*)&Setup;
+ q = (UINT8*)(pVar + 1) + pVar->VariableNameLength;
+ for(i = 0; i < sizeof(Setup); i++) p[i] |= q[i];
+ break;
+ }
+ pBS->FreePool(pVarPackList);
+}
+#endif
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: InitLanguages
+//
+// Description:
+// Determine the current language that will be used based on language
+// related EFI Variables.
+//
+// Input:
+// EFI_HII_HANDLE HiiHandle - handle that that identifies used Hii Package
+//
+// Output:
+// None
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID InitLanguages(EFI_HII_HANDLE HiiHandle)
+{
+ UINTN Size = 0;
+#if EFI_SPECIFICATION_VERSION>0x20000
+ EFI_STATUS Status;
+ CHAR8* LangCodes = NULL;
+
+ if (HiiString == NULL) {
+ return;
+ }
+
+ Status = HiiString->GetLanguages(HiiString, HiiHandle, LangCodes, &Size);
+ if (Status==EFI_BUFFER_TOO_SMALL){
+ LangCodes = Malloc(Size);
+ Status = HiiString->GetLanguages(HiiString, HiiHandle, LangCodes, &Size);
+ if (EFI_ERROR(Status)) pBS->FreePool(LangCodes);
+ }
+ if (EFI_ERROR(Status)){
+ Size = sizeof(CONVERT_TO_STRING(DEFAULT_LANGUAGE_CODE));
+ LangCodes = Malloc(Size);
+ pBS->CopyMem(
+ LangCodes, CONVERT_TO_STRING(DEFAULT_LANGUAGE_CODE), Size
+ );
+ }
+#else
+ EFI_STATUS PrimaryStatus;
+ EFI_STATUS SecondaryStatus;
+ UINTN i;
+ UINTN Index = 0;
+ CHAR8* LangCodes = NULL;
+ CHAR16* PrimaryLanguages = NULL;
+ EFI_STRING SecondaryLanguages = NULL;
+
+ if (pHii == NULL) {
+ return;
+ }
+
+ // Get list of available languages
+ PrimaryStatus = pHii->GetPrimaryLanguages( pHii,
+ HiiHandle,
+ &PrimaryLanguages );
+
+ SecondaryStatus = pHii->GetSecondaryLanguages( pHii,
+ HiiHandle,
+ PrimaryLanguages,
+ &SecondaryLanguages );
+
+ if ( !EFI_ERROR(PrimaryStatus) ) {
+ Size = Wcslen(PrimaryLanguages);
+ }
+
+ if ( !EFI_ERROR(SecondaryStatus) ) {
+ Size += Wcslen(SecondaryLanguages);
+ }
+
+ if ( Size == 0 ) {
+ // Primary and Secondary languages are not available
+ Size = 3;
+ LangCodes = Malloc(Size);
+ pBS->CopyMem(
+ LangCodes, CONVERT_TO_STRING(DEFAULT_LANGUAGE_CODE),
+ Size
+ );
+ } else {
+ LangCodes = MallocZ(Size);
+ if ( !EFI_ERROR(PrimaryStatus) ) {
+ // Convert PrimaryLanguages from Unicode to EFI defined ASCII LangCodes
+ for (i = 0; PrimaryLanguages[i] != 0; i++) {
+ LangCodes[Index++] = (CHAR8)PrimaryLanguages[i];
+ }
+ pBS->FreePool(PrimaryLanguages);
+ }
+
+ if ( !EFI_ERROR(SecondaryStatus) ) {
+ // Convert SecondaryLanguages from Unicode to EFI defined ASCII LangCodes
+ for (i = 0; SecondaryLanguages[i] != 0; i++) {
+ LangCodes[Index++] = (CHAR8)SecondaryLanguages[i];
+ }
+
+ pBS->FreePool(SecondaryLanguages);
+ }
+ }
+#endif
+ //LangCodes is a volatile variable and needs to be initialized during every boot
+ //However, this routine is not invoked during every boot,
+ //It is always invoked during the first boot.
+ //During subsequent boots it is only invoked when user is trying to enter Setup
+ //In order to initialize LanCodes when this routine is not invoked, let's create
+ //a non-volatile variable LastLangCodes with the copy of LanCodes.
+ //This copy is used to initialize LanCodes when this routine is not invoked.
+ //(This code is part of SynchornizeLanguageVariables routine)
+ pRS->SetVariable( LastLangCodes,
+ &guidSetup,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ Size,
+ LangCodes );
+
+ pBS->FreePool(LangCodes);
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: SetupCallback
+//
+// Description:
+// This function publishes all HII resources and initializes the HII databases
+// There is a token ALWAYS_PUBLISH_HII_RESOURCES that would call this function
+// on every boot not just when the user tries to enter Setup
+//
+// Input:
+// IN EFI_EVENT Event - Event that was triggered
+// IN VOID *Context - data pointer to context information
+//
+// Output:
+// None
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID SetupCallback(IN EFI_EVENT Event, IN VOID *Context)
+{
+ static BOOLEAN ResourcesLoaded = FALSE;
+ UINT32 i;
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+ if ( !HiiString
+ && EFI_ERROR(pBS->LocateProtocol(
+ &gEfiHiiStringProtocolGuid, NULL, &HiiString
+ ))
+ ) return ;
+ if ( !HiiDatabase
+ && EFI_ERROR(pBS->LocateProtocol(
+ &gEfiHiiDatabaseProtocolGuid, NULL, &HiiDatabase
+ ))
+ ) return ;
+#else
+ if (!pHii && EFI_ERROR(pBS->LocateProtocol(&gEfiHiiProtocolGuid, NULL, &pHii))) return ;
+#endif
+ if (Event) pBS->CloseEvent(Event);
+ if (ResourcesLoaded) return;
+ ResourcesLoaded = TRUE;
+ LoadResources(ThisImageHandle, NUMBER_OF_FORMSETS, SetupCallBack, InitStrings);
+ //Get list of available languages and initialize Lang and LangCodes variables
+ //All setup packages share the same string pack
+ //that's why it is enough to only process single pack in the SetupCallBack array.
+ InitLanguages(SetupCallBack[0].HiiHandle);
+ //Hide (remove) formsets if necessary
+ for(i = 0; i < NUMBER_OF_FORMSETS; i++){
+ if (!FormsetVisible[i])
+#if EFI_SPECIFICATION_VERSION>0x20000
+ HiiDatabase->RemovePackageList(
+ HiiDatabase, SetupCallBack[i].HiiHandle
+ );
+#else
+ pHii->RemovePack(pHii, SetupCallBack[i].HiiHandle);
+#endif
+ }
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: IsoToRfc
+//
+// Description:
+// This function takes a language string based on the ISO standard and
+// returns a string that represents the same language in the RFC standard
+//
+// Input:
+// IN CHAR8 *IsoLang - ASCII string that represents language in the ISO format
+//
+// Output:
+// CHAR8 * - String that represents RFC version of the ISO language code passed
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* IsoToRfc(IN CHAR8 *IsoLang, OUT UINTN *RfcLangSize){
+ UINTN i;
+ if (IsoLang == NULL) return NULL;
+ for(i = 0; Iso6392LanguageList[i] != NULL; i++){
+ if (MemCmp(Iso6392LanguageList[i], IsoLang, 3) == 0){
+ if (RfcLangSize!=NULL)
+ *RfcLangSize = Strlen(Rfc4646LanguageList[i])+1;
+ return Rfc4646LanguageList[i];
+ }
+ }
+ return NULL;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: RfcToIso
+//
+// Description:
+// This function takes a language string based on the RFC standard and
+// returns a string that represents the same language in the ISO standard
+//
+// Input:
+// IN CHAR8 *RfcLang - ASCII string that represents a language in RFC standard
+//
+// Output:
+// CHAR8 * - String that represents ISO version of the RFC language code passed
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* RfcToIso(IN CHAR8 *RfcLang, OUT UINTN *IsoLangSize){
+ UINTN i;
+ if (RfcLang == NULL) return NULL;
+ for(i = 0; Rfc4646LanguageList[i] != NULL; i++){
+ if (Strcmp(Rfc4646LanguageList[i],RfcLang) == 0){
+ if (IsoLangSize!=NULL) *IsoLangSize = 3;
+ return Iso6392LanguageList[i];
+ }
+ }
+ return NULL;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: IsoListToRfcList
+//
+// Description:
+// This function coverts list of ISO language tags to a list of RFC language tags
+//
+// Input:
+// IN CHAR8 *IsoList - string that represents list of one or more ISO language strings
+// IN UINTN IsoListSize - number of ISO entries in the list
+// OUT UINTN *RfcListSize - pointer to store size of output buffer
+//
+// Output:
+// VOID * - String that represents the RFC version of the ISO language codes passed
+//
+// Notes:
+// ISO tags are 3 characters in size
+// RFC tags are 42(max) characters plus a ';' that ends each tag
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* IsoListToRfcList(IN CHAR8 *IsoList, IN UINTN IsoListSize, OUT UINTN *RfcListSize){
+ CHAR8 *IsoPtr;
+ CHAR8 *RfcList;
+ CHAR8 *RfcPtr;
+
+ if (IsoList==NULL || *IsoList==0 || IsoListSize<3) return NULL;
+ //IsoListSize/3 = number of languages in the list
+ //RFC4646 defines max lang tag size of 42, plus ';'
+ RfcList = Malloc(IsoListSize / 3 * (42 + 1));
+ if (RfcList == NULL) return NULL;
+ for(IsoPtr = IsoList, RfcPtr = RfcList;
+ IsoPtr < IsoList + IsoListSize;
+ IsoPtr += 3
+ ){
+ UINTN Length;
+ CHAR8 *TmpPtr = IsoToRfc(IsoPtr, &Length);
+
+ if (TmpPtr == NULL) continue;
+ Length--; // string length = string size - 1
+ MemCpy(RfcPtr, TmpPtr, Length);
+ RfcPtr += Length;
+ *RfcPtr++ = ';';
+ }
+ if (RfcPtr == RfcList){
+ pBS->FreePool(RfcList);
+ if (RfcListSize) *RfcListSize=0;
+ return NULL;
+ }
+ *(RfcPtr - 1) = 0;
+ if (RfcListSize) *RfcListSize=RfcPtr-RfcList;
+ return RfcList;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: RfcListToIsoList
+//
+// Description:
+// This function coverts list of RFC language tags to a list of ISO language tags
+//
+// Input:
+// IN CHAR8 *RfcList - string that represents list of one or more RFC language strings
+// IN UINTN RfcListSize - number of RFC entries in the list
+// OUT UINTN *IsoListSize - pointer to store size of output buffer
+//
+// Output:
+// CHAR8 * - A string that corresponds to the ISO version of the RFC language codes
+// passed
+//
+// Notes:
+// ISO tags are 3 characters in size
+// RFC tags are 42(max) characters plus a ';' that ends each tag
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* RfcListToIsoList(IN CHAR8 *RfcList, IN UINTN RfcListSize, OUT UINTN *IsoListSize){
+ UINTN Size;
+ CHAR8 *RfcPtr, *RfcEndPtr;
+ CHAR8 *IsoPtr;
+ CHAR8 *IsoList;
+
+ if (RfcList==NULL || *RfcList==0) return NULL;
+ //calculate number of languages in the RfcList
+ for(Size=3, RfcPtr=RfcList; *RfcPtr!=0; RfcPtr++){
+ if (*RfcPtr==';') Size+=3;
+ }
+ IsoList = Malloc(Size);
+ IsoPtr = IsoList;
+ RfcEndPtr = RfcList;
+ while(RfcEndPtr < RfcList+RfcListSize){
+ CHAR8 *IsoLang;
+ CHAR8 OriginalChar;
+ RfcPtr = RfcEndPtr;
+ while(*RfcEndPtr!=';'&&*RfcEndPtr!=0) RfcEndPtr++;
+ OriginalChar = *RfcEndPtr;
+ *RfcEndPtr = 0;
+ IsoLang=RfcToIso(RfcPtr,NULL);
+ if (IsoLang!=NULL){
+ MemCpy(IsoPtr, IsoLang, 3);
+ IsoPtr += 3;
+ }
+ *RfcEndPtr = OriginalChar;
+ RfcEndPtr++;
+ }
+ if (IsoPtr==IsoList){
+ pBS->FreePool(IsoList);
+ if (IsoListSize) *IsoListSize=0;
+ return NULL;
+ }
+ if (IsoListSize) *IsoListSize=IsoPtr-IsoList;
+ return IsoList;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: GetFirstIsoLang
+//
+// Description:
+// This function returns first language from passed ISO list
+//
+// Input:
+// IN CHAR8 *IsoList - string that represents list of one or more ISO languages
+// OUT UINTN *LangSize - pointer to store size of output buffer
+//
+// Output:
+// CHAR8 * - A string that contains first language
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* GetFirstIsoLang(CHAR8* IsoList, UINTN *LangSize){
+ if (LangSize) *LangSize=3;
+ return IsoList;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: GetFirstRfcLang
+//
+// Description:
+// This function returns first language from passed RFC list
+//
+// Input:
+// IN CHAR8 *RfcList - string that represents list of one or more RFC languages
+// OUT UINTN *LangSize - pointer to store size of output buffer
+//
+// Output:
+// CHAR8 * - A string that contains first language
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* GetFirstRfcLang(CHAR8* RfcList, UINTN *LangSize){
+ CHAR8 *RfcPtr;
+
+ for(RfcPtr=RfcList; *RfcPtr!=0 && *RfcPtr!=';'; RfcPtr++);
+ *RfcPtr=0;
+ if (LangSize) *LangSize=RfcPtr-RfcList+1;
+ return RfcList;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: GetLangVariable
+//
+// Description:
+// This function returns language variable stored in NVRAM
+//
+// Input:
+// IN CHAR16 *VariableName - Human-readable name of language variable
+// EFI_GUID *VariableGuid - pointer to variable GUID
+// UINTN *VariableSize - pointer to store output buffer size
+//
+// Output:
+// CHAR8 * - A string that contains list of languages supported by platform
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+CHAR8* GetLangVariable(
+ CHAR16 *VariableName, EFI_GUID *VariableGuid, UINTN *VariableSize
+){
+ UINTN Size = 0;
+ CHAR8 *Buffer = NULL;
+ EFI_STATUS Status;
+
+ Status = GetEfiVariable(VariableName, VariableGuid, NULL, &Size, &Buffer);
+ if (EFI_ERROR(Status)) Buffer=NULL;
+ else if (VariableSize!=NULL) *VariableSize=Size;
+ return Buffer;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: SetLangCodes
+//
+// Description:
+// This function stores "PlatformLangCodes" variable
+//
+// Input:
+// IN CHAR16 *VariableName - Human-readable name of language variable
+// CHAR8* LangBuffer - pointer to list of language codes to store
+// UINTN LangBufferSize - size of the passed buffer
+//
+// Output:
+// None
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID SetLangCodes(CHAR16 *VariableName, CHAR8* LangBuffer, UINTN LangBufferSize){
+ if (LangBuffer==NULL) return;
+ pRS->SetVariable(
+ VariableName, &guidEfiVar,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ EFI_VARIABLE_RUNTIME_ACCESS,
+ LangBufferSize, LangBuffer
+ );
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: SetLang
+//
+// Description:
+// This function stores "PlatformLang" variable
+//
+// Input:
+// IN CHAR16 *VariableName - Human-readable name of language variable
+// CHAR8* LangBuffer - pointer to alanguage code to store
+// UINTN LangBufferSize - size of the passed buffer
+//
+// Output:
+// None
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID SetLang(CHAR16 *VariableName, CHAR8* LangBuffer, UINTN LangBufferSize){
+ if (LangBuffer==NULL) return;
+ pRS->SetVariable(
+ VariableName, &guidEfiVar,
+ EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ EFI_VARIABLE_RUNTIME_ACCESS,
+ LangBufferSize, LangBuffer
+ );
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: SynchornizeLanguageVariables
+//
+// Description:
+// This function makes sure that all the Language variable are set to the
+// same value.
+//
+// Input:
+// None
+//
+// Output:
+// None
+//
+// Notes:
+// Uses the following NVRAM variables
+// LangCodes, PlatformLangCodes, Lang, PlatformLang, LastLang
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID SynchornizeLanguageVariables(){
+ CHAR8 *NativeLangBuffer;
+ CHAR8 *CompatLangBuffer;
+ CHAR8 *NativeLangCodesBuffer;
+ CHAR8 *CompatLangCodesBuffer;
+ UINTN NativeLangSize;
+ UINTN CompatLangSize;
+ UINTN NativeLangCodesSize;
+ UINTN CompatLangCodesSize;
+ BOOLEAN FreeNativeLangBuffer;
+
+ //Set LanCodes variables
+ NativeLangCodesBuffer = GetLangVariable(LastLangCodes, &guidSetup, &NativeLangCodesSize);
+ SetLangCodes(NativeLangCodes, NativeLangCodesBuffer, NativeLangCodesSize);
+ CompatLangCodesBuffer = LangNativeListToCompatList(
+ NativeLangCodesBuffer, NativeLangCodesSize, &CompatLangCodesSize
+ );
+ SetLangCodes(CompatLangCodes, CompatLangCodesBuffer, CompatLangCodesSize);
+ pBS->FreePool(CompatLangCodesBuffer);
+ FreeNativeLangBuffer = FALSE;
+
+ //Set Lang variables
+ NativeLangBuffer = GetLangVariable(NativeLang, &guidEfiVar, &NativeLangSize);
+ CompatLangBuffer = GetLangVariable(CompatLang, &guidEfiVar, &CompatLangSize);
+ if (!NativeLangBuffer && CompatLangBuffer){
+ //Derive NativeLang value from the CompatLang
+ NativeLangBuffer = LangToNative(CompatLangBuffer, &NativeLangSize);
+ SetLang(NativeLang, NativeLangBuffer, NativeLangSize);
+ pBS->FreePool(CompatLangBuffer);
+ }else if (NativeLangBuffer && !CompatLangBuffer) {
+ //Derive CompatLang value from the NativeLang
+ CompatLangBuffer = LangToCompat(NativeLangBuffer,&CompatLangSize);
+ SetLang(CompatLang,CompatLangBuffer,CompatLangSize);
+ FreeNativeLangBuffer = TRUE;
+ }else if (!NativeLangBuffer && !CompatLangBuffer) {
+ //Set NativeLang to the first language from the NativeLangCodes list
+ NativeLangBuffer = GetFirstLang(NativeLangCodesBuffer, &NativeLangSize);
+ SetLang(NativeLang, NativeLangBuffer, NativeLangSize);
+ //Derive CompatLang value from the NativeLang
+ CompatLangBuffer = LangToCompat(NativeLangBuffer,&CompatLangSize);
+ SetLang(CompatLang,CompatLangBuffer,CompatLangSize);
+ }else{ //NativeLang && CompatLang
+ CHAR8 *CompatLangInNativeFormat = LangToNative(CompatLangBuffer,NULL);
+ if (!LanguageCodesEqual(CompatLangInNativeFormat,NativeLangBuffer)){
+ CHAR8 *LastLangBuffer=GetLangVariable(LastLang, &guidSetup, NULL);
+ if (LastLangBuffer && LanguageCodesEqual(LastLangBuffer,NativeLangBuffer)){
+ pBS->FreePool(NativeLangBuffer);
+ //Derive NativeLang value from the CompatLang
+ NativeLangBuffer = LangToNative(CompatLangBuffer, &NativeLangSize);
+ SetLang(NativeLang, NativeLangBuffer, NativeLangSize);
+ }else{
+ pBS->FreePool(CompatLangBuffer);
+ //Derive CompatLang value from the NativeLang
+ CompatLangBuffer = LangToCompat(NativeLangBuffer,&CompatLangSize);
+ SetLang(CompatLang,CompatLangBuffer,CompatLangSize);
+ FreeNativeLangBuffer = TRUE;
+ }
+ pBS->FreePool(LastLangBuffer);
+ }
+ }
+ pRS->SetVariable(
+ LastLang, &guidSetup,
+ EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS,
+ NativeLangSize, NativeLangBuffer
+ );
+ if (FreeNativeLangBuffer) pBS->FreePool(NativeLangBuffer);
+ pBS->FreePool(NativeLangCodesBuffer);
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: IsVarisbleExist
+//
+// Description:
+// Helper routine that checks if a given variable exists
+//
+// Input:
+// IN CHAR16 *VariableName - Name of the variable to check on
+// IN EFI_GUID *VendorGuid - GUID of the variable to check on
+//
+// Output:
+// TRUE - if variable exsits
+// FALSE - if variable does not exist
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN IsVariableExist(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid){
+ UINTN Size=0;
+ return
+ pRS->GetVariable(VariableName, VendorGuid, NULL, &Size, NULL)
+ == EFI_BUFFER_TOO_SMALL;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: SetupEntry
+//
+// Description:
+// This function is the entry point for the Setup driver. It registers the
+// the Setup callback functions and then it checks if the
+// "Setup" and "Lang" variables are defined. If not it is a first boot
+// (first flash or first boot after BIOS upgrade) and these variables will
+// need to be defined.
+// If "Setup" and "Lang" variables are defined, then make sure the language
+// variables all agree and then return
+//
+// Input:
+// IN EFI_HANDLE ImageHandle - Image handle
+// IN EFI_SYSTEM_TABLE *SystemTable - pointer to the UEFI System Table
+//
+// Output:
+// EFI_SUCCESS
+//
+// Notes:
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS SetupEntry(
+ IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable
+)
+{
+ static EFI_EVENT SetupEnterEvent;
+ static EFI_GUID guidSetupEnter = AMITSE_SETUP_ENTER_GUID;
+#if FORCE_USER_TO_SETUP_ON_FIRST_BOOT
+ static UINT32 BootFlow = BOOT_FLOW_CONDITION_FIRST_BOOT;
+ static EFI_GUID guidBootFlow = BOOT_FLOW_VARIABLE_GUID;
+#endif
+
+ EFI_HANDLE Handle=NULL;
+
+ ThisImageHandle = ImageHandle;
+ InitAmiLib(ImageHandle,SystemTable);
+ InitAmiSetupProtocol();
+ pBS->SetMem(Setup, sizeof(Setup), 0);
+
+ if (!IsVariableExist(LastLangCodes, &guidSetup))
+ { //If LastLangCodes Variable is not found,
+ //this is first boot after FW upgrade.
+ //We have to submit resources to HII to get Setup defaults
+ //and list of supported languages.
+ //After that we have to:
+ // 1. If Setup variable is missing,
+ // initialize it with Defaults
+ // 2. If Lang is missing, initialize
+ // Lang variable.
+ // 3. Force user to go to Setup
+ // ( if FORCE_USER_TO_SETUP_ON_FIRST_BOOT SDL token is on).
+ SetupCallback(NULL, NULL); //submit resources to HII and get defaults
+ //Setup global variable is initialized during SetupCallback
+#if EFI_SPECIFICATION_VERSION>0x20000
+// TODO: Defaults initialization
+#else
+ if (!IsVariableExist(L"Setup", &guidSetup))
+ pRS->SetVariable(
+ L"Setup", &guidSetup,
+ EFI_VARIABLE_NON_VOLATILE
+ | EFI_VARIABLE_BOOTSERVICE_ACCESS
+ | EFI_VARIABLE_RUNTIME_ACCESS,
+ sizeof(Setup), &Setup
+ );
+#endif
+#if FORCE_USER_TO_SETUP_ON_FIRST_BOOT
+ if (!IsVariableExist(L"BootFlow", &guidBootFlow)){
+ return pRS->SetVariable(
+ L"BootFlow", &guidBootFlow,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS,
+ sizeof(BootFlow), &BootFlow);
+ }
+#endif
+ }
+ else
+ { //otherwise
+ // Register setup callbacks to submit resources to HII
+ // only if/when setup is launched
+#if ALWAYS_PUBLISH_HII_RESOURCES
+ SetupCallback(NULL, NULL);
+#else
+ VOID *pSetupRegistration;
+ RegisterProtocolCallback(
+ &guidSetupEnter, SetupCallback,
+ NULL,&SetupEnterEvent, &pSetupRegistration
+ );
+#endif
+ }
+ SynchornizeLanguageVariables();
+ return EFI_SUCCESS;
+}
+
+//<AMI_THDR_START>
+//----------------------------------------------------------------------------
+// Name: SETUP_ITEM_CALLBACK
+//
+// Fields: Type Name Description
+// UINT16 Class - Primary identification value of an Hii Formset
+// UINT16 SubClass - Secondary identification value of an Hii Formset
+// UINT16 Key - A unique value that identifies a specific item on a setup form
+// SETUP_ITEM_CALLBACK_HANDLER *UpdateItem - function used to update an item
+// defined by the Class, SubClass and Key parameters
+//
+// Description:
+// This Data Structure is used by the setup infrastructure to define
+// callback functions that should be used for interacting with setup forms
+// or individual questions.
+//
+// Notes:
+//
+//----------------------------------------------------------------------------
+//<AMI_THDR_END>
+
+
+// Brings the definitions of the SDL token defined list of callbacks into this
+// file as a list of functions that can be called
+#define ITEM_CALLBACK(Class,Subclass,Key,Callback) Callback
+extern SETUP_ITEM_CALLBACK_HANDLER SETUP_ITEM_CALLBACK_LIST EndOfList;
+#undef ITEM_CALLBACK
+
+// This creates an array of callbacks to be used
+#define ITEM_CALLBACK(Class,Subclass,Key,Callback) {Class,Subclass,Key,&Callback}
+SETUP_ITEM_CALLBACK SetupItemCallback[] = { SETUP_ITEM_CALLBACK_LIST {0,0,0,NULL} };
+
+CALLBACK_PARAMETERS *CallbackParametersPtr = NULL;
+CALLBACK_PARAMETERS* GetCallbackParameters(){
+ return CallbackParametersPtr;
+}
+
+static AMI_SETUP_PROTOCOL *AmiSetupProtocol = NULL;
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: Callback
+//
+// Description:
+// This function is used to identify the function to call when an interactive
+// item has been triggered in the setup browser based on the information in
+// the Callback protocol and the SetupCallBack Array
+//
+// Input:
+// IN EFI_FORM_CALLBACK_PROTOCOL *This - Pointer to the instance of the callback
+// protocol
+// IN UINT16 KeyValue - Unique value that defines the type of data to expect in
+// the Data parameter
+// IN EFI_IFR_DATA_ARRAY *Data - Data defined by KeyValue Parameter
+// OUT EFI_HII_CALLBACK_PACKET **Packet - Data passed from the Callback back to
+// the setup Browser
+//
+// Output:
+// EFI_SUCCESS
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+#if EFI_SPECIFICATION_VERSION>0x20000
+EFI_STATUS Callback(
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN EFI_BROWSER_ACTION Action,
+ IN EFI_QUESTION_ID KeyValue,
+ IN UINT8 Type,
+ IN EFI_IFR_TYPE_VALUE *Value,
+ OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
+)
+#else
+EFI_STATUS Callback(
+ IN EFI_FORM_CALLBACK_PROTOCOL *This,
+ IN UINT16 KeyValue,
+ IN EFI_IFR_DATA_ARRAY *Data,
+ OUT EFI_HII_CALLBACK_PACKET **Packet
+)
+#endif
+{
+ UINTN i;
+ SETUP_CALLBACK *pCallback = (SETUP_CALLBACK*)This;
+ CALLBACK_PARAMETERS CallbackParameters;
+ EFI_STATUS Status;
+ SETUP_ITEM_CALLBACK *SetupItemCallbacks = NULL;
+ UINTN FixedSize = sizeof(SetupItemCallback);
+ UINTN VarSize = 0;
+ UINT8 *CopyPointer;
+ BOOLEAN AllocatedBuffer = FALSE;
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+ CallbackParameters.This = (VOID*)This;
+ CallbackParameters.Action = Action;
+ CallbackParameters.KeyValue = KeyValue;
+ CallbackParameters.Type = Type;
+ CallbackParameters.Value = Value;
+ CallbackParameters.ActionRequest = ActionRequest;
+ if (ActionRequest) *ActionRequest=EFI_BROWSER_ACTION_REQUEST_NONE;
+ Status = EFI_UNSUPPORTED;
+#else
+ CallbackParameters.This = This;
+ CallbackParameters.KeyValue = KeyValue;
+ CallbackParameters.Data = Data;
+ CallbackParameters.Packet = Packet;
+ Status = EFI_SUCCESS;
+#endif
+
+ CallbackParametersPtr = &CallbackParameters;
+
+ if(AmiSetupProtocol == NULL) {
+ Status = pBS->LocateProtocol(&AmiSetupProtocolGuid, NULL, &AmiSetupProtocol);
+ }
+
+//first get callbacks, registered at runtime
+ Status = AmiSetupProtocol->GetCallbacks(&VarSize, SetupItemCallbacks);
+ if(Status == EFI_NOT_FOUND) { //no runtime callbacks registered
+ SetupItemCallbacks = SetupItemCallback;
+ } else if(Status == EFI_BUFFER_TOO_SMALL) {
+ Status = pBS->AllocatePool(EfiBootServicesData, VarSize + FixedSize, &SetupItemCallbacks);
+ if(EFI_ERROR(Status))
+ return Status;
+ AllocatedBuffer = TRUE;
+ Status = AmiSetupProtocol->GetCallbacks(&VarSize, SetupItemCallbacks);
+ //now add callbacks registered at build time via eLink
+ CopyPointer = (UINT8 *)SetupItemCallbacks;
+ CopyPointer += VarSize;
+ MemCpy(CopyPointer, SetupItemCallback, FixedSize);
+ }
+
+ for(i=0; i<NUMBER_OF_FORMSETS; i++)
+ if (SetupCallBack[i].Class == pCallback->Class && SetupCallBack[i].SubClass == pCallback->SubClass)
+ {
+ SETUP_ITEM_CALLBACK *pItemCallback = SetupItemCallbacks;
+ while(pItemCallback->UpdateItem)
+ {
+ if ( pItemCallback->Class == pCallback->Class
+ && pItemCallback->SubClass == pCallback->SubClass
+ && pItemCallback->Key == KeyValue
+ ){
+ Status = pItemCallback->UpdateItem(
+ SetupCallBack[i].HiiHandle,
+ pItemCallback->Class, pItemCallback->SubClass,
+ KeyValue
+ );
+#if EFI_SPECIFICATION_VERSION>0x20000
+ if (Status != EFI_UNSUPPORTED) break;
+#endif
+ }
+ pItemCallback++;
+ }
+ }
+ CallbackParametersPtr = NULL;
+ if(AllocatedBuffer)
+ pBS->FreePool(SetupItemCallbacks);
+ return Status;
+}
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/Setup/Setup.cif b/Board/EM/Setup/Setup.cif
new file mode 100644
index 0000000..36a7790
--- /dev/null
+++ b/Board/EM/Setup/Setup.cif
@@ -0,0 +1,23 @@
+<component>
+ name = "Setup"
+ category = ModulePart
+ LocalRoot = "Board\em\Setup\"
+ RefName = "Setup"
+[files]
+"Setup.sdl"
+"Setup.mak"
+"Setup.c"
+"SetupPrivate.h"
+"Setup.dxs"
+"Setup.uni"
+"Main.vfr"
+"Advanced.vfr"
+"Chipset.vfr"
+"Boot.vfr"
+"Logo.bmp"
+"Security.vfr"
+"Exit.vfr"
+"AmiSetupProtocol.c"
+[parts]
+"AmiSetupProtocol"
+<endComponent>
diff --git a/Board/EM/Setup/Setup.dxs b/Board/EM/Setup/Setup.dxs
new file mode 100644
index 0000000..98b64a6
--- /dev/null
+++ b/Board/EM/Setup/Setup.dxs
@@ -0,0 +1,63 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/Setup.dxs 6 2/15/11 4:29p Artems $
+//
+// $Revision: 6 $
+//
+// $Date: 2/15/11 4:29p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/Setup.dxs $
+//
+// 6 2/15/11 4:29p Artems
+// Replaced TABs with spaces
+//
+// 5 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 3 8/22/05 5:30p Felixp
+// dependency from ConsoleControl so that Setup will be started once
+// all devices are connected
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Setup.dxs
+//
+// Description:
+// Dependancy expression for the Setup component
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#include <Protocol/ConsoleControl.h>
+
+DEPENDENCY_START
+CONSOLE_IN_DEVICES_STARTED_PROTOCOL_GUID
+DEPENDENCY_END
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Board/EM/Setup/Setup.mak b/Board/EM/Setup/Setup.mak
new file mode 100644
index 0000000..e156eff
--- /dev/null
+++ b/Board/EM/Setup/Setup.mak
@@ -0,0 +1,259 @@
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#**********************************************************************
+
+#**********************************************************************
+# $Header: /Alaska/BIN/Board/Setup/Setup.mak 37 3/02/11 12:06p Felixp $
+#
+# $Revision: 37 $
+#
+# $Date: 3/02/11 12:06p $
+#**********************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/BIN/Board/Setup/Setup.mak $
+#
+# 37 3/02/11 12:06p Felixp
+# EIP 54915 (Enhancement):
+# Method of generation of the $(BUILD_DIR)\SetupCallbackList.h header is
+# changed
+# to support larger number of callbacks(longer value of the
+# SETUP_ITEM_CALLBACK_LIST macro)
+# registered under SetupItemCallbacks eLink
+#
+# 36 10/06/10 2:34p Felixp
+# Make the make file compatible with Core 4.6.4.0
+#
+# 35 6/09/10 10:53p Felixp
+# Setup Customization Support.
+#
+# 34 2/05/10 12:26p Felixp
+#
+# 33 2/05/10 11:37a Felixp
+# LOGO_FILE_NAME SDL tokens is added to support logo file overrides.
+#
+# 32 11/23/09 5:04p Felixp
+# Initialize DEFAULT_LANGUAGE_CODE macro based on value of the
+# DEFAULT_LANGUAGE token using /D option.
+#
+# 31 10/21/09 3:10p Felixp
+# UEFI2.1 related: start auto-id generated by VfrId from 1000 to avoid
+# conflicts with question ID assigned by VFR compiler
+# (requires new version of VfrId)
+#
+# 30 10/09/09 6:43p Felixp
+# UEFI 2.1 Support (the component is updated to support Framework and
+# UEFI 2.1 HII).
+#
+# 29 6/30/09 11:42a Robert
+# Added Comment and updated parts for coding standards
+#
+# 28 5/22/09 6:48p Felixp
+#
+# 27 3/05/09 1:23p Felixp
+# Improvement:
+# Custom commands for the $(BUILD_DIR)\SetupStrTokens.h target are
+# replaced with the invocation of the standard (rules.mak based) make
+# file.
+# No functionality changes.
+#
+# 26 2/23/09 10:16a Oleksiyy
+# Bug fix (EIP 18214) Build process failed if too many SetupItemCallbacks
+# in one command line. Solution is to
+# forward SETUP_ITEM_CALLBACK_LIST definition into SetupCallbackList.h
+# file, generated during the build process (in Setup.mak), and include it
+# into Setup.c.
+#
+#
+# 25 10/30/07 11:24a Felixp
+# SDL tokens to hide advanced, chipset, and security formsets added
+#
+# 24 9/05/07 12:28p Felixp
+# Dependency from $(BUILD_DIR)\AUTOID.h added.
+#
+# 23 8/31/07 4:46p Felixp
+# Previous changes removed.
+#
+# 20 1/22/07 2:58p Felixp
+# CJK support added (scan string packs with font tool).
+#
+# 19 12/05/06 12:25p Felixp
+# Use date/time stamps from TimeStamp.h instead of C __DATE__ macro
+#
+# 18 2/06/06 6:30p Felixp
+# Support for Callbacks added
+#
+# 13 8/23/05 4:07p Felixp
+# depndency from token.mak added
+#
+# 2 5/31/05 11:20a Felixp
+# Advanced and Chipset Screens Disabled
+#
+# 5 5/24/05 3:07p Felixp
+# Modular setup framework implemented
+#
+# 2 3/07/05 7:08p Felixp
+# when EMBEDDED_RESOURCES is set to 1, setup will be built as application
+#
+#**********************************************************************
+#<AMI_FHDR_START>
+#
+# Name: Setup.mak
+#
+# Description:
+# This file contains the build commands for the setup component.
+#
+#<AMI_FHDR_END>
+#**********************************************************************
+all : Setup
+
+SetupData : Setup
+
+SETUP_FORMSETS=\
+$(Setup_DIR)\Main.vfr\
+$(Setup_DIR)\Advanced.vfr\
+$(Setup_DIR)\Chipset.vfr\
+$(Setup_DIR)\Boot.vfr\
+$(Setup_DIR)\Security.vfr\
+$(Setup_DIR)\Exit.vfr
+
+VFR_PACKS_TEMP=$(SETUP_FORMSETS: = $(BUILD_DIR^)\)
+VFR_PACKS=$(VFR_PACKS_TEMP:.vfr=.hpk)
+
+!IF $(CORE_COMBINED_VERSION)<262785
+Setup : $(BUILD_DIR)\Setup.mak SetupSdbs SetupFiles SetupBin $(BUILD_DIR)\Logo.FFS
+!ELSE
+PREPARE : $(BUILD_DIR)\Setup.mak SetupSdbs SetupFiles
+$(BUILD_DIR)\SetupStrTokens.h : SetupResources
+Setup : SetupBin $(BUILD_DIR)\Logo.FFS
+!ENDIF
+
+SetupSdbs :
+
+$(BUILD_DIR)\Setup.mak : $(Setup_DIR)\$(@B).cif $(Setup_DIR)\$(@B).mak $(BUILD_RULES)
+ $(CIF2MAK) $(Setup_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+SETUP_AUTO_GENERATED_FILES=$(BUILD_DIR)\AUTOID.h $(BUILD_DIR)\LangList.h $(BUILD_DIR)\SetupStrTokens.h
+SetupFiles : $(SETUP_AUTO_GENERATED_FILES)
+
+$(BUILD_DIR)\AUTOID.h : $(SETUP_FORMSETS) $(SETUP_DEFINITIONS) $(Setup_DIR)\Setup.mak $(BUILD_DIR)\token.mak
+!IF $(EFI_SPECIFICATION_VERSION)>0x20000
+ $(VFRID) /s1024 /o$(BUILD_DIR)\AUTOID.h $(SETUP_FORMSETS) $(SETUP_DEFINITIONS)
+!ELSE
+ $(VFRID) /o$(BUILD_DIR)\AUTOID.h $(SETUP_FORMSETS) $(SETUP_DEFINITIONS)
+!ENDIF
+ type << >>$(BUILD_DIR)\AUTOID.h
+#ifndef AUTO_ID
+#define AUTO_ID(x) x
+#endif
+<<
+
+SETUP_STRGATHER_FLAGS=-db $(BUILD_DIR)\Setup.sdb
+!IF "$(SETUP_SDBS)"!=""
+SETUP_STRGATHER_FLAGS=$(SETUP_STRGATHER_FLAGS) -db $(SETUP_SDBS: = -db )
+!ENDIF
+
+!IF $(CORE_COMBINED_VERSION)<262785
+$(BUILD_DIR)\SetupStrTokens.h : $(SETUP_FORMSETS) $(SETUP_DEFINITIONS) $(SETUP_SDBS) $(Setup_DIR)\Setup.mak $(Setup_DIR)\Setup.uni $(BUILD_DIR)\token.mak
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS) TYPE=SDB\
+ /f $(BUILD_DIR)\Setup.mak all
+ $(MAKE) /$(MAKEFLAGS) /a $(BUILD_DEFAULTS) TYPE=SDB\
+ STRING_CONSUMERS= "STRGATHER_FLAGS=$(SETUP_STRGATHER_FLAGS)"\
+ /f $(BUILD_DIR)\Setup.mak $(BUILD_DIR)\SetupStrTokens.h
+!ELSE
+SetupResources : $(SETUP_FORMSETS) $(SETUP_DEFINITIONS) $(SETUP_SDBS) $(Setup_DIR)\Setup.mak $(Setup_DIR)\Setup.uni $(BUILD_DIR)\token.mak
+ $(MAKE) /$(MAKEFLAGS) $(NO_EXT_OBJS_BUILD_DEFAULTS) TYPE=SDB\
+ /f $(BUILD_DIR)\Setup.mak all
+ $(MAKE) /$(MAKEFLAGS) /a $(NO_EXT_OBJS_BUILD_DEFAULTS) TYPE=RESOURCES\
+ "STRGATHER_FLAGS=$(SETUP_STRGATHER_FLAGS)"\
+ "VFR_PACKS=$(BUILD_DIR)\SetupStr.hpk $(VFR_PACKS)"\
+!IF "$(SETUP_DATA_LAYOUT_OVERRIDE_HEADER)"==""
+ "VFR_INCLUDES=$(SETUP_VFR_INCLUDES)"\
+!ELSE
+ "VFR_INCLUDES=$(SETUP_VFR_INCLUDES) -t $(SETUP_DATA_LAYOUT_OVERRIDE_HEADER)"\
+!ENDIF
+ /f $(BUILD_DIR)\Setup.mak all
+!ENDIF # !IF $(CORE_COMBINED_VERSION)<262785
+
+_INCLUDE=!INCLUDE
+_IF=!IF
+_ENDIF=!ENDIF
+_ERROR=!ERROR
+_MESSAGE=!MESSAGE
+$(BUILD_DIR)\LangList.h : $(BUILD_DIR)\token.mak $(Setup_DIR)\Setup.mak Core\Languages.mak
+ $(ECHO) // Supported Languages > $(BUILD_DIR)\LangList.h
+ $(MAKE) EFI_SPECIFICATION_VERSION=0x20000 FORMAT_NAME=Iso6392 -f<<$(BUILD_DIR)\LangList.mak
+$(_INCLUDE) $(BUILD_DIR)\token.mak
+$(_INCLUDE) Core\Languages.mak
+COMMA_SEPARATED_LIST=$$(SUPPORTED_LANGUAGES: =,),
+$(_IF) "$$(COMMA_SEPARATED_LIST:,,=x)"!="$$(COMMA_SEPARATED_LIST)"
+$(_MESSAGE) Potential problems:
+$(_MESSAGE) - The token is blank
+$(_MESSAGE) - More than one space between language names
+$(_MESSAGE) - One of the language names is not in $$$$(<lang-name>) format
+$(_MESSAGE) - One of the language names is not defined in the ISO 639-2 section of Core\Languages.mak
+$(_MESSAGE) - One of the language names is not defined in the RFC 4646 section of Core\Languages.mak
+$(_ERROR) Invalid format of the SUPPORTED_LANGUAGES token
+$(_ENDIF)
+all :
+ $(ECHO) static CHAR8* $$(FORMAT_NAME)LanguageList[] = {"$$(SUPPORTED_LANGUAGES: =", ")", NULL}; >> $@
+<<KEEP
+ $(MAKE) EFI_SPECIFICATION_VERSION=0x2000A FORMAT_NAME=Rfc4646 -f $(BUILD_DIR)\LangList.mak
+!UNDEF _INCLUDE
+!UNDEF _IF
+!UNDEF _ENDIF
+!UNDEF _ERROR
+!UNDEF _MESSAGE
+
+SetupBin : $(AMIDXELIB)
+ $(SILENT)type << >$(BUILD_DIR)\SetupCallbackList.h
+#define SETUP_ITEM_CALLBACK_LIST $(SetupItemCallbacks)
+<<
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\
+ /f $(BUILD_DIR)\Setup.mak all\
+ GUID=899407D7-99FE-43d8-9A21-79EC328CAC21\
+ ENTRY_POINT=SetupEntry\
+ "MY_DEFINES=/DDEFAULT_LANGUAGE_CODE=$(DEFAULT_LANGUAGE)"\
+ TYPE=BS_DRIVER SDB_FILES=\
+ "VFR_PACKS=$(BUILD_DIR)\SetupStr.hpk $(VFR_PACKS)"\
+!IF $(CORE_COMBINED_VERSION)<262785
+ "VFR_INCLUDES=$(SETUP_VFR_INCLUDES)" COMPRESS=1\
+!ELSE
+ COMPRESS=1\
+!ENDIF
+ "EXT_HEADERS=$(SETUP_AUTO_GENERATED_FILES) $(BUILD_DIR)\TimeStamp.h $(BUILD_DIR)\token.h"\
+ "INIT_LIST=$(SetupStringInit)"
+
+$(BUILD_DIR)\Logo.ffs : $(LOGO_FILE_NAME)
+ $(MAKE) /f Core\FFS.mak \
+ BUILD_DIR=$(BUILD_DIR) \
+# Don't change the GUID. ChangeLogo expects this GUID.
+ GUID=7BB28B99-61BB-11D5-9A5D-0090273FC14D \
+ TYPE=EFI_FV_FILETYPE_FREEFORM \
+ BINFILE=$** FFSFILE=$@ COMPRESS=1 NAME=$(**B)
+
+
+
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#**********************************************************************
diff --git a/Board/EM/Setup/Setup.sdl b/Board/EM/Setup/Setup.sdl
new file mode 100644
index 0000000..c258687
--- /dev/null
+++ b/Board/EM/Setup/Setup.sdl
@@ -0,0 +1,129 @@
+TOKEN
+ Name = "Setup_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable Setup support in Project"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+End
+
+TOKEN
+ Name = "PASSWORD_MAX_SIZE"
+ Value = "20"
+ TokenType = Integer
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "PASSWORD_MAX_SIZE"
+ Value = "$(SETUP_PASSWORD_LENGTH)"
+ TokenType = Integer
+ TargetH = Yes
+ Token = "AMITSE_SUPPORT" "=" "1"
+End
+
+TOKEN
+ Name = "PASSWORD_MIN_SIZE"
+ Value = "3"
+ TokenType = Integer
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "FORCE_USER_TO_SETUP_ON_FIRST_BOOT"
+ Value = "0"
+ Help = "When this flag is on, Setup will be automatically launched\whenever NVRAM is blank (during the first boot and\during any subsequent flash update)."
+ TokenType = Boolean
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "SHOW_ADVANCED_FORMSET"
+ Value = "1"
+ TokenType = Boolean
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "SHOW_CHIPSET_FORMSET"
+ Value = "1"
+ TokenType = Boolean
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "SHOW_SECURITY_FORMSET"
+ Value = "1"
+ TokenType = Boolean
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "ALWAYS_PUBLISH_HII_RESOURCES"
+ Value = "0"
+ Help = "This token controls loading of the Setup related HII resources (setup screens and string).\If this token is cleared, setup resources are only published into HII database if the user enters setup.\If this token is set, setup resources are always published\Keep it off for speed optimization.\Set it to on if Runtime resources processing support is required (if ExportDatabase if used)"
+ TokenType = Boolean
+ TargetH = Yes
+End
+
+TOKEN
+ Name = "LOGO_FILE_NAME"
+ Value = "$(Setup_DIR)\Logo.bmp"
+ TokenType = Expression
+ TargetMAK = Yes
+End
+
+PATH
+ Name = "Setup_DIR"
+End
+
+MODULE
+ Help = "Includes Setup.mak to Project"
+ File = "Setup.mak"
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\Setup.ffs"
+ Parent = "FV_MAIN"
+ InvokeOrder = AfterParent
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\Logo.ffs"
+ Parent = "FV_MAIN"
+ InvokeOrder = AfterParent
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\$(Setup_DIR)"
+ Parent = "IFR_DIR_LIST"
+ InvokeOrder = AfterParent
+End
+
+ELINK
+ Name = "SETUP_DEFINITIONS"
+ InvokeOrder = ReplaceParent
+End
+
+ELINK
+ Name = "SETUP_SDBS"
+ InvokeOrder = ReplaceParent
+End
+
+ELINK
+ Name = "SetupStringInit"
+ InvokeOrder = ReplaceParent
+End
+
+ELINK
+ Name = "SETUP_VFR_INCLUDES"
+ InvokeOrder = ReplaceParent
+End
+
+ELINK
+ Name = "SetupItemCallbacks"
+ InvokeOrder = ReplaceParent
+End
+
diff --git a/Board/EM/Setup/Setup.uni b/Board/EM/Setup/Setup.uni
new file mode 100644
index 0000000..a5194a7
--- /dev/null
+++ b/Board/EM/Setup/Setup.uni
Binary files differ
diff --git a/Board/EM/Setup/SetupPrivate.h b/Board/EM/Setup/SetupPrivate.h
new file mode 100644
index 0000000..f2dbbcc
--- /dev/null
+++ b/Board/EM/Setup/SetupPrivate.h
@@ -0,0 +1,76 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Board/Setup/SetupPrivate.h 7 2/07/11 5:27p Artems $
+//
+// $Revision: 7 $
+//
+// $Date: 2/07/11 5:27p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/SetupPrivate.h $
+//
+// 7 2/07/11 5:27p Artems
+// EIP 53374: Replaced tabs with spaces
+//
+// 6 2/05/10 11:37a Felixp
+// include statements for AutoId.h is removed (the file is now included by
+// Setup.h).
+//
+// 5 6/30/09 11:42a Robert
+// Added Comment and updated parts for coding standards
+//
+// 4 7/14/05 3:55p Felixp
+// VFR.h removed
+//
+// 2 5/24/05 3:07p Felixp
+// Modular setup framework implemented
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SetupPrivate.h
+//
+// Description:
+// Internal header of the Setup Component
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SetupPrivate__H__
+#define __SetupPrivate__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <SetupStrTokens.h>
+#include <Setup.h>
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#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 **
+//** **
+//**********************************************************************
+//**********************************************************************