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