coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#ifndef _SOC_USB_H_
4
#define _SOC_USB_H_
5
6
#include <
stdint.h
>
7
8
/* Per Port HS Transmitter Emphasis */
9
#define USB2_EMP_OFF 0
10
#define USB2_DE_EMP_ON 1
11
#define USB2_PRE_EMP_ON 2
12
#define USB2_DE_EMP_ON_PRE_EMP_ON 3
13
14
/* Per Port Half Bit Pre-emphasis */
15
#define USB2_FULL_BIT_PRE_EMP 0
16
#define USB2_HALF_BIT_PRE_EMP 1
17
18
/* Per Port HS Preemphasis Bias */
19
#define USB2_BIAS_0MV 0
20
#define USB2_BIAS_11P25MV 1
21
#define USB2_BIAS_16P9MV 2
22
#define USB2_BIAS_28P15MV 3
23
#define USB2_BIAS_39P35MV 5
24
#define USB2_BIAS_45MV 6
25
#define USB2_BIAS_56P3MV 7
26
27
struct
usb2_port_config
{
28
uint8_t
enable
;
29
uint8_t
ocpin
;
30
uint8_t
tx_bias
;
31
uint8_t
tx_emp_enable
;
32
uint8_t
pre_emp_bias
;
33
uint8_t
pre_emp_bit
;
34
uint8_t
type_c
;
35
};
36
37
/* USB Overcurrent pins definition */
38
enum
{
39
OC0
= 0,
40
OC1
,
41
OC2
,
42
OC3
,
43
OC4
,
44
OC5
,
45
OC6
,
46
OC7
,
47
OCMAX
,
48
OC_SKIP
= 0xff,
/* Skip OC programming */
49
};
50
51
/* Standard USB Port based on length:
52
* - External
53
* - Back Panel
54
* - OTG
55
* - M.2
56
* - Internal device down */
57
58
#define USB2_PORT_EMPTY { \
59
.enable = 0, \
60
.ocpin = OC_SKIP, \
61
.tx_bias = USB2_BIAS_0MV, \
62
.tx_emp_enable = USB2_EMP_OFF, \
63
.pre_emp_bias = USB2_BIAS_0MV, \
64
.pre_emp_bit = USB2_HALF_BIT_PRE_EMP, \
65
}
66
67
/* Length = 11.5"-12" */
68
#define USB2_PORT_LONG(pin) { \
69
.enable = 1, \
70
.ocpin = (pin), \
71
.tx_bias = USB2_BIAS_39P35MV, \
72
.tx_emp_enable = USB2_PRE_EMP_ON, \
73
.pre_emp_bias = USB2_BIAS_56P3MV, \
74
.pre_emp_bit = USB2_HALF_BIT_PRE_EMP, \
75
}
76
77
/* Length = 6"-11.49" */
78
#define USB2_PORT_MID(pin) { \
79
.enable = 1, \
80
.ocpin = (pin), \
81
.tx_bias = USB2_BIAS_0MV, \
82
.tx_emp_enable = USB2_DE_EMP_ON_PRE_EMP_ON, \
83
.pre_emp_bias = USB2_BIAS_45MV, \
84
.pre_emp_bit = USB2_FULL_BIT_PRE_EMP, \
85
}
86
87
/* Length = 3"-5.99" */
88
#define USB2_PORT_SHORT(pin) { \
89
.enable = 1, \
90
.ocpin = (pin), \
91
.tx_bias = USB2_BIAS_39P35MV, \
92
.tx_emp_enable = USB2_PRE_EMP_ON | USB2_DE_EMP_ON, \
93
.pre_emp_bias = USB2_BIAS_39P35MV, \
94
.pre_emp_bit = USB2_FULL_BIT_PRE_EMP, \
95
}
96
97
/* Max TX and Pre-emp settings */
98
#define USB2_PORT_MAX(pin) { \
99
.enable = 1, \
100
.ocpin = (pin), \
101
.tx_bias = USB2_BIAS_56P3MV, \
102
.tx_emp_enable = USB2_PRE_EMP_ON, \
103
.pre_emp_bias = USB2_BIAS_56P3MV, \
104
.pre_emp_bit = USB2_HALF_BIT_PRE_EMP, \
105
}
106
107
/* Type-C Port, Max TX and Pre-emp settings */
108
#define USB2_PORT_MAX_TYPE_C(pin) { \
109
.enable = 1, \
110
.ocpin = (pin), \
111
.tx_bias = USB2_BIAS_56P3MV, \
112
.tx_emp_enable = USB2_PRE_EMP_ON, \
113
.pre_emp_bias = USB2_BIAS_56P3MV, \
114
.pre_emp_bit = USB2_HALF_BIT_PRE_EMP, \
115
.type_c = 1, \
116
}
117
118
/* Type-C Port, no BC1.2 charge detect module / MUX
119
* Length = 3.0" - 9.00" */
120
#define USB2_PORT_TYPE_C(pin) { \
121
.enable = 1, \
122
.ocpin = (pin), \
123
.tx_bias = USB2_BIAS_0MV, \
124
.tx_emp_enable = USB2_PRE_EMP_ON, \
125
.pre_emp_bias = USB2_BIAS_56P3MV, \
126
.pre_emp_bit = USB2_HALF_BIT_PRE_EMP, \
127
.type_c = 1, \
128
}
129
130
struct
usb3_port_config
{
131
uint8_t
enable
;
132
uint8_t
ocpin
;
133
uint8_t
tx_de_emp
;
134
uint8_t
tx_downscale_amp
;
135
};
136
137
#define USB3_PORT_EMPTY { \
138
.enable = 0, \
139
.ocpin = OC_SKIP, \
140
.tx_de_emp = 0x00, \
141
.tx_downscale_amp = 0x00, \
142
}
143
144
#define USB3_PORT_DEFAULT(pin) { \
145
.enable = 1, \
146
.ocpin = (pin), \
147
.tx_de_emp = 0x0, \
148
.tx_downscale_amp = 0x00, \
149
}
150
151
struct
tcss_port_config
{
152
uint8_t
enable
;
153
uint8_t
ocpin
;
154
};
155
156
#define TCSS_PORT_EMPTY { \
157
.enable = 0, \
158
.ocpin = OC_SKIP, \
159
}
160
161
#define TCSS_PORT_DEFAULT(pin) { \
162
.enable = 1, \
163
.ocpin = (pin), \
164
}
165
166
167
#endif
OC2
@ OC2
Definition:
usb.h:41
OC7
@ OC7
Definition:
usb.h:46
OC3
@ OC3
Definition:
usb.h:42
OC5
@ OC5
Definition:
usb.h:44
OCMAX
@ OCMAX
Definition:
usb.h:47
OC0
@ OC0
Definition:
usb.h:39
OC_SKIP
@ OC_SKIP
Definition:
usb.h:48
OC1
@ OC1
Definition:
usb.h:40
OC6
@ OC6
Definition:
usb.h:45
OC4
@ OC4
Definition:
usb.h:43
stdint.h
uint8_t
unsigned char uint8_t
Definition:
stdint.h:8
tcss_port_config
Definition:
usb.h:151
tcss_port_config::enable
uint8_t enable
Definition:
usb.h:152
tcss_port_config::ocpin
uint8_t ocpin
Definition:
usb.h:153
usb2_port_config
Definition:
usb.h:27
usb2_port_config::tx_bias
uint8_t tx_bias
Definition:
usb.h:30
usb2_port_config::type_c
uint8_t type_c
Definition:
usb.h:34
usb2_port_config::ocpin
uint8_t ocpin
Definition:
usb.h:29
usb2_port_config::pre_emp_bias
uint8_t pre_emp_bias
Definition:
usb.h:32
usb2_port_config::enable
uint8_t enable
Definition:
usb.h:28
usb2_port_config::pre_emp_bit
uint8_t pre_emp_bit
Definition:
usb.h:33
usb2_port_config::tx_emp_enable
uint8_t tx_emp_enable
Definition:
usb.h:31
usb3_port_config
Definition:
usb.h:130
usb3_port_config::ocpin
uint8_t ocpin
Definition:
usb.h:132
usb3_port_config::tx_downscale_amp
uint8_t tx_downscale_amp
Definition:
usb.h:134
usb3_port_config::tx_de_emp
uint8_t tx_de_emp
Definition:
usb.h:133
usb3_port_config::enable
uint8_t enable
Definition:
usb.h:131
src
soc
intel
alderlake
include
soc
usb.h
Generated by
1.9.1