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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//** **//
//** (C)Copyright 2009, American Megatrends, Inc. **//
//** **//
//** All Rights Reserved. **//
//** **//
//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
//** **//
//** Phone (770)-246-8600 **//
//** **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
// $Header: /Alaska/BIN/Modules/AMIDebugRx/binaries/PeiAMIDebugRx/INC/EHCI.h 2 7/17/09 7:15p Madhans $
//
// $Revision: 2 $
//
// $Date: 7/17/09 7:15p $
//*****************************************************************
//*****************************************************************
//
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/AMIDebugRx/binaries/PeiAMIDebugRx/INC/EHCI.h $
//
// 2 7/17/09 7:15p Madhans
// DebugRx 1.30.0022
//
// 2 7/13/09 2:49p Sudhirv
// Update with Coding Standards
//
// 1 7/07/09 4:46p Sudhirv
// Restructure Binaries Created
//
// 1 5/01/09 7:48p Madhans
// AMIDebug Rx Module. Intial Checkin.
//
// 1 4/29/09 7:52a Sudhirv
// AMI Debug Rx module created
//
// 5 6/13/07 3:16p Madhans
// Copyright Year updated.
//
// 4 3/13/07 4:08p Ashrafj
// !!!Coding standard!!!
//
// 3 1/22/07 11:41a Madhans
// Modification made for Binary Release 1.04.0003.
//
// 3 1/05/07 6:15p Madhan
//
// 2 1/05/07 1:05p Ashrafj
// Latest version 1.04.0001 Beta
// Known issues from previous 1.04.000 Beta release has been fixed.
//
//
//*****************************************************************
//**********************************************************************
//<AMI_FHDR_START>
//
// Name: ehci.h
//
// Description: EHCI controller related declarations and #defines.
//
//<AMI_FHDR_END>
//**********************************************************************
/*
USB Debug port resides in EHCI
Following is specific to chipset (ICH4,ICH5)
*/
#ifndef __EHCI_H__
#define __EHCI_H__
#define EHCI_BUS_NUMBER 0
#define EHCI_DEVICE_NUMBER 29
#define EHCI_FUNCTION_NUMBER 7
#define EHCI_CAPABILITY_REG 0x34
#define EHCI_POWERMGMT_CAP_REG 0x50 //ICH4 & ICH5(i875 MB)
#define EHCI_DEBUGPORT_CAP_REG 0x58 //ICH4 & ICH5(i875 MB)
#define ICH5_EHCI_BASE_ADDRESS_REGISTER 0x10
#define MEMORYMAP_BASE_ADDR 0xEFFFFFFF //4GB - 256MB
#define MEMORYMAP_WINDOW_SIZE 0x3FF //1 KB relocateble mem space (ICH4/5)
//
// Turn off the PWE assertion and put the device into D0 State
//
#define ICH5_PMCSR 0x8000
////////////////////////////////////////////////
#define ICH5_PCI_CAPABILITY_ID_PMI 0x01
#define ICH5_EHCI_COMMAND_REGISTER 0x04
#define DEBUG_PORT 0x0A
#define PORTSC_CURRENT_CONNECT_STATUS 1
#define PORTSC_CONNECT_STATUS_CHANGE 2
#define PORTSC_PORT_ENABLE 4
#define PORTSC_PORT_DISABLE 0xFFFFFFFB
#define PORTSC_PORT_RESET 0x100
#define PORTSC_PORT_NOT_RESET 0xFFFFFEFF
#define IN_PID 0x69
#define OUT_PID 0xE1
#define SETUP_PID 0x2D
#define DATA0 0xC3
#define DATA1 0x4B
#define ACK 0xD2
#define NAK 0x5A
#define STALL 0x1E
#define NYET 0x96
#define DEBUG_PORT_DESCRIPTOR_TYPE 0x0A
#define MAX_USBDEBUGPORT_DATASIZE 8
#pragma pack(1)
typedef struct _CAP_REG_LIST{
UINT8 CapID;
UINT8 Nxt_Ptr;
UINT16 Offset :13;
UINT16 BAR :3;
}CAP_REG_LIST;
typedef struct _DEBUG_PORT_CONTROL_REGISTER{
UINT32 DataLength : 4;
UINT32 WriteRead : 1;
UINT32 Go : 1;
UINT32 ErrorGood : 1;
UINT32 Exception : 3;
UINT32 InUse : 1;
UINT32 Reserved1 : 5;
UINT32 Done : 1;
UINT32 Reserved2 : 11;
UINT32 Enabled : 1;
UINT32 Reserved3 : 1;
UINT32 Owner : 1;
UINT32 Reserved4 : 1;
}DEBUG_PORT_CONTROL_REGISTER;
typedef struct _USB_PID{
UINT32 TokenPID : 8;
UINT32 SendPID : 8;
UINT32 RecievedPID : 8;
UINT32 Reserved : 8;
}USB_PID;
typedef struct _DATA_BUFFER{
UINT32 LowDword;
UINT32 HighDword;
}DATA_BUFFER;
typedef struct _DEVICE_ADDR_REGISTER{
UINT32 USBEndPoint : 4;
UINT32 Reserved1 : 4;
UINT32 USBAddress : 7;
UINT32 Reserved2 : 17;
}DEVICE_ADDR_REGISTER;
typedef struct _HCSPARAMS{
UINT32 N_PORTS : 4;
UINT32 PPC : 1;
UINT32 Resrvd : 2;
UINT32 PRR : 1;
UINT32 N_PCC : 4;
UINT32 N_CC : 4;
UINT32 P_INDICATOR : 1;
UINT32 Resrvd2 : 3;
UINT32 DebugPortNum : 4;
UINT32 Resrvd3 : 8;
}HCSPARAMS;
typedef struct _GET_DESCRIPTOR_DEBUG_PORT{
UINT8 bLength;
UINT8 bDescriptorType;
UINT8 bDebugInEndpoint;
UINT8 bDebugOutEndpoint;
}GET_DESCRIPTOR_DEBUG_PORT;
typedef struct _USB_CMD{
UINT32 RunStop : 1;
UINT32 HCRESET : 1;
UINT32 FLS : 2;
UINT32 PSE : 1;
UINT32 ASE : 1;
UINT32 IAAD : 1;
UINT32 LHCR : 1;
UINT32 ASPMC : 3;
UINT32 ASPME : 1;
UINT32 Resvd1 : 4;
UINT32 ITC : 8;
UINT32 Resvd2 : 8;
}USBCMD;
typedef struct _USB_STS{
UINT32 USBINTR : 1;
UINT32 USBERRINT : 1;
UINT32 PCD : 1;
UINT32 FLR : 1;
UINT32 HSE : 1;
UINT32 INTASYNC : 1;
UINT32 Resvd1 : 6;
UINT32 HCHalted : 1;
UINT32 Reclamation : 1;
UINT32 PSS : 1;
UINT32 ASS : 1;
UINT32 Resvd2 : 16;
}USBSTS;
typedef struct _CONFIG_FLAG{
UINT32 CF : 1;
UINT32 Reserved : 31;
}CONFIGFLAG, *PCONFIGFLAG;
typedef struct _OPERATIONAL_REGISTER{
USBCMD USBCommandReg;
USBSTS USBStatusReg;
}OPERATIONAL_REGISTER, *POPERATIONAL_REGISTER;
#pragma pack()
#endif // __EHCI_H__
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//** **//
//** (C)Copyright 2009, American Megatrends, Inc. **//
//** **//
//** All Rights Reserved. **//
//** **//
//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
//** **//
//** Phone (770)-246-8600 **//
//** **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
|