summaryrefslogtreecommitdiff
path: root/Include/AmiDebugPort.h
blob: 7f0a25c81ad6973c93b88413f0a77faa8834c837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2006, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/DEBUGGER/Include/AmiDebugPort.h 7     10/30/07 10:49a Madhans $
//
// $Revision: 7 $
//
// $Date: 10/30/07 10:49a $
//**********************************************************************
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/DEBUGGER/Include/AmiDebugPort.h $
// 
// 7     10/30/07 10:49a Madhans
// 1.20.0010 Eng Release
// 
// 3     1/22/07 11:35a Madhans
// Modification made for Binary Release 1.04.0003.
// 
// 3     1/05/07 1:05p Ashrafj
// Latest version 1.04.0001 Beta
// Known issues from previous 1.04.000 Beta release has been fixed.
// 
//**********************************************************************
//*****************************************************************
#ifndef	_AMI_DEBUGPORT_H_
#define _AMI_DEBUGPORT_H_

#include "Hob.h"
#include "Protocol\PciRootBridgeIo.h"
#include "PciBus.h"					//For Defn, of PCI_CFG_ADDR


// {E894B313-54CA-4bb2-8CDD-851E8AC9027C}
#define	AMI_DEBUGPORT_HOB_GUID \
 {0xe894b313, 0x54ca, 0x4bb2, 0x8c, 0xdd, 0x85, 0x1e, 0x8a, 0xc9, 0x2, 0x7c}

typedef enum {
	SERIAL,
	USB2_EHCI,		//currently only intel chipset has USB2 debug port on EHCI
	USB2_UHCI,		//for future chipset if any is going to support USB2 debug port
	USB2_OHCI,		//for future chipset if any is going to support USB2 debug port
	LPT,
	SMBUS_TO_USB
}DEBUGPORT_TYPE;

typedef struct _DEBUG_PORT_INFO 
{ 
    DEBUGPORT_TYPE		DebugPortType;	//Type of physical Port used for communication
    UINT64				BaseAddress;    //BAR address 
    UINT64				Length;         //Size of relocateable window size 
    UINT16				IRQn;           //IRQ number 
	UINT8				BarOffset; 		//offset of this bar register in PCI_CFG space 
	UINT8				BarIndex;		//Index from 0 to 5 of the the BAR 
    PCI_CFG_ADDR		Address;        //PCI configuration address like B,D,F for USB 
										//or Logical Device number in case Serial 
	PCI_BAR_TYPE		BarType;		//Type Of Resource (MMIO32/MMIO64/pfMMIO32/pfMMIO64/Io16/Io32)
										//Offset=0x10 => Index=0;
										//Offset=0x14 => Index=1;
										//And soo on
} DEBUG_PORT_INFO; 

typedef	struct _AMI_DEBUGPORT_INFORMATION_HOB AMI_DEBUGPORT_INFORMATION_HOB;	//forward declaration

typedef EFI_STATUS (* GET_DEBUGPORT_PROPERTIES ) ( 
					IN AMI_DEBUGPORT_INFORMATION_HOB *This,
					IN OUT DEBUG_PORT_INFO *pDeviceInfo 
					);

typedef EFI_STATUS (* SET_DEBUGPORT_RESOURCES) (
					IN AMI_DEBUGPORT_INFORMATION_HOB *This,
					IN EFI_BOOT_SERVICES *pBS,												
					IN DEBUG_PORT_INFO  *pDeviceInfo 
					); 

typedef  struct _AMI_DEBUGPORT_INFORMATION_HOB 
{ 
	EFI_HOB_GUID_TYPE			EfiHobGuidType;
	DEBUG_PORT_INFO				DeviceInfo; 

	GET_DEBUGPORT_PROPERTIES	GetDebugPortProperties;

	SET_DEBUGPORT_RESOURCES		SetDebugPortResources;

	UINT64						Reserved;		//For PEI Debug support - do not use
} 
AMI_DEBUGPORT_INFORMATION_HOB; 

typedef union	_PEI_DBG_PORT_INFO	PEI_DBG_PORT_INFO;
typedef EFI_STATUS (PEI_INIT_FUNCTION) (IN OUT PEI_DBG_PORT_INFO   *DebugPort);

typedef struct _PEI_DBG_COM_PORT{
	UINT16				COMBaseAddr;
	UINT8				SIO_COM_LDN;
}PEI_DBG_COM_PORT;

typedef struct _PEI_DBG_USB_PORT{
	UINT32				USBBaseAddr;
	UINT32				USBDebugPortStartAddr;
	UINT16				MemoryMappedIoSpaceSize;
	UINT8				PciBusNumber;
	UINT8				PciDeviceNumber;
	UINT8				PciFunctionNumber;
	UINT8				PciBAROffset;
	PEI_INIT_FUNCTION	*InitUSBEHCI;
}PEI_DBG_USB_PORT;

typedef union _PEI_DBG_PORT_INFO{
	PEI_DBG_COM_PORT	SerialPort;
	PEI_DBG_USB_PORT	UsbDebugPort;
}PEI_DBG_PORT_INFO;

#endif


//****************************************************************
//****************************************************************
//**															**
//**	(C)Copyright 1985-2006, American Megatrends Inc.		**
//**															**
//**			All Rights Reserved.							**
//**															**
//**		6145-F, Northbelt Parkway, Norcross,				**
//**															**
//**		Georgia - 30071, USA. Phone-(770)-246-8600.			**
//**															**
//****************************************************************
//****************************************************************