TianoCore EDK2 master
Loading...
Searching...
No Matches
PlatformConsole.c File Reference

Go to the source code of this file.

Macros

#define PCI_DEVICE_PATH_NODE(Func, Dev)
 
#define PNPID_DEVICE_PATH_NODE(PnpId)
 
#define gPnp16550ComPort    PNPID_DEVICE_PATH_NODE(0x0501)
 
#define gPnpPs2Keyboard    PNPID_DEVICE_PATH_NODE(0x0303)
 
#define gPcAnsiTerminal
 

Functions

EFI_STATUS PrepareLpcBridgeDevicePath (IN EFI_HANDLE DeviceHandle)
 
EFI_STATUS GetGopDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *PciDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **GopDevicePath)
 
EFI_STATUS PreparePciVgaDevicePath (IN EFI_HANDLE DeviceHandle)
 
EFI_STATUS EFIAPI VisitAllInstancesOfProtocol (IN EFI_GUID *Id, IN SIMPLE_PROTOCOL_INSTANCE_CALLBACK CallBackFunction)
 
EFI_STATUS EFIAPI DetectAndPreparePlatformPciDevicePath (IN EFI_HANDLE Handle, IN VOID *Instance)
 
EFI_STATUS EFIAPI AddDevicePathForOneSerialIoInstance (IN EFI_HANDLE Handle, IN VOID *Instance)
 
EFI_STATUS DetectAndPreparePlatformPciDevicePaths (BOOLEAN DetectDisplayOnly)
 
EFI_STATUS EFIAPI ConnectOneRootBridge (IN EFI_HANDLE Handle, IN VOID *Instance)
 
VOID EFIAPI PlatformConsoleInit (VOID)
 

Variables

ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard
 
ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort
 
VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal
 
BOOLEAN mDetectDisplayOnly
 

Detailed Description

This file include all platform action which can be customized by IBV/OEM.

Copyright (c) 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PlatformConsole.c.

Macro Definition Documentation

◆ gPcAnsiTerminal

#define gPcAnsiTerminal
Value:
{ \
{ \
MSG_VENDOR_DP, \
{ \
(UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
} \
}, \
DEVICE_PATH_MESSAGING_PC_ANSI \
}
#define MESSAGING_DEVICE_PATH
Definition: DevicePath.h:321

Definition at line 47 of file PlatformConsole.c.

◆ gPnp16550ComPort

#define gPnp16550ComPort    PNPID_DEVICE_PATH_NODE(0x0501)

Definition at line 41 of file PlatformConsole.c.

◆ gPnpPs2Keyboard

#define gPnpPs2Keyboard    PNPID_DEVICE_PATH_NODE(0x0303)

Definition at line 44 of file PlatformConsole.c.

◆ PCI_DEVICE_PATH_NODE

#define PCI_DEVICE_PATH_NODE (   Func,
  Dev 
)
Value:
{ \
{ \
{ \
(UINT8) (sizeof (PCI_DEVICE_PATH)), \
(UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \
} \
}, \
(Func), \
(Dev) \
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_PCI_DP
Definition: DevicePath.h:73

Definition at line 13 of file PlatformConsole.c.

◆ PNPID_DEVICE_PATH_NODE

#define PNPID_DEVICE_PATH_NODE (   PnpId)
Value:
{ \
{ \
{ \
(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
(UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
}, \
}, \
EISA_PNP_ID((PnpId)), \
0 \
}
#define ACPI_DEVICE_PATH
Definition: DevicePath.h:190
#define ACPI_DP
Definition: DevicePath.h:195

Definition at line 27 of file PlatformConsole.c.

Function Documentation

◆ AddDevicePathForOneSerialIoInstance()

EFI_STATUS EFIAPI AddDevicePathForOneSerialIoInstance ( IN EFI_HANDLE  Handle,
IN VOID *  Instance 
)

For every Serial Io instance, add it to ConOut, ConIn, ErrOut.

Parameters
[in]Handle- The Serial Io device handle
[in]Instance- The instance of the SerialIo protocol
Return values
EFI_STATUS- Callback function failed.

Definition at line 375 of file PlatformConsole.c.

◆ ConnectOneRootBridge()

EFI_STATUS EFIAPI ConnectOneRootBridge ( IN EFI_HANDLE  Handle,
IN VOID *  Instance 
)

The function will connect one root bridge

Parameters
[in]Handle- The root bridge handle
[in]Instance- The instance of the root bridge
Returns
EFI_SUCCESS Connect RootBridge successfully.

Definition at line 444 of file PlatformConsole.c.

◆ DetectAndPreparePlatformPciDevicePath()

EFI_STATUS EFIAPI DetectAndPreparePlatformPciDevicePath ( IN EFI_HANDLE  Handle,
IN VOID *  Instance 
)

Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut.

Parameters
[in]Handle- Handle of PCI device instance
[in]Instance- The instance of PCI device
Return values
EFI_SUCCESS- PCI Device check and Console variable update successfully.
EFI_STATUS- PCI Device check or Console variable update fail.

Definition at line 296 of file PlatformConsole.c.

◆ DetectAndPreparePlatformPciDevicePaths()

EFI_STATUS DetectAndPreparePlatformPciDevicePaths ( BOOLEAN  DetectDisplayOnly)

Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut

Parameters
[in]DetectDisplayOnly- Only detect display device if it's TRUE.
Return values
EFI_SUCCESS- PCI Device check and Console variable update successfully.
EFI_STATUS- PCI Device check or Console variable update fail.

Definition at line 407 of file PlatformConsole.c.

◆ GetGopDevicePath()

EFI_STATUS GetGopDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL PciDevicePath,
OUT EFI_DEVICE_PATH_PROTOCOL **  GopDevicePath 
)

Return the GOP device path in the platform.

Parameters
[in]PciDevicePath- Device path for the PCI graphics device.
[out]GopDevicePath- Return the device path with GOP installed.
Return values
EFI_SUCCESS- PCI VGA is added to ConOut.
EFI_INVALID_PARAMETER- The device path parameter is invalid.
EFI_STATUS- No GOP device found.

Definition at line 112 of file PlatformConsole.c.

◆ PlatformConsoleInit()

VOID EFIAPI PlatformConsoleInit ( VOID  )

Platform console init. Include the platform firmware vendor, revision and so crc check.

Definition at line 466 of file PlatformConsole.c.

◆ PrepareLpcBridgeDevicePath()

EFI_STATUS PrepareLpcBridgeDevicePath ( IN EFI_HANDLE  DeviceHandle)

Add IsaKeyboard to ConIn.

Parameters
[in]DeviceHandleHandle of the LPC Bridge device.
Return values
EFI_SUCCESSIsaKeyboard on the LPC bridge have been added to ConIn.
Returns
Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing from DeviceHandle.

Definition at line 76 of file PlatformConsole.c.

◆ PreparePciVgaDevicePath()

EFI_STATUS PreparePciVgaDevicePath ( IN EFI_HANDLE  DeviceHandle)

Add PCI VGA to ConOut, ConIn, ErrOut.

Parameters
[in]DeviceHandle- Handle of PciIo protocol.
Return values
EFI_SUCCESS- PCI VGA is added to ConOut.
EFI_STATUS- No PCI VGA device is added.

Definition at line 202 of file PlatformConsole.c.

◆ VisitAllInstancesOfProtocol()

EFI_STATUS EFIAPI VisitAllInstancesOfProtocol ( IN EFI_GUID Id,
IN SIMPLE_PROTOCOL_INSTANCE_CALLBACK  CallBackFunction 
)

For every PCI instance execute a callback function.

Parameters
[in]Id- The protocol GUID for callback
[in]CallBackFunction- The callback function
Return values
EFI_STATUS- Callback function failed.

Definition at line 239 of file PlatformConsole.c.

Variable Documentation

◆ gPnp16550ComPortDeviceNode

ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort

Definition at line 61 of file PlatformConsole.c.

◆ gPnpPs2KeyboardDeviceNode

ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard

Definition at line 60 of file PlatformConsole.c.

◆ gTerminalTypeDeviceNode

VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal

Definition at line 62 of file PlatformConsole.c.

◆ mDetectDisplayOnly

BOOLEAN mDetectDisplayOnly

Definition at line 64 of file PlatformConsole.c.