#define gPnpPs2Keyboard \\r
PNPID_DEVICE_PATH_NODE(0x0303)\r
\r
-#define gUartVendor \\r
- { \\r
- { \\r
- HARDWARE_DEVICE_PATH, \\r
- HW_VENDOR_DP, \\r
- { \\r
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \\r
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \\r
- } \\r
- }, \\r
- EDKII_SERIAL_PORT_LIB_VENDOR_GUID \\r
- }\r
-\r
-#define gUart \\r
- { \\r
- { \\r
- MESSAGING_DEVICE_PATH, \\r
- MSG_UART_DP, \\r
- { \\r
- (UINT8) (sizeof (UART_DEVICE_PATH)), \\r
- (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \\r
- } \\r
- }, \\r
- 0, \\r
- 115200, \\r
- 8, \\r
- 1, \\r
- 1 \\r
- }\r
-\r
#define gPcAnsiTerminal \\r
{ \\r
{ \\r
\r
ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard;\r
ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort;\r
-UART_DEVICE_PATH gUartDeviceNode = gUart;\r
VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal;\r
-VENDOR_DEVICE_PATH gUartDeviceVendorNode = gUartVendor;\r
\r
//\r
// Predefined platform root bridge\r
BOOLEAN mDetectDisplayOnly;\r
\r
/**\r
- Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut.\r
+ Add IsaKeyboard to ConIn.\r
\r
@param[in] DeviceHandle Handle of the LPC Bridge device.\r
\r
- @retval EFI_SUCCESS Console devices on the LPC bridge have been added to\r
- ConOut, ConIn, and ErrOut.\r
-\r
+ @retval EFI_SUCCESS IsaKeyboard on the LPC bridge have been added to ConIn.\r
@return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing\r
from DeviceHandle.\r
**/\r
{\r
EFI_STATUS Status;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;\r
\r
DevicePath = NULL;\r
Status = gBS->HandleProtocol (\r
return Status;\r
}\r
\r
- TempDevicePath = DevicePath;\r
-\r
//\r
// Register Keyboard\r
//\r
DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode);\r
EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);\r
-\r
- //\r
- // Register COM1\r
- //\r
- DevicePath = TempDevicePath;\r
- DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode);\r
- DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);\r
- DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);\r
-\r
- EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);\r
- EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);\r
- EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);\r
-\r
return EFI_SUCCESS;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
-/**\r
- Add PCI Serial to ConOut, ConIn, ErrOut.\r
-\r
- @param[in] DeviceHandle - Handle of PciIo protocol.\r
-\r
- @retval EFI_SUCCESS - PCI Serial is added to ConOut, ConIn, and ErrOut.\r
- @retval EFI_STATUS - No PCI Serial device is added.\r
-\r
-**/\r
-EFI_STATUS\r
-PreparePciSerialDevicePath (\r
- IN EFI_HANDLE DeviceHandle\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
-\r
- DevicePath = NULL;\r
- Status = gBS->HandleProtocol (\r
- DeviceHandle,\r
- &gEfiDevicePathProtocolGuid,\r
- (VOID *)&DevicePath\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);\r
- DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);\r
-\r
- EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);\r
- EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);\r
- EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
/**\r
For every PCI instance execute a callback function.\r
\r
PrepareLpcBridgeDevicePath (Handle);\r
return EFI_SUCCESS;\r
}\r
-\r
- //\r
- // Here we decide which Serial device to enable in PCI bus\r
- //\r
- if (IS_PCI_16550SERIAL (&Pci)) {\r
- //\r
- // Add them to ConOut, ConIn, ErrOut.\r
- //\r
- DEBUG ((DEBUG_INFO, "Found PCI 16550 SERIAL device\n"));\r
- PreparePciSerialDevicePath (Handle);\r
- return EFI_SUCCESS;\r
- }\r
}\r
\r
//\r
return Status;\r
}\r
\r
+/**\r
+ For every Serial Io instance, add it to ConOut, ConIn, ErrOut.\r
+\r
+ @param[in] Handle - The Serial Io device handle\r
+ @param[in] Instance - The instance of the SerialIo protocol\r
+\r
+ @retval EFI_STATUS - Callback function failed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AddDevicePathForOneSerialIoInstance (\r
+ IN EFI_HANDLE Handle,\r
+ IN VOID *Instance\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+\r
+ DevicePath = NULL;\r
+ Status = gBS->HandleProtocol (\r
+ Handle,\r
+ &gEfiDevicePathProtocolGuid,\r
+ (VOID *)&DevicePath\r
+ );\r
+ DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);\r
+\r
+ EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);\r
+ EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);\r
+ EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);\r
+ return Status;\r
+}\r
+\r
/**\r
Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut\r
\r
NULL\r
);\r
\r
+ VisitAllInstancesOfProtocol (\r
+ &gEfiSerialIoProtocolGuid,\r
+ AddDevicePathForOneSerialIoInstance\r
+ );\r
+\r
Status = VisitAllInstancesOfProtocol (\r
&gEfiPciIoProtocolGuid,\r
DetectAndPreparePlatformPciDevicePath\r
VOID\r
)\r
{\r
- gUartDeviceNode.BaudRate = PcdGet64 (PcdUartDefaultBaudRate);\r
- gUartDeviceNode.DataBits = PcdGet8 (PcdUartDefaultDataBits);\r
- gUartDeviceNode.Parity = PcdGet8 (PcdUartDefaultParity);\r
- gUartDeviceNode.StopBits = PcdGet8 (PcdUartDefaultStopBits);\r
-\r
ConnectRootBridge ();\r
\r
//\r