1
2
3
4
5
6
7
8
9#ifndef ASM_ARCH_PEI_DATA_H
10#define ASM_ARCH_PEI_DATA_H
11
12#include <linux/linkage.h>
13
14#define PEI_VERSION 22
15
16typedef void asmlinkage (*tx_byte_func)(unsigned char byte);
17
18enum board_type {
19 BOARD_TYPE_CRB_MOBILE = 0,
20 BOARD_TYPE_CRB_DESKTOP,
21 BOARD_TYPE_USER1,
22 BOARD_TYPE_USER2,
23 BOARD_TYPE_USER3,
24 BOARD_TYPE_ULT,
25 BOARD_TYPE_CRB_EMBDEDDED,
26 BOARD_TYPE_UNKNOWN,
27};
28
29#define MAX_USB2_PORTS 14
30#define MAX_USB3_PORTS 6
31#define USB_OC_PIN_SKIP 8
32
33enum usb2_port_location {
34 USB_PORT_BACK_PANEL = 0,
35 USB_PORT_FRONT_PANEL,
36 USB_PORT_DOCK,
37 USB_PORT_MINI_PCIE,
38 USB_PORT_FLEX,
39 USB_PORT_INTERNAL,
40 USB_PORT_SKIP,
41 USB_PORT_NGFF_DEVICE_DOWN,
42};
43
44struct usb2_port_setting {
45
46
47
48
49
50 uint16_t length;
51 uint8_t enable;
52 uint8_t oc_pin;
53 uint8_t location;
54} __packed;
55
56struct usb3_port_setting {
57 uint8_t enable;
58 uint8_t oc_pin;
59
60
61
62
63 uint8_t fixed_eq;
64} __packed;
65
66
67struct pei_data {
68 uint32_t pei_version;
69
70 enum board_type board_type;
71 int boot_mode;
72 int ec_present;
73 int usbdebug;
74
75
76 uint32_t pciexbar;
77 uint16_t smbusbar;
78 uint32_t xhcibar;
79 uint32_t ehcibar;
80 uint32_t gttbar;
81 uint32_t rcba;
82 uint32_t pmbase;
83 uint32_t gpiobase;
84 uint32_t temp_mmio_base;
85 uint32_t tseg_size;
86
87
88
89
90
91
92
93 int dimm_channel0_disabled;
94 int dimm_channel1_disabled;
95
96 uint8_t spd_addresses[4];
97
98 int ddr_refresh_2x;
99
100 int dq_pins_interleaved;
101
102 int max_ddr3_freq;
103
104 int disable_self_refresh;
105
106 int disable_cmd_pwr;
107
108
109 struct usb2_port_setting usb2_ports[MAX_USB2_PORTS];
110 struct usb3_port_setting usb3_ports[MAX_USB3_PORTS];
111
112
113
114
115
116
117 uint8_t usb3_txout_volt_dn_amp_adj[MAX_USB3_PORTS];
118
119 uint8_t usb3_txout_imp_sc_volt_amp_adj[MAX_USB3_PORTS];
120
121 uint8_t usb3_txout_de_emp_adj[MAX_USB3_PORTS];
122
123 uint8_t usb3_txout_imp_adj_volt_amp[MAX_USB3_PORTS];
124
125
126 tx_byte_func tx_byte;
127
128
129
130
131
132 uint8_t spd_data[2][2][512];
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153 uint8_t dq_map[2][6][2];
154
155
156
157
158
159 uint8_t dqs_map[2][8];
160
161
162 const void *saved_data;
163 int saved_data_size;
164
165
166 int disable_saved_data;
167
168
169 void *data_to_save;
170 int data_to_save_size;
171 struct pei_memory_info meminfo;
172} __packed;
173
174void mainboard_fill_pei_data(struct pei_data *pei_data);
175void broadwell_fill_pei_data(struct pei_data *pei_data);
176
177#endif
178