3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 Definitions and prototypes for DebugPort driver
20 #ifndef __DEBUGPORT_H__
21 #define __DEBUGPORT_H__
25 // local type definitions
27 #define DEBUGPORT_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('D', 'B', 'G', 'P')
30 // Device structure used by driver
34 EFI_HANDLE DriverBindingHandle
;
35 EFI_HANDLE DebugPortDeviceHandle
;
36 VOID
*DebugPortVariable
;
38 EFI_DRIVER_BINDING_PROTOCOL DriverBindingInterface
;
39 EFI_COMPONENT_NAME_PROTOCOL ComponentNameInterface
;
40 EFI_DEVICE_PATH_PROTOCOL
*DebugPortDevicePath
;
41 EFI_DEBUGPORT_PROTOCOL DebugPortInterface
;
43 EFI_HANDLE SerialIoDeviceHandle
;
44 EFI_SERIAL_IO_PROTOCOL
*SerialIoBinding
;
46 UINT32 ReceiveFifoDepth
;
48 EFI_PARITY_TYPE Parity
;
50 EFI_STOP_BITS_TYPE StopBits
;
53 #define DEBUGPORT_DEVICE_FROM_THIS(a) CR (a, DEBUGPORT_DEVICE, DebugPortInterface, DEBUGPORT_DEVICE_SIGNATURE)
55 #define EFI_ACPI_PC_COMPORT_HID EISA_PNP_ID (0x0500)
56 #define EFI_ACPI_16550UART_HID EISA_PNP_ID (0x0501)
58 #define DEBUGPORT_UART_DEFAULT_BAUDRATE 115200
59 #define DEBUGPORT_UART_DEFAULT_PARITY 0
60 #define DEBUGPORT_UART_DEFAULT_FIFO_DEPTH 16
61 #define DEBUGPORT_UART_DEFAULT_TIMEOUT 50000 // 5 ms
62 #define DEBUGPORT_UART_DEFAULT_DATA_BITS 8
63 #define DEBUGPORT_UART_DEFAULT_STOP_BITS 1
65 #define DEBUGPORT_DRIVER_VERSION 1
67 #define EfiIsUartDevicePath(dp) (DevicePathType (dp) == MESSAGING_DEVICE_PATH && DevicePathSubType (dp) == MSG_UART_DP)
72 extern DEBUGPORT_DEVICE
*gDebugPortDevice
;
75 // Driver binding interface functions...
79 IN EFI_HANDLE ImageHandle
,
80 IN EFI_SYSTEM_TABLE
*SystemTable
87 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
88 IN EFI_HANDLE Controller
,
89 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
96 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
97 IN EFI_HANDLE Controller
,
98 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
105 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
106 IN EFI_HANDLE Controller
,
107 IN UINTN NumberOfChildren
,
108 IN EFI_HANDLE
*ChildHandleBuffer
113 // EFI Component Name Functions
117 DebugPortComponentNameGetDriverName (
118 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
120 OUT CHAR16
**DriverName
126 DebugPortComponentNameGetControllerName (
127 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
128 IN EFI_HANDLE ControllerHandle
,
129 IN EFI_HANDLE ChildHandle OPTIONAL
,
131 OUT CHAR16
**ControllerName
136 // DebugPort member functions
141 IN EFI_DEBUGPORT_PROTOCOL
*This
148 IN EFI_DEBUGPORT_PROTOCOL
*This
,
150 IN OUT UINTN
*BufferSize
,
158 IN EFI_DEBUGPORT_PROTOCOL
*This
,
160 IN OUT UINTN
*BufferSize
,
168 IN EFI_DEBUGPORT_PROTOCOL
*This