1285431Szbb/*-
2285431Szbb********************************************************************************
3285431SzbbCopyright (C) 2015 Annapurna Labs Ltd.
4285431Szbb
5285431SzbbThis file may be licensed under the terms of the Annapurna Labs Commercial
6285431SzbbLicense Agreement.
7285431Szbb
8285431SzbbAlternatively, this file can be distributed under the terms of the GNU General
9285431SzbbPublic License V2 as published by the Free Software Foundation and can be
10285431Szbbfound at http://www.gnu.org/licenses/gpl-2.0.html
11285431Szbb
12285431SzbbAlternatively, redistribution and use in source and binary forms, with or
13285431Szbbwithout modification, are permitted provided that the following conditions are
14285431Szbbmet:
15285431Szbb
16285431Szbb    *     Redistributions of source code must retain the above copyright notice,
17285431Szbbthis list of conditions and the following disclaimer.
18285431Szbb
19285431Szbb    *     Redistributions in binary form must reproduce the above copyright
20285431Szbbnotice, this list of conditions and the following disclaimer in
21285431Szbbthe documentation and/or other materials provided with the
22285431Szbbdistribution.
23285431Szbb
24285431SzbbTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25285431SzbbANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26285431SzbbWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27285431SzbbDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
28285431SzbbANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29285431Szbb(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30285431SzbbLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31285431SzbbANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32285431Szbb(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33285431SzbbSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34285431Szbb
35285431Szbb*******************************************************************************/
36285431Szbb
37285431Szbb
38285431Szbb#ifndef __AL_HAL_PCIE_W_REG_H__
39285431Szbb#define __AL_HAL_PCIE_W_REG_H__
40285431Szbb
41285431Szbb#ifdef __cplusplus
42285431Szbbextern "C" {
43285431Szbb#endif
44285431Szbb/*
45285431Szbb* Unit Registers
46285431Szbb*/
47285431Szbb
48285431Szbb
49285431Szbb
50285431Szbbstruct al_pcie_rev1_w_global_ctrl {
51285431Szbb	/* [0x0]  */
52285431Szbb	uint32_t port_init;
53285431Szbb	/* [0x4]  */
54285431Szbb	uint32_t port_status;
55285431Szbb	/* [0x8]  */
56285431Szbb	uint32_t pm_control;
57285431Szbb	uint32_t rsrvd_0;
58285431Szbb	/* [0x10]  */
59285431Szbb	uint32_t events_gen;
60285431Szbb	uint32_t rsrvd[3];
61285431Szbb};
62285431Szbbstruct al_pcie_rev2_w_global_ctrl {
63285431Szbb	/* [0x0]  */
64285431Szbb	uint32_t port_init;
65285431Szbb	/* [0x4]  */
66285431Szbb	uint32_t port_status;
67285431Szbb	/* [0x8]  */
68285431Szbb	uint32_t pm_control;
69285431Szbb	uint32_t rsrvd_0;
70285431Szbb	/* [0x10]  */
71285431Szbb	uint32_t events_gen;
72285431Szbb	/* [0x14]  */
73285431Szbb	uint32_t pended_corr_err_sts_int;
74285431Szbb	/* [0x18]  */
75285431Szbb	uint32_t pended_uncorr_err_sts_int;
76285431Szbb	/* [0x1c]  */
77285431Szbb	uint32_t sris_kp_counter_value;
78285431Szbb};
79285431Szbbstruct al_pcie_rev3_w_global_ctrl {
80285431Szbb	/* [0x0]  */
81285431Szbb	uint32_t port_init;
82285431Szbb	/* [0x4]  */
83285431Szbb	uint32_t port_status;
84285431Szbb	/* [0x8]  */
85285431Szbb	uint32_t pm_control;
86285431Szbb	/* [0xc]  */
87285431Szbb	uint32_t pended_corr_err_sts_int;
88285431Szbb	/* [0x10]  */
89285431Szbb	uint32_t pended_uncorr_err_sts_int;
90285431Szbb	/* [0x14]  */
91285431Szbb	uint32_t sris_kp_counter_value;
92285431Szbb	uint32_t rsrvd[2];
93285431Szbb};
94285431Szbb
95285431Szbbstruct al_pcie_rev3_w_events_gen_per_func {
96285431Szbb	/* [0x0]  */
97285431Szbb	uint32_t events_gen;
98285431Szbb};
99285431Szbbstruct al_pcie_rev3_w_pm_state_per_func {
100285431Szbb	/* [0x0]  */
101285431Szbb	uint32_t pm_state_per_func;
102285431Szbb};
103285431Szbbstruct al_pcie_rev3_w_cfg_bars_ovrd {
104285431Szbb	/* [0x0]  */
105285431Szbb	uint32_t bar0_mask_lsb;
106285431Szbb	/* [0x4]  */
107285431Szbb	uint32_t bar0_mask_msb;
108285431Szbb	/* [0x8]  */
109285431Szbb	uint32_t bar0_limit_lsb;
110285431Szbb	/* [0xc]  */
111285431Szbb	uint32_t bar0_limit_msb;
112285431Szbb	/* [0x10]  */
113285431Szbb	uint32_t bar0_start_lsb;
114285431Szbb	/* [0x14]  */
115285431Szbb	uint32_t bar0_start_msb;
116285431Szbb	/* [0x18]  */
117285431Szbb	uint32_t bar0_ctrl;
118285431Szbb	/* [0x1c]  */
119285431Szbb	uint32_t bar1_mask_lsb;
120285431Szbb	/* [0x20]  */
121285431Szbb	uint32_t bar1_mask_msb;
122285431Szbb	/* [0x24]  */
123285431Szbb	uint32_t bar1_limit_lsb;
124285431Szbb	/* [0x28]  */
125285431Szbb	uint32_t bar1_limit_msb;
126285431Szbb	/* [0x2c]  */
127285431Szbb	uint32_t bar1_start_lsb;
128285431Szbb	/* [0x30]  */
129285431Szbb	uint32_t bar1_start_msb;
130285431Szbb	/* [0x34]  */
131285431Szbb	uint32_t bar1_ctrl;
132285431Szbb	/* [0x38]  */
133285431Szbb	uint32_t bar2_mask_lsb;
134285431Szbb	/* [0x3c]  */
135285431Szbb	uint32_t bar2_mask_msb;
136285431Szbb	/* [0x40]  */
137285431Szbb	uint32_t bar2_limit_lsb;
138285431Szbb	/* [0x44]  */
139285431Szbb	uint32_t bar2_limit_msb;
140285431Szbb	/* [0x48]  */
141285431Szbb	uint32_t bar2_start_lsb;
142285431Szbb	/* [0x4c]  */
143285431Szbb	uint32_t bar2_start_msb;
144285431Szbb	/* [0x50]  */
145285431Szbb	uint32_t bar2_ctrl;
146285431Szbb	/* [0x54]  */
147285431Szbb	uint32_t bar3_mask_lsb;
148285431Szbb	/* [0x58]  */
149285431Szbb	uint32_t bar3_mask_msb;
150285431Szbb	/* [0x5c]  */
151285431Szbb	uint32_t bar3_limit_lsb;
152285431Szbb	/* [0x60]  */
153285431Szbb	uint32_t bar3_limit_msb;
154285431Szbb	/* [0x64]  */
155285431Szbb	uint32_t bar3_start_lsb;
156285431Szbb	/* [0x68]  */
157285431Szbb	uint32_t bar3_start_msb;
158285431Szbb	/* [0x6c]  */
159285431Szbb	uint32_t bar3_ctrl;
160285431Szbb	/* [0x70]  */
161285431Szbb	uint32_t bar4_mask_lsb;
162285431Szbb	/* [0x74]  */
163285431Szbb	uint32_t bar4_mask_msb;
164285431Szbb	/* [0x78]  */
165285431Szbb	uint32_t bar4_limit_lsb;
166285431Szbb	/* [0x7c]  */
167285431Szbb	uint32_t bar4_limit_msb;
168285431Szbb	/* [0x80]  */
169285431Szbb	uint32_t bar4_start_lsb;
170285431Szbb	/* [0x84]  */
171285431Szbb	uint32_t bar4_start_msb;
172285431Szbb	/* [0x88]  */
173285431Szbb	uint32_t bar4_ctrl;
174285431Szbb	/* [0x8c]  */
175285431Szbb	uint32_t bar5_mask_lsb;
176285431Szbb	/* [0x90]  */
177285431Szbb	uint32_t bar5_mask_msb;
178285431Szbb	/* [0x94]  */
179285431Szbb	uint32_t bar5_limit_lsb;
180285431Szbb	/* [0x98]  */
181285431Szbb	uint32_t bar5_limit_msb;
182285431Szbb	/* [0x9c]  */
183285431Szbb	uint32_t bar5_start_lsb;
184285431Szbb	/* [0xa0]  */
185285431Szbb	uint32_t bar5_start_msb;
186285431Szbb	/* [0xa4]  */
187285431Szbb	uint32_t bar5_ctrl;
188285431Szbb	uint32_t rsrvd[2];
189285431Szbb};
190285431Szbb
191285431Szbbstruct al_pcie_revx_w_debug {
192285431Szbb	/* [0x0]  */
193285431Szbb	uint32_t info_0;
194285431Szbb	/* [0x4]  */
195285431Szbb	uint32_t info_1;
196285431Szbb	/* [0x8]  */
197285431Szbb	uint32_t info_2;
198285431Szbb	/* [0xc]  */
199285431Szbb	uint32_t info_3;
200285431Szbb};
201285431Szbbstruct al_pcie_revx_w_ob_ven_msg {
202285431Szbb	/* [0x0]  */
203285431Szbb	uint32_t control;
204285431Szbb	/* [0x4]  */
205285431Szbb	uint32_t param_1;
206285431Szbb	/* [0x8]  */
207285431Szbb	uint32_t param_2;
208285431Szbb	/* [0xc]  */
209285431Szbb	uint32_t data_high;
210285431Szbb	uint32_t rsrvd_0;
211285431Szbb	/* [0x14]  */
212285431Szbb	uint32_t data_low;
213285431Szbb};
214285431Szbbstruct al_pcie_revx_w_ap_user_send_msg {
215285431Szbb	/* [0x0]  */
216285431Szbb	uint32_t req_info;
217285431Szbb	/* [0x4]  */
218285431Szbb	uint32_t ack_info;
219285431Szbb};
220285431Szbbstruct al_pcie_revx_w_link_down {
221285431Szbb	/* [0x0]  */
222285431Szbb	uint32_t reset_delay;
223285431Szbb	/* [0x4]  */
224285431Szbb	uint32_t reset_extend_rsrvd;
225285431Szbb};
226285431Szbbstruct al_pcie_revx_w_cntl_gen {
227285431Szbb	/* [0x0]  */
228285431Szbb	uint32_t features;
229285431Szbb};
230285431Szbbstruct al_pcie_revx_w_parity {
231285431Szbb	/* [0x0]  */
232285431Szbb	uint32_t en_core;
233285431Szbb	/* [0x4]  */
234285431Szbb	uint32_t status_core;
235285431Szbb};
236285431Szbbstruct al_pcie_revx_w_last_wr {
237285431Szbb	/* [0x0]  */
238285431Szbb	uint32_t cfg_addr;
239285431Szbb};
240285431Szbbstruct al_pcie_rev1_2_w_atu {
241285431Szbb	/* [0x0]  */
242285431Szbb	uint32_t in_mask_pair[6];
243285431Szbb	/* [0x18]  */
244285431Szbb	uint32_t out_mask_pair[6];
245285431Szbb};
246285431Szbbstruct al_pcie_rev3_w_atu {
247285431Szbb	/* [0x0]  */
248285431Szbb	uint32_t in_mask_pair[12];
249285431Szbb	/* [0x30]  */
250285431Szbb	uint32_t out_mask_pair[8];
251285431Szbb	/* [0x50] */
252285431Szbb	uint32_t reg_out_mask;
253285431Szbb	uint32_t rsrvd[11];
254285431Szbb};
255285431Szbbstruct al_pcie_rev3_w_cfg_func_ext {
256285431Szbb	/* [0x0]  */
257285431Szbb	uint32_t cfg;
258285431Szbb};
259285431Szbbstruct al_pcie_rev3_w_app_hdr_interface_send {
260285431Szbb	/* [0x0]  */
261285431Szbb	uint32_t app_hdr_31_0;
262285431Szbb	/* [0x4]  */
263285431Szbb	uint32_t app_hdr_63_32;
264285431Szbb	/* [0x8]  */
265285431Szbb	uint32_t app_hdr_95_64;
266285431Szbb	/* [0xc]  */
267285431Szbb	uint32_t app_hdr_127_96;
268285431Szbb	/* [0x10]  */
269285431Szbb	uint32_t app_err_bus;
270285431Szbb	/* [0x14]  */
271285431Szbb	uint32_t app_func_num_advisory;
272285431Szbb	/* [0x18]  */
273285431Szbb	uint32_t app_hdr_cmd;
274285431Szbb};
275285431Szbbstruct al_pcie_rev3_w_diag_command {
276285431Szbb	/* [0x0]  */
277285431Szbb	uint32_t diag_ctrl;
278285431Szbb};
279285431Szbbstruct al_pcie_rev1_w_soc_int {
280285431Szbb	/* [0x0]  */
281285431Szbb	uint32_t status_0;
282285431Szbb	/* [0x4]  */
283285431Szbb	uint32_t status_1;
284285431Szbb	/* [0x8]  */
285285431Szbb	uint32_t status_2;
286285431Szbb	/* [0xc]  */
287285431Szbb	uint32_t mask_inta_leg_0;
288285431Szbb	/* [0x10]  */
289285431Szbb	uint32_t mask_inta_leg_1;
290285431Szbb	/* [0x14]  */
291285431Szbb	uint32_t mask_inta_leg_2;
292285431Szbb	/* [0x18]  */
293285431Szbb	uint32_t mask_msi_leg_0;
294285431Szbb	/* [0x1c]  */
295285431Szbb	uint32_t mask_msi_leg_1;
296285431Szbb	/* [0x20]  */
297285431Szbb	uint32_t mask_msi_leg_2;
298285431Szbb	/* [0x24]  */
299285431Szbb	uint32_t msi_leg_cntl;
300285431Szbb};
301285431Szbbstruct al_pcie_rev2_w_soc_int {
302285431Szbb	/* [0x0]  */
303285431Szbb	uint32_t status_0;
304285431Szbb	/* [0x4]  */
305285431Szbb	uint32_t status_1;
306285431Szbb	/* [0x8]  */
307285431Szbb	uint32_t status_2;
308285431Szbb	/* [0xc]  */
309285431Szbb	uint32_t status_3;
310285431Szbb	/* [0x10]  */
311285431Szbb	uint32_t mask_inta_leg_0;
312285431Szbb	/* [0x14]  */
313285431Szbb	uint32_t mask_inta_leg_1;
314285431Szbb	/* [0x18]  */
315285431Szbb	uint32_t mask_inta_leg_2;
316285431Szbb	/* [0x1c]  */
317285431Szbb	uint32_t mask_inta_leg_3;
318285431Szbb	/* [0x20]  */
319285431Szbb	uint32_t mask_msi_leg_0;
320285431Szbb	/* [0x24]  */
321285431Szbb	uint32_t mask_msi_leg_1;
322285431Szbb	/* [0x28]  */
323285431Szbb	uint32_t mask_msi_leg_2;
324285431Szbb	/* [0x2c]  */
325285431Szbb	uint32_t mask_msi_leg_3;
326285431Szbb	/* [0x30]  */
327285431Szbb	uint32_t msi_leg_cntl;
328285431Szbb};
329285431Szbbstruct al_pcie_rev3_w_soc_int_per_func {
330285431Szbb	/* [0x0]  */
331285431Szbb	uint32_t status_0;
332285431Szbb	/* [0x4]  */
333285431Szbb	uint32_t status_1;
334285431Szbb	/* [0x8]  */
335285431Szbb	uint32_t status_2;
336285431Szbb	/* [0xc]  */
337285431Szbb	uint32_t status_3;
338285431Szbb	/* [0x10]  */
339285431Szbb	uint32_t mask_inta_leg_0;
340285431Szbb	/* [0x14]  */
341285431Szbb	uint32_t mask_inta_leg_1;
342285431Szbb	/* [0x18]  */
343285431Szbb	uint32_t mask_inta_leg_2;
344285431Szbb	/* [0x1c]  */
345285431Szbb	uint32_t mask_inta_leg_3;
346285431Szbb	/* [0x20]  */
347285431Szbb	uint32_t mask_msi_leg_0;
348285431Szbb	/* [0x24]  */
349285431Szbb	uint32_t mask_msi_leg_1;
350285431Szbb	/* [0x28]  */
351285431Szbb	uint32_t mask_msi_leg_2;
352285431Szbb	/* [0x2c]  */
353285431Szbb	uint32_t mask_msi_leg_3;
354285431Szbb	/* [0x30]  */
355285431Szbb	uint32_t msi_leg_cntl;
356285431Szbb};
357285431Szbb
358285431Szbbstruct al_pcie_revx_w_ap_err {
359285431Szbb	/*
360285431Szbb	 * [0x0] latch the header in case of any error occur in the core, read
361285431Szbb	 * on clear of the last register in the bind.
362285431Szbb	 */
363285431Szbb	uint32_t hdr_log;
364285431Szbb};
365285431Szbbstruct al_pcie_revx_w_status_per_func {
366285431Szbb	/*
367285431Szbb	 * [0x0] latch the header in case of any error occure in the core, read
368285431Szbb	 * on clear of the last register in the bind.
369285431Szbb	 */
370285431Szbb	uint32_t status_per_func;
371285431Szbb};
372285431Szbbstruct al_pcie_revx_w_int_grp {
373285431Szbb	/*
374285431Szbb	 * [0x0] Interrupt Cause Register
375285431Szbb	 * Set by hardware
376285431Szbb	 * - If MSI-X is enabled and auto_clear control bit =TRUE, automatically
377285431Szbb	 * cleared after MSI-X message associated with this specific interrupt
378285431Szbb	 * bit is sent (MSI-X acknowledge is received).
379285431Szbb	 * - Software can set a bit in this register by writing 1 to the
380285431Szbb	 * associated bit in the Interrupt Cause Set register
381285431Szbb	 * Write-0 clears a bit. Write-1 has no effect.
382285431Szbb	 * - On CPU Read - If clear_on_read control bit =TRUE, automatically
383285431Szbb	 * cleared (all bits are cleared).
384285431Szbb	 * When there is a conflict and on the same clock cycle, hardware tries
385285431Szbb	 * to set a bit in the Interrupt Cause register, the specific bit is set
386285431Szbb	 * to ensure the interrupt indication is not lost.
387285431Szbb	 */
388285431Szbb	uint32_t cause;
389285431Szbb	uint32_t rsrvd_0;
390285431Szbb	/*
391285431Szbb	 * [0x8] Interrupt Cause Set Register
392285431Szbb	 * Writing 1 to a bit in this register sets its corresponding cause bit,
393285431Szbb	 * enabling software to generate a hardware interrupt. Write 0 has no
394285431Szbb	 * effect.
395285431Szbb	 */
396285431Szbb	uint32_t cause_set;
397285431Szbb	uint32_t rsrvd_1;
398285431Szbb	/*
399285431Szbb	 * [0x10] Interrupt Mask Register
400285431Szbb	 * If Auto-mask control bit =TRUE, automatically set to 1 after MSI-X
401285431Szbb	 * message associatd with the associated interrupt bit is sent (AXI
402285431Szbb	 * write acknowledge is received).
403285431Szbb	 */
404285431Szbb	uint32_t mask;
405285431Szbb	uint32_t rsrvd_2;
406285431Szbb	/*
407285431Szbb	 * [0x18] Interrupt Mask Clear Register
408285431Szbb	 * Used when auto-mask control bit=True. Enables CPU to clear a specific
409285431Szbb	 * bit. It prevents a scenario in which the CPU overrides another bit
410285431Szbb	 * with 1 (old value) that hardware has just cleared to 0.
411285431Szbb	 * Write 0 to this register clears its corresponding mask bit. Write 1
412285431Szbb	 * has no effect.
413285431Szbb	 */
414285431Szbb	uint32_t mask_clear;
415285431Szbb	uint32_t rsrvd_3;
416285431Szbb	/*
417285431Szbb	 * [0x20] Interrupt Status Register
418285431Szbb	 * This register latches the status of the interrupt source.
419285431Szbb	 */
420285431Szbb	uint32_t status;
421285431Szbb	uint32_t rsrvd_4;
422285431Szbb	/* [0x28] Interrupt Control Register */
423285431Szbb	uint32_t control;
424285431Szbb	uint32_t rsrvd_5;
425285431Szbb	/*
426285431Szbb	 * [0x30] Interrupt Mask Register
427285431Szbb	 * Each bit in this register masks the corresponding cause bit for
428285431Szbb	 * generating an Abort signal. Its default value is determined by unit
429285431Szbb	 * instantiation.
430285431Szbb	 * (Abort = Wire-OR of Cause & !Interrupt_Abort_Mask)
431285431Szbb	 * This register provides error handling configuration for error
432285431Szbb	 * interrupts
433285431Szbb	 */
434285431Szbb	uint32_t abort_mask;
435285431Szbb	uint32_t rsrvd_6;
436285431Szbb	/*
437285431Szbb	 * [0x38] Interrupt Log Register
438285431Szbb	 * Each bit in this register masks the corresponding cause bit for
439285431Szbb	 * capturing the log registers. Its default value is determined by unit
440285431Szbb	 * instantiation.
441285431Szbb	 * (Log_capture = Wire-OR of Cause & !Interrupt_Log_Mask)
442285431Szbb	 * This register provides error handling configuration for error
443285431Szbb	 * interrupts.
444285431Szbb	 */
445285431Szbb	uint32_t log_mask;
446285431Szbb	uint32_t rsrvd;
447285431Szbb};
448285431Szbb
449285431Szbbstruct al_pcie_rev1_w_regs {
450285431Szbb	struct al_pcie_rev1_w_global_ctrl global_ctrl;     /* [0x0] */
451285431Szbb	uint32_t rsrvd_0[24];
452285431Szbb	struct al_pcie_revx_w_debug debug;                     /* [0x80] */
453285431Szbb	struct al_pcie_revx_w_ob_ven_msg ob_ven_msg; /* [0x90] */
454285431Szbb	uint32_t rsrvd_1[86];
455285431Szbb	struct al_pcie_rev1_w_soc_int soc_int;                 /* [0x200] */
456285431Szbb	struct al_pcie_revx_w_link_down link_down;             /* [0x228] */
457285431Szbb	struct al_pcie_revx_w_cntl_gen ctrl_gen;               /* [0x230] */
458285431Szbb	struct al_pcie_revx_w_parity parity;                   /* [0x234] */
459285431Szbb	struct al_pcie_revx_w_last_wr last_wr;                 /* [0x23c] */
460285431Szbb	struct al_pcie_rev1_2_w_atu atu;                         /* [0x240] */
461285431Szbb	uint32_t rsrvd_2[36];
462285431Szbb	struct al_pcie_revx_w_int_grp int_grp_a_m0; /* [0x300] */
463285431Szbb	struct al_pcie_revx_w_int_grp int_grp_b_m0; /* [0x340] */
464285431Szbb	uint32_t rsrvd_3[32];
465285431Szbb	struct al_pcie_revx_w_int_grp int_grp_a; /* [0x400] */
466285431Szbb	struct al_pcie_revx_w_int_grp int_grp_b; /* [0x440] */
467285431Szbb};
468285431Szbb
469285431Szbbstruct al_pcie_rev2_w_regs {
470285431Szbb	struct al_pcie_rev2_w_global_ctrl global_ctrl;     /* [0x0] */
471285431Szbb	uint32_t rsrvd_0[24];
472285431Szbb	struct al_pcie_revx_w_debug debug;                     /* [0x80] */
473285431Szbb	struct al_pcie_revx_w_ob_ven_msg ob_ven_msg; /* [0x90] */
474285431Szbb	struct al_pcie_revx_w_ap_user_send_msg ap_user_send_msg; /* [0xa8] */
475285431Szbb	uint32_t rsrvd_1[20];
476285431Szbb	struct al_pcie_rev2_w_soc_int soc_int;                 /* [0x100] */
477285431Szbb	uint32_t rsrvd_2[61];
478285431Szbb	struct al_pcie_revx_w_link_down link_down;             /* [0x228] */
479285431Szbb	struct al_pcie_revx_w_cntl_gen ctrl_gen;               /* [0x230] */
480285431Szbb	struct al_pcie_revx_w_parity parity;                   /* [0x234] */
481285431Szbb	struct al_pcie_revx_w_last_wr last_wr;                 /* [0x23c] */
482285431Szbb	struct al_pcie_rev1_2_w_atu atu;                         /* [0x240] */
483285431Szbb	uint32_t rsrvd_3[6];
484285431Szbb	struct al_pcie_revx_w_ap_err ap_err[4];             /* [0x288] */
485285431Szbb	uint32_t rsrvd_4[26];
486285431Szbb	struct al_pcie_revx_w_status_per_func status_per_func; /* [0x300] */
487285431Szbb	uint32_t rsrvd_5[63];
488285431Szbb	struct al_pcie_revx_w_int_grp int_grp_a; /* [0x400] */
489285431Szbb	struct al_pcie_revx_w_int_grp int_grp_b; /* [0x440] */
490285431Szbb};
491285431Szbb
492285431Szbbstruct al_pcie_rev3_w_regs {
493285431Szbb	struct al_pcie_rev3_w_global_ctrl global_ctrl;     /* [0x0] */
494285431Szbb	uint32_t rsrvd_0[24];
495285431Szbb	struct al_pcie_revx_w_debug debug;                     /* [0x80] */
496285431Szbb	struct al_pcie_revx_w_ob_ven_msg ob_ven_msg; /* [0x90] */
497285431Szbb	struct al_pcie_revx_w_ap_user_send_msg ap_user_send_msg; /* [0xa8] */
498285431Szbb	uint32_t rsrvd_1[94];
499285431Szbb	struct al_pcie_revx_w_link_down link_down;             /* [0x228] */
500285431Szbb	struct al_pcie_revx_w_cntl_gen ctrl_gen;               /* [0x230] */
501285431Szbb	struct al_pcie_revx_w_parity parity;                   /* [0x234] */
502285431Szbb	struct al_pcie_revx_w_last_wr last_wr;                 /* [0x23c] */
503285431Szbb	struct al_pcie_rev3_w_atu atu;                         /* [0x240] */
504285431Szbb	uint32_t rsrvd_2[8];
505285431Szbb	struct al_pcie_rev3_w_cfg_func_ext cfg_func_ext;    /* [0x2e0] */
506285431Szbb	struct al_pcie_rev3_w_app_hdr_interface_send app_hdr_interface_send;/* [0x2e4] */
507285431Szbb	struct al_pcie_rev3_w_diag_command diag_command;    /* [0x300] */
508285431Szbb	uint32_t rsrvd_3[3];
509285431Szbb	struct al_pcie_rev3_w_soc_int_per_func soc_int_per_func[REV3_MAX_NUM_OF_PFS]; /* [0x310] */
510285431Szbb	uint32_t rsrvd_4[44];
511285431Szbb	struct al_pcie_rev3_w_events_gen_per_func events_gen_per_func[REV3_MAX_NUM_OF_PFS]; /* [0x490] */
512285431Szbb	uint32_t rsrvd_5[4];
513285431Szbb	struct al_pcie_rev3_w_pm_state_per_func pm_state_per_func[REV3_MAX_NUM_OF_PFS];/* [0x4b0] */
514285431Szbb	uint32_t rsrvd_6[16];
515285431Szbb	struct al_pcie_rev3_w_cfg_bars_ovrd cfg_bars_ovrd[REV3_MAX_NUM_OF_PFS]; /* [0x500] */
516285431Szbb	uint32_t rsrvd_7[176];
517285431Szbb	uint32_t rsrvd_8[16];
518285431Szbb	struct al_pcie_revx_w_ap_err ap_err[5]; /* [0xac0] */
519285431Szbb	uint32_t rsrvd_9[11];
520285431Szbb	struct al_pcie_revx_w_status_per_func status_per_func[4]; /* [0xb00] */
521285431Szbb	uint32_t rsrvd_10[316];
522285431Szbb	struct al_pcie_revx_w_int_grp int_grp_a; /* [0x1000] */
523285431Szbb	struct al_pcie_revx_w_int_grp int_grp_b; /* [0x1040] */
524285431Szbb	struct al_pcie_revx_w_int_grp int_grp_c; /* [0x1080] */
525285431Szbb	struct al_pcie_revx_w_int_grp int_grp_d; /* [0x10c0] */
526285431Szbb};
527285431Szbb
528285431Szbb/*
529285431Szbb* Registers Fields
530285431Szbb*/
531285431Szbb
532285431Szbb
533285431Szbb/**** Port_Init register ****/
534285431Szbb/* Enable port to start LTSSM Link Training */
535285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_APP_LTSSM_EN_MASK (1 << 0)
536285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_APP_LTSSM_EN_SHIFT (0)
537285431Szbb/*
538285431Szbb * Device Type
539285431Szbb * Indicates the specific type of this PCIe Function. It is also used to set the
540285431Szbb * Device/Port Type field.
541285431Szbb * 4'b0000: PCIe Endpoint
542285431Szbb * 4'b0001: Legacy PCIe Endpoint
543285431Szbb * 4'b0100: Root Port of PCIe Root Complex
544285431Szbb * Must be programmed before link training sequence. According to the reset
545285431Szbb * strap
546285431Szbb */
547285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_DEVICE_TYPE_MASK 0x000000F0
548285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_DEVICE_TYPE_SHIFT 4
549285431Szbb/*
550285431Szbb * Performs Manual Lane reversal for transmit Lanes.
551285431Szbb * Must be programmed before link training sequence.
552285431Szbb */
553285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_TX_LANE_FLIP_EN (1 << 8)
554285431Szbb/*
555285431Szbb * Performs Manual Lane reversal for receive Lanes.
556285431Szbb * Must be programmed before link training sequence.
557285431Szbb */
558285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_RX_LANE_FLIP_EN (1 << 9)
559285431Szbb/*
560285431Szbb * Auxiliary Power Detected
561285431Szbb * Indicates that auxiliary power (Vaux) is present. This one move to reset
562285431Szbb * strap from
563285431Szbb */
564285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_INIT_SYS_AUX_PWR_DET_NOT_USE (1 << 10)
565285431Szbb
566285431Szbb/**** Port_Status register ****/
567285431Szbb/* PHY Link up/down indicator */
568285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PHY_LINK_UP (1 << 0)
569285431Szbb/*
570285431Szbb * Data Link Layer up/down indicator
571285431Szbb * This status from the Flow Control Initialization State Machine indicates that
572285431Szbb * Flow Control has been initiated and the Data Link Layer is ready to transmit
573285431Szbb * and receive packets.
574285431Szbb */
575285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_DL_LINK_UP (1 << 1)
576285431Szbb/* Reset request due to link down status. */
577285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_LINK_REQ_RST (1 << 2)
578285431Szbb/* Power management is in L0s state.. */
579285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_IN_L0S (1 << 3)
580285431Szbb/* Power management is in L1 state. */
581285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_IN_L1 (1 << 4)
582285431Szbb/* Power management is in L2 state. */
583285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_IN_L2 (1 << 5)
584285431Szbb/* Power management is exiting L2 state. */
585285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_LINKST_L2_EXIT (1 << 6)
586285431Szbb/* Power state of the device. */
587285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_DSTATE_MASK 0x00000380
588285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_PM_DSTATE_SHIFT 7
589285431Szbb/* tie to zero. */
590285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_XMLH_IN_RL0S (1 << 10)
591285431Szbb/* Timeout count before flush */
592285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_LINK_TOUT_FLUSH_NOT (1 << 11)
593285431Szbb/* Segmentation buffer not empty  */
594285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_RADM_Q_NOT_EMPTY (1 << 12)
595285431Szbb/*
596285431Szbb * Clock Turnoff Request
597285431Szbb * Allows clock generation module to turn off core_clk based on the current
598285431Szbb * power management state:
599285431Szbb * 0: core_clk is required to be active for the current power state.
600285431Szbb * 1: The current power state allows core_clk to be shut down.
601285431Szbb * This does not indicate the clock requirement for the PHY.
602285431Szbb */
603285431Szbb#define PCIE_W_GLOBAL_CTRL_PORT_STS_CORE_CLK_REQ_N (1 << 31)
604285431Szbb
605285431Szbb/**** PM_Control register ****/
606285431Szbb/*
607285431Szbb * Wake Up. Used by application logic to wake up the PMC state machine from a
608285431Szbb * D1, D2, or D3 power state. EP mode only. Change the value from 0 to 1 to send
609285431Szbb * the message. Per function the upper bits are not use for ocie core less than
610285431Szbb * 8 functions
611285431Szbb */
612285431Szbb#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_PM_XMT_PME (1 << 0)
613285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_PM_XMT_PME_FUNC_MASK 0x000000FF
614285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_PM_XMT_PME_FUNC_SHIFT 0
615285431Szbb/*
616285431Szbb * Request to Enter ASPM L1.
617285431Szbb * The core ignores the L1 entry request on app_req_entr_l1 when it is busy
618285431Szbb * processing a transaction.
619285431Szbb */
620285431Szbb#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_REQ_ENTR_L1 (1 << 3)
621285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_REQ_ENTR_L1 (1 << 8)
622285431Szbb/*
623285431Szbb * Request to exit ASPM L1.
624285431Szbb * Only effective if L1 is enabled.
625285431Szbb */
626285431Szbb#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_REQ_EXIT_L1 (1 << 4)
627285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_REQ_EXIT_L1 (1 << 9)
628285431Szbb/*
629285431Szbb * Indication that component is ready to enter the L23 state. The core delays
630285431Szbb * sending PM_Enter_L23 (in response to PM_Turn_Off) until this signal becomes
631285431Szbb * active.
632285431Szbb * EP mode
633285431Szbb */
634285431Szbb#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_READY_ENTR_L23 (1 << 5)
635285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_READY_ENTR_L23 (1 << 10)
636285431Szbb/*
637285431Szbb * Request to generate a PM_Turn_Off Message to communicate transition to L2/L3
638285431Szbb * Ready state to downstream components. Host must wait PM_Turn_Off_Ack messages
639285431Szbb * acceptance RC mode.
640285431Szbb */
641285431Szbb#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_PM_XMT_TURNOFF (1 << 6)
642285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_PM_XMT_TURNOFF (1 << 11)
643285431Szbb/*
644285431Szbb * Provides a capability to defer incoming Configuration Requests until
645285431Szbb * initialization is complete. When app_req_retry_en is asserted, the core
646285431Szbb * completes incoming Configuration Requests with a Configuration Request Retry
647285431Szbb * Status. Other incoming Requests complete with Unsupported Request status.
648285431Szbb */
649285431Szbb#define PCIE_W_REV1_2_GLOBAL_CTRL_PM_CONTROL_APP_REQ_RETRY_EN (1 << 7)
650285431Szbb#define PCIE_W_REV3_GLOBAL_CTRL_PM_CONTROL_APP_REQ_RETRY_EN (1 << 12)
651285431Szbb/*
652285431Szbb * Core core gate enable
653285431Szbb * If set, core_clk is gated off whenever a clock turnoff request allows the
654285431Szbb * clock generation module to turn off core_clk (Port_Status.core_clk_req_n
655285431Szbb * field), and the PHY supports a request to disable clock gating. If not, the
656285431Szbb * core clock turns off in P2 mode in any case (PIPE).
657285431Szbb */
658285431Szbb#define PCIE_W_GLOBAL_CTRL_PM_CONTROL_CORE_CLK_GATE (1 << 31)
659285431Szbb
660285431Szbb/**** sris_kp_counter_value register ****/
661285431Szbb/* skp counter when SRIS disable */
662285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_NO_SRIS_MASK 0x000001FF
663285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_NO_SRIS_SHIFT 0
664285431Szbb/* skp counter when SRIS enable */
665285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_SRIS_MASK 0x0003FE00
666285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN3_SRIS_SHIFT 9
667285431Szbb/* skp counter when SRIS enable for gen3 */
668285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN21_SRIS_MASK 0x1FFC0000
669285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_GEN21_SRIS_SHIFT 18
670285431Szbb/* mask the interrupt to the soc in case correctable error occur in the ARI.  */
671285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_RSRVD_MASK 0x60000000
672285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_RSRVD_SHIFT 29
673285431Szbb/* not in use in the pcie_x8 core. */
674285431Szbb#define PCIE_W_GLOBAL_CTRL_SRIS_KP_COUNTER_VALUE_PCIE_X4_SRIS_EN (1 << 31)
675285431Szbb
676285431Szbb/**** Events_Gen register ****/
677285431Szbb/* INT_D. Not supported  */
678285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTD (1 << 0)
679285431Szbb/* INT_C. Not supported  */
680285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTC (1 << 1)
681285431Szbb/* INT_B. Not supported  */
682285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTB (1 << 2)
683285431Szbb/* Transmit INT_A Interrupt ControlEvery transition from 0 to 1  ... */
684285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTA (1 << 3)
685285431Szbb/* A request to generate an outbound MSI interrupt when MSI is e ... */
686285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_TRNS_REQ (1 << 4)
687285431Szbb/* Set the MSI vector before issuing msi_trans_req. */
688285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_MASK 0x000003E0
689285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_SHIFT 5
690285431Szbb/* The application requests hot reset to a downstream device */
691285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_APP_RST_INIT (1 << 10)
692285431Szbb/* The application request unlock message to be sent */
693285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_UNLOCK_GEN (1 << 30)
694285431Szbb/* Indicates that FLR on a Physical Function has been completed */
695285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_FLR_PF_DONE (1 << 31)
696285431Szbb
697285431Szbb/**** Cpl_TO_Info register ****/
698285431Szbb/* The Traffic Class of the timed out CPL */
699285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_TC_MASK 0x00000003
700285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_TC_SHIFT 0
701285431Szbb/* Indicates which Virtual Function (VF) had a CPL timeout */
702285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_FUN_NUM_MASK 0x000000FC
703285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_FUN_NUM_SHIFT 2
704285431Szbb/* The Tag field of the timed out CPL */
705285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_TAG_MASK 0x0000FF00
706285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_TAG_SHIFT 8
707285431Szbb/* The Attributes field of the timed out CPL */
708285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_ATTR_MASK 0x00030000
709285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_ATTR_SHIFT 16
710285431Szbb/* The Len field of the timed out CPL */
711285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_LEN_MASK 0x3FFC0000
712285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_LEN_SHIFT 18
713285431Szbb/*
714285431Szbb * Write 1 to this field to clear the information logged in the register. New
715285431Szbb * logged information will only be valid when the interrupt is cleared .
716285431Szbb */
717285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_VALID (1 << 31)
718285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_INFO_VALID_SHIFT (31)
719285431Szbb
720285431Szbb/**** Rcv_Msg0_0 register ****/
721285431Szbb/* The Requester ID of the received message */
722285431Szbb#define PCIE_W_LCL_LOG_RCV_MSG0_0_REQ_ID_MASK 0x0000FFFF
723285431Szbb#define PCIE_W_LCL_LOG_RCV_MSG0_0_REQ_ID_SHIFT 0
724285431Szbb/*
725285431Szbb * Valid logged message
726285431Szbb * Writing 1 to this bit enables new message capturing. Write one to clear
727285431Szbb */
728285431Szbb#define PCIE_W_LCL_LOG_RCV_MSG0_0_VALID (1 << 31)
729285431Szbb
730285431Szbb/**** Rcv_Msg1_0 register ****/
731285431Szbb/* The Requester ID of the received message */
732285431Szbb#define PCIE_W_LCL_LOG_RCV_MSG1_0_REQ_ID_MASK 0x0000FFFF
733285431Szbb#define PCIE_W_LCL_LOG_RCV_MSG1_0_REQ_ID_SHIFT 0
734285431Szbb/*
735285431Szbb * Valid logged message
736285431Szbb * Writing 1 to this bit enables new message capturing. Write one to clear
737285431Szbb */
738285431Szbb#define PCIE_W_LCL_LOG_RCV_MSG1_0_VALID (1 << 31)
739285431Szbb
740285431Szbb/**** Core_Queues_Status register ****/
741285431Szbb/*
742285431Szbb * Indicates which entries in the CPL lookup table
743285431Szbb * have valid entries stored. NOT supported.
744285431Szbb */
745285431Szbb#define PCIE_W_LCL_LOG_CORE_Q_STATUS_CPL_LUT_VALID_MASK 0x0000FFFF
746285431Szbb#define PCIE_W_LCL_LOG_CORE_Q_STATUS_CPL_LUT_VALID_SHIFT 0
747285431Szbb
748285431Szbb/**** Cpl_to register ****/
749285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_REQID_MASK 0x0000FFFF
750285431Szbb#define PCIE_W_LCL_LOG_CPL_TO_REQID_SHIFT 0
751285431Szbb
752285431Szbb/**** Debug_Info_0 register ****/
753285431Szbb/* Indicates the current power state */
754285431Szbb#define PCIE_W_DEBUG_INFO_0_PM_CURRENT_STATE_MASK 0x00000007
755285431Szbb#define PCIE_W_DEBUG_INFO_0_PM_CURRENT_STATE_SHIFT 0
756285431Szbb/* Current state of the LTSSM */
757285431Szbb#define PCIE_W_DEBUG_INFO_0_LTSSM_STATE_MASK 0x000001F8
758285431Szbb#define PCIE_W_DEBUG_INFO_0_LTSSM_STATE_SHIFT 3
759285431Szbb/* Decode of the Recovery. Equalization LTSSM state */
760285431Szbb#define PCIE_W_DEBUG_INFO_0_LTSSM_STATE_RCVRY_EQ (1 << 9)
761285431Szbb/* State of selected internal signals, for debug purposes only */
762285431Szbb#define PCIE_W_DEBUG_INFO_0_CXPL_DEBUG_INFO_EI_MASK 0x03FFFC00
763285431Szbb#define PCIE_W_DEBUG_INFO_0_CXPL_DEBUG_INFO_EI_SHIFT 10
764285431Szbb
765285431Szbb/**** control register ****/
766285431Szbb/* Indication to send vendor message; when clear the message was sent. */
767285431Szbb#define PCIE_W_OB_VEN_MSG_CONTROL_REQ (1 << 0)
768285431Szbb
769285431Szbb/**** param_1 register ****/
770285431Szbb/* Vendor message parameters */
771285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_FMT_MASK 0x00000003
772285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_FMT_SHIFT 0
773285431Szbb/* Vendor message parameters */
774285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TYPE_MASK 0x0000007C
775285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TYPE_SHIFT 2
776285431Szbb/* Vendor message parameters */
777285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TC_MASK 0x00000380
778285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TC_SHIFT 7
779285431Szbb/* Vendor message parameters */
780285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TD (1 << 10)
781285431Szbb/* Vendor message parameters */
782285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_EP (1 << 11)
783285431Szbb/* Vendor message parameters */
784285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_ATTR_MASK 0x00003000
785285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_ATTR_SHIFT 12
786285431Szbb/* Vendor message parameters */
787285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_LEN_MASK 0x00FFC000
788285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_LEN_SHIFT 14
789285431Szbb/* Vendor message parameters */
790285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TAG_MASK 0xFF000000
791285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_1_TAG_SHIFT 24
792285431Szbb
793285431Szbb/**** param_2 register ****/
794285431Szbb/* Vendor message parameters */
795285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_2_REQ_ID_MASK 0x0000FFFF
796285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_2_REQ_ID_SHIFT 0
797285431Szbb/* Vendor message parameters */
798285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_2_CODE_MASK 0x00FF0000
799285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_2_CODE_SHIFT 16
800285431Szbb/* Vendor message parameters */
801285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_2_RSVD_31_24_MASK 0xFF000000
802285431Szbb#define PCIE_W_OB_VEN_MSG_PARAM_2_RSVD_31_24_SHIFT 24
803285431Szbb
804285431Szbb/**** ack_info register ****/
805285431Szbb/* Vendor message parameters */
806285431Szbb#define PCIE_W_AP_USER_SEND_MSG_ACK_INFO_ACK (1 << 0)
807285431Szbb
808285431Szbb/**** features register ****/
809285431Szbb/* Enable MSI fix from the SATA to the PCIe EP - Only valid for port zero */
810285431Szbb#define PCIE_W_CTRL_GEN_FEATURES_SATA_EP_MSI_FIX	AL_BIT(16)
811285431Szbb
812285431Szbb/**** in/out_mask_x_y register ****/
813285431Szbb/* When bit [i] set to 1 it maks the compare in the atu_in/out wind ... */
814285431Szbb#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_EVEN_MASK 0x0000FFFF
815285431Szbb#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_EVEN_SHIFT 0
816285431Szbb/* When bit [i] set to 1 it maks the compare in the atu_in/out wind ... */
817285431Szbb#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_ODD_MASK 0xFFFF0000
818285431Szbb#define PCIE_W_ATU_MASK_EVEN_ODD_ATU_MASK_40_32_ODD_SHIFT 16
819285431Szbb
820285431Szbb/**** cfg register ****/
821285431Szbb/*
822285431Szbb * The 2-bit TPH Requester Enabled field of each TPH
823285431Szbb * Requester Control register.
824285431Szbb */
825285431Szbb#define PCIE_W_CFG_FUNC_EXT_CFG_CFG_TPH_REQ_EN_MASK 0x000000FF
826285431Szbb#define PCIE_W_CFG_FUNC_EXT_CFG_CFG_TPH_REQ_EN_SHIFT 0
827285431Szbb/* SRIS mode enable. */
828285431Szbb#define PCIE_W_CFG_FUNC_EXT_CFG_APP_SRIS_MODE (1 << 8)
829285431Szbb/*
830285431Szbb *
831285431Szbb */
832285431Szbb#define PCIE_W_CFG_FUNC_EXT_CFG_RSRVD_MASK 0xFFFFFE00
833285431Szbb#define PCIE_W_CFG_FUNC_EXT_CFG_RSRVD_SHIFT 9
834285431Szbb
835285431Szbb/**** app_func_num_advisory register ****/
836285431Szbb/*
837285431Szbb * The number of the function that is reporting the error
838285431Szbb * indicated app_err_bus, valid when app_hdr_valid is asserted.
839285431Szbb * Correctable and Uncorrected Internal errors (app_err_bus[10:9]) are
840285431Szbb * not function specific, and are recorded for all physical functions,
841285431Szbb * regardless of the value this bus. Function numbering starts at '0'.
842285431Szbb */
843285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_APP_ERR_FUNC_NUM_MASK 0x0000FFFF
844285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_APP_ERR_FUNC_NUM_SHIFT 0
845285431Szbb/*
846285431Szbb * Description: Indicates that your application error is an advisory
847285431Szbb * error. Your application should assert app_err_advisory under either
848285431Szbb * of the following conditions:
849285431Szbb * - The core is configured to mask completion timeout errors, your
850285431Szbb * application is reporting a completion timeout error app_err_bus,
851285431Szbb * and your application intends to resend the request. In such cases
852285431Szbb * the error is an advisory error, as described in PCI Express 3.0
853285431Szbb * Specification. When your application does not intend to resend
854285431Szbb * the request, then your application must keep app_err_advisory
855285431Szbb * de-asserted when reporting a completion timeout error.
856285431Szbb * - The core is configured to forward poisoned TLPs to your
857285431Szbb * application and your application is going to treat the poisoned
858285431Szbb * TLP as a normal TLP, as described in PCI Express 3.0
859285431Szbb * Specification. Upon receipt of a poisoned TLP, your application
860285431Szbb * must report the error app_err_bus, and either assert
861285431Szbb * app_err_advisory (to indicate an advisory error) or de-assert
862285431Szbb * app_err_advisory (to indicate that your application is dropping the
863285431Szbb * TLP).
864285431Szbb * For more details, see the PCI Express 3.0 Specification to determine
865285431Szbb * when an application error is an advisory error.
866285431Szbb */
867285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_APP_ERR_ADVISORY (1 << 16)
868285431Szbb/*
869285431Szbb * Rsrvd.
870285431Szbb */
871285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_RSRVD_MASK 0xFFFE0000
872285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_FUNC_NUM_ADVISORY_RSRVD_SHIFT 17
873285431Szbb
874285431Szbb/**** app_hdr_cmd register ****/
875285431Szbb/*
876285431Szbb * When set the header is send (need to clear before sending the next message).
877285431Szbb */
878285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_HDR_CMD_APP_HDR_VALID (1 << 0)
879285431Szbb/*
880285431Szbb * Rsrvd.
881285431Szbb */
882285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_HDR_CMD_RSRVD_MASK 0xFFFFFFFE
883285431Szbb#define PCIE_W_APP_HDR_INTERFACE_SEND_APP_HDR_CMD_RSRVD_SHIFT 1
884285431Szbb
885285431Szbb/**** diag_ctrl register ****/
886285431Szbb/*
887285431Szbb * The 2-bit TPH Requester Enabled field of each TPH
888285431Szbb * Requester Control register.
889285431Szbb */
890285431Szbb#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_DIAG_CTRL_BUS_MASK 0x00000007
891285431Szbb#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_DIAG_CTRL_BUS_SHIFT 0
892285431Szbb/*
893285431Szbb *
894285431Szbb */
895285431Szbb#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_RSRVD_MASK 0xFFFFFFF8
896285431Szbb#define PCIE_W_DIAG_COMMAND_DIAG_CTRL_RSRVD_SHIFT 3
897285431Szbb
898285431Szbb
899285431Szbb/**** Events_Gen register ****/
900285431Szbb/* INT_D. Not supported  */
901285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTD (1 << 0)
902285431Szbb/* INT_C. Not supported  */
903285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTC (1 << 1)
904285431Szbb/* INT_B. Not supported  */
905285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTB (1 << 2)
906285431Szbb/*
907285431Szbb * Transmit INT_A Interrupt Control
908285431Szbb * Every transition from 0 to 1 schedules an Assert_ INT interrupt message for
909285431Szbb * transmit.
910285431Szbb * Every transition from 1 to 0, schedules a Deassert_INT interrupt message for
911285431Szbb * transmit. Which interrupt, the PCIe only use INTA message.
912285431Szbb */
913285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_ASSERT_INTA (1 << 3)
914285431Szbb/*
915285431Szbb * A request to generate an outbound MSI interrupt when MSI is enabled. Change
916285431Szbb * from 1'b0 to 1'b1 to create an MSI write to be sent.
917285431Szbb */
918285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_TRNS_REQ (1 << 4)
919285431Szbb/* Set the MSI vector before issuing msi_trans_req. */
920285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_MASK 0x000003E0
921285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_MSI_VECTOR_SHIFT 5
922285431Szbb/*
923285431Szbb * The application requests hot reset to a downstream device. Change the value
924285431Szbb * from 0 to 1 to send hot reset. Only func 0 is supported.
925285431Szbb */
926285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_APP_RST_INIT (1 << 10)
927285431Szbb/*
928285431Szbb * The application request unlock message to be sent. Change the value from 0 to
929285431Szbb * 1 to send the message. Only func 0 is supported.
930285431Szbb */
931285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_UNLOCK_GEN (1 << 30)
932285431Szbb/* Indicates that FLR on a Physical Function has been completed. */
933285431Szbb#define PCIE_W_GLOBAL_CTRL_EVENTS_GEN_FLR_PF_DONE (1 << 31)
934285431Szbb
935285431Szbb/**** pm_state_per_func register ****/
936285431Szbb/*
937285431Szbb * Description: The current power management D-state of the
938285431Szbb * function:
939285431Szbb * \u25a0 000b: D0
940285431Szbb * \u25a0 001b: D1
941285431Szbb * \u25a0 010b: D2
942285431Szbb * \u25a0 011b: D3
943285431Szbb * \u25a0 100b: Uninitialized
944285431Szbb * \u25a0 Other values: Not applicable
945285431Szbb * There are 3 bits of pm_dstate for each configured function.
946285431Szbb */
947285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_DSTATE_MASK 0x0000000F
948285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_DSTATE_SHIFT 0
949285431Szbb/*
950285431Szbb * PME Status bit from the PMCSR. There is 1 bit of
951285431Szbb * pm_status for each configured function
952285431Szbb */
953285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_STATUS (1 << 4)
954285431Szbb/*
955285431Szbb * PME Enable bit in the PMCSR. There is 1 bit of
956285431Szbb * pm_pme_en for each configured function.
957285431Szbb */
958285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_PM_PME_EN (1 << 5)
959285431Szbb/*
960285431Szbb * Auxiliary Power Enable bit in the Device Control
961285431Szbb * register. There is 1 bit of aux_pm_en for each configured function.
962285431Szbb */
963285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_AUX_PME_EN (1 << 6)
964285431Szbb/*
965285431Szbb * This field should be set according to the MAX_FUNC_NUM set in the PCIe core,
966285431Szbb * it uses as mask (bit per function) to the dsate when set to zero.
967285431Szbb */
968285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_ASPM_PF_ENABLE_MAX_FUNC_NUMBER (1 << 7)
969285431Szbb/*
970285431Szbb * This field should be set according to the MAX_FUNC_NUM set in the PCIe core,
971285431Szbb * it uses as mask (bit per function) to the ASPM contrl bit, when set to zero.
972285431Szbb */
973285431Szbb#define PCIE_W_PM_STATE_PER_FUNC_PM_STATE_PER_FUNC_DSATE_PF_ENABLE_MAX_FUNC_NUMBER (1 << 8)
974285431Szbb
975285431Szbb/**** bar0_ctrl register ****/
976285431Szbb/* bar is en and override the internal PF bar. */
977285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_EN_MASK 0x00000003
978285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_EN_SHIFT 0
979285431Szbb/* bar is io */
980285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_IO_MASK 0x0000000C
981285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_BAR_IO_SHIFT 2
982285431Szbb/* Reserved. */
983285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_RSRVS_MASK 0xFFFFFFF0
984285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR0_CTRL_RSRVS_SHIFT 4
985285431Szbb
986285431Szbb/**** bar1_ctrl register ****/
987285431Szbb/* bar is en and override the internal PF bar. */
988285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_EN_MASK 0x00000003
989285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_EN_SHIFT 0
990285431Szbb/* bar is io */
991285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_IO_MASK 0x0000000C
992285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_BAR_IO_SHIFT 2
993285431Szbb/* Reserved. */
994285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_RSRVS_MASK 0xFFFFFFF0
995285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR1_CTRL_RSRVS_SHIFT 4
996285431Szbb
997285431Szbb/**** bar2_ctrl register ****/
998285431Szbb/* bar is en and override the internal PF bar. */
999285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_EN_MASK 0x00000003
1000285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_EN_SHIFT 0
1001285431Szbb/* bar is io */
1002285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_IO_MASK 0x0000000C
1003285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_BAR_IO_SHIFT 2
1004285431Szbb/* Reserved. */
1005285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_RSRVS_MASK 0xFFFFFFF0
1006285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR2_CTRL_RSRVS_SHIFT 4
1007285431Szbb
1008285431Szbb/**** bar3_ctrl register ****/
1009285431Szbb/* bar is en and override the internal PF bar. */
1010285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_EN_MASK 0x00000003
1011285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_EN_SHIFT 0
1012285431Szbb/* bar is io */
1013285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_IO_MASK 0x0000000C
1014285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_BAR_IO_SHIFT 2
1015285431Szbb/* Reserved. */
1016285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_RSRVS_MASK 0xFFFFFFF0
1017285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR3_CTRL_RSRVS_SHIFT 4
1018285431Szbb
1019285431Szbb/**** bar4_ctrl register ****/
1020285431Szbb/* bar is en and override the internal PF bar. */
1021285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_EN_MASK 0x00000003
1022285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_EN_SHIFT 0
1023285431Szbb/* bar is io */
1024285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_IO_MASK 0x0000000C
1025285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_BAR_IO_SHIFT 2
1026285431Szbb/* Reserved. */
1027285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_RSRVS_MASK 0xFFFFFFF0
1028285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR4_CTRL_RSRVS_SHIFT 4
1029285431Szbb
1030285431Szbb/**** bar5_ctrl register ****/
1031285431Szbb/* bar is en and override the internal PF bar. */
1032285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_EN_MASK 0x00000003
1033285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_EN_SHIFT 0
1034285431Szbb/* bar is io */
1035285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_IO_MASK 0x0000000C
1036285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_BAR_IO_SHIFT 2
1037285431Szbb/* Reserved. */
1038285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_RSRVS_MASK 0xFFFFFFF0
1039285431Szbb#define PCIE_W_CFG_BARS_OVRD_BAR5_CTRL_RSRVS_SHIFT 4
1040285431Szbb
1041285431Szbb/**** cause_A register ****/
1042285431Szbb/* Deassert_INTD received. Write zero to clear this bit. */
1043285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTD (1 << 0)
1044285431Szbb/* Deassert_INTC received. Write zero to clear this bit. */
1045285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTC (1 << 1)
1046285431Szbb/* Deassert_INTB received. Write zero to clear this bit. */
1047285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTB (1 << 2)
1048285431Szbb/* Deassert_INTA received. Write zero to clear this bit. */
1049285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_DEASSERT_INTA (1 << 3)
1050285431Szbb/* Assert_INTD received. Write zero to clear this bit. */
1051285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTD (1 << 4)
1052285431Szbb/* Assert_INTC received. Write zero to clear this bit. */
1053285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTC (1 << 5)
1054285431Szbb/* Assert_INTC received. Write zero to clear this bit. */
1055285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTB (1 << 6)
1056285431Szbb/* Assert_INTA received. Write zero to clear this bit. */
1057285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_ASSERT_INTA (1 << 7)
1058285431Szbb/*
1059285431Szbb * MSI Controller Interrupt
1060285431Szbb * MSI interrupt is being received. Write zero to clear this bit
1061285431Szbb */
1062285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_MSI_CNTR_RCV_INT (1 << 8)
1063285431Szbb/*
1064285431Szbb * MSI sent grant. Write zero to clear this bit.
1065285431Szbb */
1066285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_MSI_TRNS_GNT (1 << 9)
1067285431Szbb/*
1068285431Szbb * System error detected
1069285431Szbb * Indicates if any device in the hierarchy reports any of the following errors
1070285431Szbb * and the associated enable bit is set in the Root Control register:
1071285431Szbb * ERR_COR
1072285431Szbb * ERR_FATAL
1073285431Szbb * ERR_NONFATAL
1074285431Szbb * Also asserted when an internal error is detected. Write zero to clear this
1075285431Szbb * bit.
1076285431Szbb */
1077285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_SYS_ERR_RC (1 << 10)
1078285431Szbb/*
1079285431Szbb * Set when software initiates FLR on a Physical Function by writing to the
1080285431Szbb * Initiate FLR register bit of that function Write zero to clear this bit.
1081285431Szbb */
1082285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_FLR_PF_ACTIVE (1 << 11)
1083285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_11 (1 << 11)
1084285431Szbb/*
1085285431Szbb * Reported error condition causes a bit to be set in the Root Error Status
1086285431Szbb * register and the associated error message reporting enable bit is set in the
1087285431Szbb * Root Error Command Register. Write zero to clear this bit.
1088285431Szbb */
1089285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_AER_RC_ERR (1 << 12)
1090285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_12 (1 << 12)
1091285431Szbb/*
1092285431Szbb * The core asserts aer_rc_err_msi when all of the following conditions are
1093285431Szbb * true:
1094285431Szbb * - MSI or MSI-X is enabled.
1095285431Szbb * - A reported error condition causes a bit to be set in the Root Error Status
1096285431Szbb * register.
1097285431Szbb * - The associated error message reporting enable bit is set in the Root Error
1098285431Szbb * Command register Write zero to clear this bit
1099285431Szbb */
1100285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_AER_RC_ERR_MSI (1 << 13)
1101285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_13 (1 << 13)
1102285431Szbb/*
1103285431Szbb * Wake Up. Wake up from power management unit.
1104285431Szbb * The core generates wake to request the system to restore power and clock when
1105285431Szbb * a beacon has been detected. wake is an active high signal and its rising edge
1106285431Szbb * should be detected to drive the WAKE# on the connector Write zero to clear
1107285431Szbb * this bit
1108285431Szbb */
1109285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_WAKE (1 << 14)
1110285431Szbb/*
1111285431Szbb * The core asserts cfg_pme_int when all of the following conditions are true:
1112285431Szbb * - INTx Assertion Disable bit in the Command register is 0.
1113285431Szbb * - PME Interrupt Enable bit in the Root Control register is set to 1.
1114285431Szbb * - PME Status bit in the Root Status register is set to 1. Write zero to clear
1115285431Szbb * this bit
1116285431Szbb */
1117285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_PME_INT (1 << 15)
1118285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_15 (1 << 15)
1119285431Szbb/*
1120285431Szbb * The core asserts cfg_pme_msi when all of the following conditions are true:
1121285431Szbb * - MSI or MSI-X is enabled.
1122285431Szbb * - PME Interrupt Enable bit in the Root Control register is set to 1.
1123285431Szbb * - PME Status bit in the Root Status register is set to 1. Write zero to clear
1124285431Szbb * this bit
1125285431Szbb */
1126285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_PME_MSI (1 << 16)
1127285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_RSRVD_16 (1 << 16)
1128285431Szbb/*
1129285431Szbb * The core asserts hp_pme when all of the following conditions are true:
1130285431Szbb * - The PME Enable bit in the Power Management Control and Status register is
1131285431Szbb * set to 1.
1132285431Szbb * - Any bit in the Slot Status register transitions from 0 to 1 and the
1133285431Szbb * associated event notification is enabled in the Slot Control register. Write
1134285431Szbb * zero to clear this bit
1135285431Szbb */
1136285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_HP_PME (1 << 17)
1137285431Szbb/*
1138285431Szbb * The core asserts hp_int when all of the following conditions are true:
1139285431Szbb * - INTx Assertion Disable bit in the Command register is 0.
1140285431Szbb * - Hot-Plug interrupts are enabled in the Slot Control register.
1141285431Szbb * - Any bit in the Slot Status register is equal to 1, and the associated event
1142285431Szbb * notification is enabled in the Slot Control register. Write zero to clear
1143285431Szbb * this bit
1144285431Szbb */
1145285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_HP_INT (1 << 18)
1146285431Szbb/* The outstanding write counter become  full should never happen */
1147285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_WRITE_COUNTER_FULL_ERR (1 << 18)
1148285431Szbb
1149285431Szbb
1150285431Szbb/*
1151285431Szbb * The core asserts hp_msi when the logical AND of the following conditions
1152285431Szbb * transitions from false to true:
1153285431Szbb * - MSI or MSI-X is enabled.
1154285431Szbb * - Hot-Plug interrupts are enabled in the Slot Control register.
1155285431Szbb * - Any bit in the Slot Status register transitions from 0 to 1 and the
1156285431Szbb * associated event notification is enabled in the Slot Control register.
1157285431Szbb */
1158285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_HP_MSI (1 << 19)
1159285431Szbb/* Read VPD registers notification */
1160285431Szbb#define PCIE_W_REV1_2_INT_GRP_A_CAUSE_A_VPD_INT (1 << 20)
1161285431Szbb/* not use */
1162285431Szbb#define PCIE_W_REV3_INT_GRP_A_CAUSE_A_NOT_USE (1 << 20)
1163285431Szbb
1164285431Szbb/*
1165285431Szbb * The core assert link down event, whenever the link is going down. Write zero
1166285431Szbb * to clear this bit, pulse signal
1167285431Szbb */
1168285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_LINK_DOWN_EVENT (1 << 21)
1169285431Szbb/*
1170285431Szbb * When the EP gets a command to shut down, signal the software to block any new
1171285431Szbb * TLP.
1172285431Szbb */
1173285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_PM_XTLH_BLOCK_TLP (1 << 22)
1174285431Szbb/* PHY/MAC link up */
1175285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_XMLH_LINK_UP (1 << 23)
1176285431Szbb/* Data link up */
1177285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_RDLH_LINK_UP (1 << 24)
1178285431Szbb/* The ltssm is in RCVRY_LOCK state. */
1179285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_LTSSM_RCVRY_STATE (1 << 25)
1180285431Szbb/*
1181285431Szbb * Config write transaction to the config space by the RC peer, enable this
1182285431Szbb * interrupt only for EP mode.
1183285431Szbb */
1184285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_CFG_WR_EVENT (1 << 26)
1185285431Szbb/* AER error */
1186285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_AP_PENDED_CORR_ERR_STS_INT (1 << 28)
1187285431Szbb/* AER error */
1188285431Szbb#define PCIE_W_INT_GRP_A_CAUSE_A_AP_PENDED_UNCORR_ERR_STS_INT (1 << 29)
1189285431Szbb
1190285431Szbb/**** control_A register ****/
1191285431Szbb/* When Clear_on_Read =1, all bits of  Cause register are cleared on read. */
1192285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_CLEAR_ON_READ (1 << 0)
1193285431Szbb/*
1194285431Szbb * (Must be set only when MSIX is enabled.)
1195285431Szbb * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
1196285431Szbb * corresponding bit in the Mask register is set, masking future interrupts.
1197285431Szbb */
1198285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_AUTO_MASK (1 << 1)
1199285431Szbb/*
1200285431Szbb * Auto_Clear (RW)
1201285431Szbb * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
1202285431Szbb * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
1203285431Szbb */
1204285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_AUTO_CLEAR (1 << 2)
1205285431Szbb/*
1206285431Szbb * When Set_on_Posedge =1, the bits in the Interrupt Cause register are set on
1207285431Szbb * the posedge of the interrupt source, i.e., when interrupt source =1 and
1208285431Szbb * Interrupt Status = 0.
1209285431Szbb * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
1210285431Szbb * interrupt source =1.
1211285431Szbb */
1212285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_SET_ON_POSEDGE (1 << 3)
1213285431Szbb/*
1214285431Szbb * When Moderation_Reset =1, all Moderation timers associated with the interrupt
1215285431Szbb * cause bits are cleared to 0, enabling immediate interrupt assertion if any
1216285431Szbb * unmasked cause bit is set to 1. This bit is self-negated.
1217285431Szbb */
1218285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_RST (1 << 4)
1219285431Szbb/*
1220285431Szbb * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
1221285431Szbb * 1 when the associated summary bit in this group is used to generate a single
1222285431Szbb * MSI-X for this group.
1223285431Szbb */
1224285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_MASK_MSI_X (1 << 5)
1225285431Szbb/* MSI-X AWID value. Same ID for all cause bits. */
1226285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_AWID_MASK 0x00000F00
1227285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_AWID_SHIFT 8
1228285431Szbb/*
1229285431Szbb * This value determines the interval between interrupts; writing ZERO disables
1230285431Szbb * Moderation.
1231285431Szbb */
1232285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_INTV_MASK 0x00FF0000
1233285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_INTV_SHIFT 16
1234285431Szbb/*
1235285431Szbb * This value determines the Moderation_Timer_Clock speed.
1236285431Szbb * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
1237285431Szbb * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
1238285431Szbb * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
1239285431Szbb */
1240285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_RES_MASK 0x0F000000
1241285431Szbb#define PCIE_W_INT_GRP_A_CONTROL_A_MOD_RES_SHIFT 24
1242285431Szbb
1243285431Szbb/**** cause_B register ****/
1244285431Szbb/* Indicates that the core received a PM_PME Message. Write Zero to clear. */
1245285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_PM_PME (1 << 0)
1246285431Szbb/*
1247285431Szbb * Indicates that the core received a PME_TO_Ack Message. Write Zero to clear.
1248285431Szbb */
1249285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_PM_TO_ACK (1 << 1)
1250285431Szbb/*
1251285431Szbb * Indicates that the core received an PME_Turn_Off Message. Write Zero to
1252285431Szbb * clear.
1253285431Szbb * EP mode only
1254285431Szbb */
1255285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_PM_TURNOFF (1 << 2)
1256285431Szbb/* Indicates that the core received an ERR_CORR Message. Write Zero to clear. */
1257285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_CORRECTABLE_ERR (1 << 3)
1258285431Szbb/*
1259285431Szbb * Indicates that the core received an ERR_NONFATAL Message. Write Zero to
1260285431Szbb * clear.
1261285431Szbb */
1262285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_NONFATAL_ERR (1 << 4)
1263285431Szbb/*
1264285431Szbb * Indicates that the core received an ERR_FATAL Message. Write Zero to clear.
1265285431Szbb */
1266285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_FATAL_ERR (1 << 5)
1267285431Szbb/*
1268285431Szbb * Indicates that the core received a Vendor Defined Message. Write Zero to
1269285431Szbb * clear.
1270285431Szbb */
1271285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_VENDOR_0 (1 << 6)
1272285431Szbb/*
1273285431Szbb * Indicates that the core received a Vendor Defined Message. Write Zero to
1274285431Szbb * clear.
1275285431Szbb */
1276285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_VENDOR_1 (1 << 7)
1277285431Szbb/* Indicates that the core received an Unlock Message. Write Zero to clear. */
1278285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_MSG_UNLOCK (1 << 8)
1279285431Szbb/*
1280285431Szbb * Notification when the Link Autonomous Bandwidth Status register (Link Status
1281285431Szbb * register bit 15) is updated and the Link Autonomous Bandwidth Interrupt
1282285431Szbb * Enable (Link Control register bit 11) is set. This bit is not applicable to,
1283285431Szbb * and is reserved, for Endpoint device. Write Zero to clear
1284285431Szbb */
1285285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_LINK_AUTO_BW_INT (1 << 12)
1286285431Szbb/*
1287285431Szbb * Notification that the Link Equalization Request bit in the Link Status 2
1288285431Szbb * Register has been set. Write Zero to clear.
1289285431Szbb */
1290285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_LINK_EQ_REQ_INT (1 << 13)
1291285431Szbb/*
1292285431Szbb * OB Vendor message request is granted by the PCIe core Write Zero to clear.
1293285431Szbb */
1294285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_VENDOR_MSG_GRANT (1 << 14)
1295285431Szbb/* CPL timeout from the PCIe core inidication. Write Zero to clear */
1296285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_CMP_TIME_OUT (1 << 15)
1297285431Szbb/*
1298285431Szbb * Slave Response Composer Lookup Error
1299285431Szbb * Indicates that an overflow occurred in a lookup table of the Inbound
1300285431Szbb * responses. This indicates that there was a violation of the number of
1301285431Szbb * outstanding NP requests issued for the Outbound direction. Write zero to
1302285431Szbb * clear
1303285431Szbb */
1304285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_RADMX_CMPOSER_LOOKUP_ERR (1 << 16)
1305285431Szbb/* Parity Error */
1306285431Szbb#define PCIE_W_INT_GRP_B_CAUSE_B_PARITY_ERROR_CORE (1 << 17)
1307285431Szbb
1308285431Szbb/**** control_B register ****/
1309285431Szbb/* When Clear_on_Read =1, all bits of the Cause register are cleared on read. */
1310285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_CLEAR_ON_READ (1 << 0)
1311285431Szbb/*
1312285431Szbb * (Must be set only when MSIX is enabled.)
1313285431Szbb * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
1314285431Szbb * corresponding bit in the Mask register is set, masking future interrupts.
1315285431Szbb */
1316285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_AUTO_MASK (1 << 1)
1317285431Szbb/*
1318285431Szbb * Auto_Clear (RW)
1319285431Szbb * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
1320285431Szbb * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
1321285431Szbb */
1322285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_AUTO_CLEAR (1 << 2)
1323285431Szbb/*
1324285431Szbb * When Set_on_Posedge =1, the bits in the interrupt Cause register are set on
1325285431Szbb * the posedge of the interrupt source, i.e., when Interrupt Source =1 and
1326285431Szbb * Interrupt Status = 0.
1327285431Szbb * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
1328285431Szbb * Interrupt Source =1.
1329285431Szbb */
1330285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_SET_ON_POSEDGE (1 << 3)
1331285431Szbb/*
1332285431Szbb * When Moderation_Reset =1, all Moderation timers associated with the interrupt
1333285431Szbb * cause bits are cleared to 0, enabling an immediate interrupt assertion if any
1334285431Szbb * unmasked cause bit is set to 1. This bit is self-negated.
1335285431Szbb */
1336285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_RST (1 << 4)
1337285431Szbb/*
1338285431Szbb * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
1339285431Szbb * 1 when the associated summary bit in this group is used to generate a single
1340285431Szbb * MSI-X for this group.
1341285431Szbb */
1342285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_MASK_MSI_X (1 << 5)
1343285431Szbb/* MSI-X AWID value. Same ID for all cause bits. */
1344285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_AWID_MASK 0x00000F00
1345285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_AWID_SHIFT 8
1346285431Szbb/*
1347285431Szbb * This value determines the interval between interrupts. Writing ZERO disables
1348285431Szbb * Moderation.
1349285431Szbb */
1350285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_INTV_MASK 0x00FF0000
1351285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_INTV_SHIFT 16
1352285431Szbb/*
1353285431Szbb * This value determines the Moderation_Timer_Clock speed.
1354285431Szbb * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
1355285431Szbb * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
1356285431Szbb * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
1357285431Szbb */
1358285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_RES_MASK 0x0F000000
1359285431Szbb#define PCIE_W_INT_GRP_B_CONTROL_B_MOD_RES_SHIFT 24
1360285431Szbb
1361285431Szbb/**** cause_C register ****/
1362285431Szbb/* VPD interrupt, ot read/write frpm EEPROM */
1363285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_VPD_INT_FUNC_MASK 0x0000000F
1364285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_VPD_INT_FUNC_SHIFT 0
1365285431Szbb/* flr PF active */
1366285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_FLR_PF_ACTIVE_MASK 0x000000F0
1367285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_FLR_PF_ACTIVE_SHIFT 4
1368285431Szbb/* System ERR RC. */
1369285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_SYS_ERR_RC_MASK 0x00000F00
1370285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_SYS_ERR_RC_SHIFT 8
1371285431Szbb/* AER RC INT */
1372285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_INT_MASK 0x0000F000
1373285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_INT_SHIFT 12
1374285431Szbb/* AER RC MSI */
1375285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_MSI_MASK 0x000F0000
1376285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_AER_RC_ERR_MSI_SHIFT 16
1377285431Szbb/* PME MSI */
1378285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_MSI_MASK 0x00F00000
1379285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_MSI_SHIFT 20
1380285431Szbb/* PME int */
1381285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_INT_MASK 0x0F000000
1382285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_CFG_PME_INT_SHIFT 24
1383285431Szbb/* SB overflow */
1384285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_RADM_QOVERFLOW (1 << 28)
1385285431Szbb/* ecrc was injected through the diag_ctrl bus */
1386285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_ECRC_INJECTED (1 << 29)
1387285431Szbb/* lcrc was injected through the diag_ctrl bus */
1388285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_LCRC_INJECTED (1 << 30)
1389285431Szbb/* lcrc was injected through the diag_ctrl bus */
1390285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CAUSE_GRP_C_RSRVD (1 << 31)
1391285431Szbb
1392285431Szbb/**** control_C register ****/
1393285431Szbb/* When Clear_on_Read =1, all bits of  Cause register are cleared on read. */
1394285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_CLEAR_ON_READ (1 << 0)
1395285431Szbb/*
1396285431Szbb * (Must be set only when MSIX is enabled.)
1397285431Szbb * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
1398285431Szbb * corresponding bit in the Mask register is set, masking future interrupts.
1399285431Szbb */
1400285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AUTO_MASK (1 << 1)
1401285431Szbb/*
1402285431Szbb * Auto_Clear (RW)
1403285431Szbb * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
1404285431Szbb * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
1405285431Szbb */
1406285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AUTO_CLEAR (1 << 2)
1407285431Szbb/*
1408285431Szbb * When Set_on_Posedge =1, the bits in the Interrupt Cause register are set on
1409285431Szbb * the posedge of the interrupt source, i.e., when interrupt source =1 and
1410285431Szbb * Interrupt Status = 0.
1411285431Szbb * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
1412285431Szbb * interrupt source =1.
1413285431Szbb */
1414285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_SET_ON_POSEDGE (1 << 3)
1415285431Szbb/*
1416285431Szbb * When Moderation_Reset =1, all Moderation timers associated with the interrupt
1417285431Szbb * cause bits are cleared to 0, enabling immediate interrupt assertion if any
1418285431Szbb * unmasked cause bit is set to 1. This bit is self-negated.
1419285431Szbb */
1420285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_RST (1 << 4)
1421285431Szbb/*
1422285431Szbb * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
1423285431Szbb * 1 when the associated summary bit in this group is used to generate a single
1424285431Szbb * MSI-X for this group.
1425285431Szbb */
1426285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MASK_MSI_X (1 << 5)
1427285431Szbb/* MSI-X AWID value. Same ID for all cause bits. */
1428285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AWID_MASK 0x00000F00
1429285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_AWID_SHIFT 8
1430285431Szbb/*
1431285431Szbb * This value determines the interval between interrupts; writing ZERO disables
1432285431Szbb * Moderation.
1433285431Szbb */
1434285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_INTV_MASK 0x00FF0000
1435285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_INTV_SHIFT 16
1436285431Szbb/*
1437285431Szbb * This value determines the Moderation_Timer_Clock speed.
1438285431Szbb * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
1439285431Szbb * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
1440285431Szbb * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
1441285431Szbb */
1442285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_RES_MASK 0x0F000000
1443285431Szbb#define PCIE_W_INTERRUPT_GRP_C_INT_CONTROL_GRP_C_MOD_RES_SHIFT 24
1444285431Szbb
1445285431Szbb/**** control_D register ****/
1446285431Szbb/* When Clear_on_Read =1, all bits of  Cause register are cleared on read. */
1447285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_CLEAR_ON_READ (1 << 0)
1448285431Szbb/*
1449285431Szbb * (Must be set only when MSIX is enabled.)
1450285431Szbb * When Auto-Mask =1 and an MSI-X ACK for this bit is received, its
1451285431Szbb * corresponding bit in the Mask register is set, masking future interrupts.
1452285431Szbb */
1453285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AUTO_MASK (1 << 1)
1454285431Szbb/*
1455285431Szbb * Auto_Clear (RW)
1456285431Szbb * When Auto-Clear =1, the bits in the Interrupt Cause register are auto-cleared
1457285431Szbb * after MSI-X is acknowledged. Must be used only if MSI-X is enabled.
1458285431Szbb */
1459285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AUTO_CLEAR (1 << 2)
1460285431Szbb/*
1461285431Szbb * When Set_on_Posedge =1, the bits in the Interrupt Cause register are set on
1462285431Szbb * the posedge of the interrupt source, i.e., when interrupt source =1 and
1463285431Szbb * Interrupt Status = 0.
1464285431Szbb * When Set_on_Posedge =0, the bits in the Interrupt Cause register are set when
1465285431Szbb * interrupt source =1.
1466285431Szbb */
1467285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_SET_ON_POSEDGE (1 << 3)
1468285431Szbb/*
1469285431Szbb * When Moderation_Reset =1, all Moderation timers associated with the interrupt
1470285431Szbb * cause bits are cleared to 0, enabling immediate interrupt assertion if any
1471285431Szbb * unmasked cause bit is set to 1. This bit is self-negated.
1472285431Szbb */
1473285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_RST (1 << 4)
1474285431Szbb/*
1475285431Szbb * When mask_msi_x =1, no MSI-X from this group is sent. This bit must be set to
1476285431Szbb * 1 when the associated summary bit in this group is used to generate a single
1477285431Szbb * MSI-X for this group.
1478285431Szbb */
1479285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MASK_MSI_X (1 << 5)
1480285431Szbb/* MSI-X AWID value. Same ID for all cause bits. */
1481285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AWID_MASK 0x00000F00
1482285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_AWID_SHIFT 8
1483285431Szbb/*
1484285431Szbb * This value determines the interval between interrupts; writing ZERO disables
1485285431Szbb * Moderation.
1486285431Szbb */
1487285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_INTV_MASK 0x00FF0000
1488285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_INTV_SHIFT 16
1489285431Szbb/*
1490285431Szbb * This value determines the Moderation_Timer_Clock speed.
1491285431Szbb * 0- Moderation-timer is decremented every 1x256 SB clock cycles ~1uS.
1492285431Szbb * 1- Moderation-timer is decremented every 2x256 SB clock cycles ~2uS.
1493285431Szbb * N- Moderation-timer is decremented every Nx256 SB clock cycles ~(N+1) uS.
1494285431Szbb */
1495285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_RES_MASK 0x0F000000
1496285431Szbb#define PCIE_W_INTERRUPT_GRP_D_INT_CONTROL_GRP_D_MOD_RES_SHIFT 24
1497285431Szbb#ifdef __cplusplus
1498285431Szbb}
1499285431Szbb#endif
1500285431Szbb
1501285431Szbb#endif /* __AL_HAL_PCIE_W_REG_H */
1502285431Szbb
1503285431Szbb/** @} end of ... group */
1504285431Szbb
1505285431Szbb
1506