summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-02-16 05:31:39 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-02-16 05:31:39 +0000
commit8e491a81e0d4c98fabb974ebc16c4cc77cc56eca (patch)
treeab4cbf6ad23d4c19920378640a4f2aa89406de67 /IntelFrameworkModulePkg
parentad0ecbcf79e6876c90b88d37830d21906ec8fafc (diff)
downloadedk2-platforms-8e491a81e0d4c98fabb974ebc16c4cc77cc56eca.tar.xz
Enhance BMM to support changing FlowControl setting in Front Page.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11317 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bmstring.unibin37906 -> 38742 bytes
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c3
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h9
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c87
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c13
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h1
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c28
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c2
8 files changed, 137 insertions, 6 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bmstring.uni b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bmstring.uni
index 3d75045a1f..00c1cc9cf9 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bmstring.uni
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bmstring.uni
Binary files differ
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
index 6e15e096a6..2cddb519df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
@@ -742,9 +742,10 @@ ApplyChangeHandler (
ASSERT (CurrentFakeNVMap->COMParity < (sizeof (ParityList) / sizeof (ParityList[0])));
NewTerminalContext->Parity = (UINT8) ParityList[CurrentFakeNVMap->COMParity].Value;
NewTerminalContext->TerminalType = CurrentFakeNVMap->COMTerminalType;
+ NewTerminalContext->FlowControl = CurrentFakeNVMap->COMFlowControl;
ChangeTerminalDevicePath (
- NewTerminalContext->DevicePath,
+ &(NewTerminalContext->DevicePath),
FALSE
);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
index 5b3da67d80..67eaeec011 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
@@ -196,6 +196,7 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define COM_STOP_BITS_VAR_OFFSET VAR_OFFSET (COMStopBits)
#define COM_PARITY_VAR_OFFSET VAR_OFFSET (COMParity)
#define COM_TERMINAL_VAR_OFFSET VAR_OFFSET (COMTerminalType)
+#define COM_FLOWCONTROL_VAR_OFFSET VAR_OFFSET (COMFlowControl)
#define LEGACY_FD_VAR_OFFSET VAR_OFFSET (LegacyFD)
#define LEGACY_HD_VAR_OFFSET VAR_OFFSET (LegacyHD)
#define LEGACY_CD_VAR_OFFSET VAR_OFFSET (LegacyCD)
@@ -233,6 +234,7 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define COM_STOP_BITS_QUESTION_ID QUESTION_ID (COMStopBits)
#define COM_PARITY_QUESTION_ID QUESTION_ID (COMParity)
#define COM_TERMINAL_QUESTION_ID QUESTION_ID (COMTerminalType)
+#define COM_FLOWCONTROL_QUESTION_ID QUESTION_ID (COMFlowControl)
#define LEGACY_FD_QUESTION_ID QUESTION_ID (LegacyFD)
#define LEGACY_HD_QUESTION_ID QUESTION_ID (LegacyHD)
#define LEGACY_CD_QUESTION_ID QUESTION_ID (LegacyCD)
@@ -283,6 +285,8 @@ typedef struct {
UINT8 ParityIndex;
UINT8 StopBitsIndex;
+ UINT8 FlowControl;
+
UINT8 IsConIn;
UINT8 IsConOut;
UINT8 IsStdErr;
@@ -757,7 +761,7 @@ ChangeVariableDevicePath (
**/
EFI_STATUS
ChangeTerminalDevicePath (
- IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
IN BOOLEAN ChangeTerminal
);
@@ -1563,7 +1567,8 @@ extern STRING_DEPOSITORY *DriverOptionHelpStrDepository;
extern STRING_DEPOSITORY *TerminalStrDepository;
extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
extern EFI_GUID EfiLegacyDevOrderGuid;
-
+extern UINT16 mFlowControlType[2];
+extern UINT32 mFlowControlValue[2];
//
// Shared IFR form update data
//
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
index 9d32c380fb..ed42304c2b 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
@@ -14,6 +14,37 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "BootMaint.h"
+UART_FLOW_CONTROL_DEVICE_PATH mFlowControlDevicePath =
+{
+ MESSAGING_DEVICE_PATH,
+ MSG_VENDOR_DP,
+ (UINT8)(sizeof(UART_FLOW_CONTROL_DEVICE_PATH)),
+ (UINT8)((sizeof(UART_FLOW_CONTROL_DEVICE_PATH)) >> 8),
+ DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL,
+ UART_FLOW_CONTROL_HARDWARE
+};
+
+/**
+ Check the device path node whether it's the Flow Control node or not.
+
+ @param[in] FlowControl The device path node to be checked.
+
+ @retval TRUE It's the Flow Control node.
+ @retval FALSE It's not.
+
+**/
+BOOLEAN
+IsUartFlowControlNode (
+ IN UART_FLOW_CONTROL_DEVICE_PATH *FlowControl
+ )
+{
+ return (BOOLEAN) (
+ (DevicePathType (FlowControl) == MESSAGING_DEVICE_PATH) &&
+ (DevicePathSubType (FlowControl) == MSG_VENDOR_DP) &&
+ (CompareGuid (&FlowControl->Guid, &gEfiUartDevicePathGuid))
+ );
+}
+
/**
Check whether the device path node is ISA Serial Node.
@@ -62,7 +93,7 @@ UpdateComAttributeFromVariable (
**/
EFI_STATUS
ChangeTerminalDevicePath (
- IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
IN BOOLEAN ChangeTerminal
)
{
@@ -74,8 +105,9 @@ ChangeTerminalDevicePath (
UINTN Com;
BM_TERMINAL_CONTEXT *NewTerminalContext;
BM_MENU_ENTRY *NewMenuEntry;
+ UART_FLOW_CONTROL_DEVICE_PATH *FlowControlNode;
- Node = DevicePath;
+ Node = *DevicePath;
Node = NextDevicePathNode (Node);
Com = 0;
while (!IsDevicePathEnd (Node)) {
@@ -112,6 +144,23 @@ ChangeTerminalDevicePath (
&NewTerminalContext->StopBits,
sizeof (UINT8)
);
+
+ FlowControlNode = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (Node);
+ if (IsUartFlowControlNode (FlowControlNode)) {
+ FlowControlNode->FlowControlMap = NewTerminalContext->FlowControl;
+ } else {
+ //
+ // Append the Flow control device node when user enable flow control.
+ //
+ if (NewTerminalContext->FlowControl != 0) {
+ mFlowControlDevicePath.FlowControlMap = NewTerminalContext->FlowControl;
+ *DevicePath = AppendDevicePathNode (
+ *DevicePath,
+ (EFI_DEVICE_PATH_PROTOCOL *) (&mFlowControlDevicePath)
+ );
+ }
+ }
+
//
// Change the device path in the ComPort
//
@@ -372,6 +421,7 @@ LocateSerialIo (
BM_TERMINAL_CONTEXT *NewTerminalContext;
EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
VENDOR_DEVICE_PATH Vendor;
+ UINT32 FlowControl;
//
// Get all handles that have SerialIo protocol installed
//
@@ -470,6 +520,13 @@ LocateSerialIo (
&SerialIo->Mode->StopBits,
sizeof (UINT8)
);
+
+ NewTerminalContext->FlowControl = 0;
+ SerialIo->GetControl(SerialIo, &FlowControl);
+ if ((FlowControl & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) != 0) {
+ NewTerminalContext->FlowControl = UART_FLOW_CONTROL_HARDWARE;
+ }
+
InsertTailList (&TerminalMenu.Head, &NewMenuEntry->Link);
TerminalMenu.MenuNumber++;
}
@@ -570,7 +627,10 @@ UpdateComAttributeFromVariable (
BM_MENU_ENTRY *NewMenuEntry;
BM_TERMINAL_CONTEXT *NewTerminalContext;
UINTN Index;
+ UART_FLOW_CONTROL_DEVICE_PATH *FlowControlNode;
+ BOOLEAN HasFlowControlNode;
+ HasFlowControlNode = FALSE;
Node = DevicePath;
Node = NextDevicePathNode (Node);
TerminalNumber = 0;
@@ -613,6 +673,17 @@ UpdateComAttributeFromVariable (
sizeof (UINT8)
);
+ FlowControlNode = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (Node);
+ if (IsUartFlowControlNode (FlowControlNode)) {
+ HasFlowControlNode = TRUE;
+ NewTerminalContext->FlowControl = (UINT8) ReadUnaligned32 (&FlowControlNode->FlowControlMap);
+ } else if (NewTerminalContext->FlowControl != 0) {
+ //
+ // No Flow Control device path node, assumption no Flow control
+ //
+ NewTerminalContext->FlowControl = 0;
+ }
+
SerialNode = NewTerminalContext->DevicePath;
SerialNode = NextDevicePathNode (SerialNode);
while (!IsDevicePathEnd (SerialNode)) {
@@ -644,6 +715,18 @@ UpdateComAttributeFromVariable (
sizeof (UINT8)
);
+ FlowControlNode = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (SerialNode);
+ if (IsUartFlowControlNode (FlowControlNode)) {
+ FlowControlNode->FlowControlMap = NewTerminalContext->FlowControl;
+ } else {
+ if (HasFlowControlNode) {
+ mFlowControlDevicePath.FlowControlMap = NewTerminalContext->FlowControl;
+ NewTerminalContext->DevicePath = AppendDevicePathNode (
+ NewTerminalContext->DevicePath,
+ (EFI_DEVICE_PATH_PROTOCOL *) (&mFlowControlDevicePath)
+ );
+ }
+ }
break;
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c
index b4d33d035b..0a3ffbcc30 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c
@@ -38,6 +38,19 @@ UINT16 TerminalType[] = {
};
///
+/// Flow Control type string token storage
+///
+UINT16 mFlowControlType[2] = {
+ STRING_TOKEN(STR_NONE_FLOW_CONTROL),
+ STRING_TOKEN(STR_HARDWARE_FLOW_CONTROL)
+};
+
+UINT32 mFlowControlValue[2] = {
+ 0,
+ UART_FLOW_CONTROL_HARDWARE
+};
+
+///
/// File system selection menu
///
BM_MENU_OPTION FsOptionMenu = {
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
index 71c59762d7..d55981ca20 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
@@ -165,6 +165,7 @@ typedef struct {
UINT8 COMStopBits;
UINT8 COMParity;
UINT8 COMTerminalType;
+ UINT8 COMFlowControl;
//
// Legacy Device Order Selection Storage
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
index aaa3360042..ece88524cb 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
@@ -1077,6 +1077,34 @@ UpdateTerminalPage (
);
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
+
+ CallbackData->BmmFakeNvData.COMFlowControl = NewTerminalContext->FlowControl;
+ for (Index = 0; Index < sizeof (mFlowControlType) / sizeof (mFlowControlType[0]); Index++) {
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ (EFI_STRING_ID) mFlowControlType[Index],
+ 0,
+ EFI_IFR_TYPE_NUM_SIZE_8,
+ mFlowControlValue[Index]
+ );
+ }
+
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
+ (EFI_QUESTION_ID) COM_FLOWCONTROL_QUESTION_ID,
+ VARSTORE_ID_BOOT_MAINT,
+ COM_FLOWCONTROL_VAR_OFFSET,
+ STRING_TOKEN (STR_COM_FLOW_CONTROL),
+ STRING_TOKEN (STR_COM_FLOW_CONTROL),
+ 0,
+ EFI_IFR_NUMERIC_SIZE_1,
+ OptionsOpCodeHandle,
+ NULL
+ );
+
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
UpdatePageEnd (CallbackData);
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
index 579036fff3..cf5d295c84 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
@@ -449,7 +449,7 @@ Var_UpdateConsoleOption (
(EFI_DEVICE_PATH_PROTOCOL *) &Vendor
);
ASSERT (TerminalDevicePath != NULL);
- ChangeTerminalDevicePath (TerminalDevicePath, TRUE);
+ ChangeTerminalDevicePath (&TerminalDevicePath, TRUE);
ConDevicePath = AppendDevicePathInstance (
ConDevicePath,
TerminalDevicePath