summaryrefslogtreecommitdiff
path: root/Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md
blob: 740bfb6db0c27bae7429066e09c4f9d421761daa (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
# Overview
* **Feature Name:** USB3 Debug
* **PI Phase(s) Supported:** PEI, DXE
* **SMM Required?** No

More Information:
* [USB 3.1 Device-Class Specification for Debug Devices](https://www.usb.org/sites/default/files/documents/usb_debug_class_rev_1_0_final_0.pdf)
* [Intel® UDK Debugger Tool](https://firmware.intel.com/develop/intel-uefi-tools-and-utilities/intel-uefi-development-kit-debugger-tool)
* [eXtensible Host Controller Interface for Universal Serial Bus (xHCI) Requirements Specification Rev. 1.2](https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf)

## Purpose
The USB3 Debug feature enables EDK II compliant firmware to use a USB3 port on the system for firmware debug. This is an
important capability in firmware development as debug options are often constrained in the later phases of
research and development. In many cases, dedicated debug ports are often removed from an end product, especially in
small form factor devices where external ports are at a premium.

This feature provides a firmware implementation that enables EDK II firmware debug compliant with the USB 3.1 Device
Class Specification for Debug Devices. The feature is intended to be used with the
[UEFI Development Kit Debugger Tool (Intel® UDK Debugger Tool)](https://firmware.intel.com/develop/intel-uefi-tools-and-utilities/intel-uefi-development-kit-debugger-tool).
The Intel® UDK Debugger Tool can be used in a Linux or Windows host environment to retrieve debug message output
and provide runtime debug control via GNU Project Debugger (GDB) or the Microsoft Windows Debug Tool (WinDbg)
respectively.

# High-Level Theory of Operation
*_TODO_*
A description of how the device works at a high-level.

The description should not be constrained to implementation details but provide a simple mental model of how the
feature is supposed to work.

## Firmware Volumes
Not applicable, the feature only produces libraries.

## Modules
* Usb3DebugPortLibDxe
* Usb3DebugPortLibDxeIoMmu
* Usb3DebugPortLibNull
* Usb3DebugPortLibPei
* Usb3DebugPortLibPeiIoMmu
* Usb3DebugPortParamLibPcd

## <Module Name>
*_TODO_*
Each module in the feature should have a section that describes the module in a level of detail that is useful
to better understand the module source code.

## <Library Name>
*_TODO_*
Each library in the feature should have a section that describes the library in a level of detail that is useful
to better understand the library source code.

## Key Functions
*_TODO_*
A bulleted list of key functions for interacting with the feature.

Not all features need to be listed. Only functions exposed through external interfaces that are important for feature
users to be aware of.

## Configuration
*_TODO_*
Information that is useful for configuring the feature.

Not all configuration options need to be listed. This section is used to provide more background on configuration
options than possible elsewhere.

## Data Flows
*_TODO_*
Architecturally defined data structures and flows for the feature.

## Control Flows
*_TODO_*
Key control flows for the feature.

## Build Flows
Supported build targets
* VS2019
* CLANGPDB
* GCC5

## Test Point Results
No test points implemented

## Functional Exit Criteria
*_TODO_*
The testable functionality for the feature.

This section should provide an ordered list of criteria that a board integrator can reference to ensure the feature is
functional on their board.

## Feature Enabling Checklist
* In the board DSC file, enable the feature
```
[PcdsFeatureFlag]
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable|TRUE
```
* In the board DSC file, select the implementation desired
```
[PcdsFixedAtBuild]
  # 0 = Non-functional instance
  # 1 = Regular instance
  # 2 = IO MMU instance
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
```
* In the board DSC file, configure the PCI device information
```
[PcdsFixedAtBuild]
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciBus|0x00
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciDev|0x14
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciFunc|0x00
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress|0xFEA10000
```


## Performance Impact
A general expectation for the impact on overall boot performance due to using this feature.

This section is expected to provide guidance on:
* How to estimate performance impact due to the feature
* How to measure performance impact of the feature
* How to manage performance impact of the feature

## Common Optimizations
* In the board DSC file, tune the timeout value
```
[PcdsFixedAtBuild]
  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout|2000000
```