• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0
2  *
3  * Copyright 2019-2020 HabanaLabs, Ltd.
4  * All Rights Reserved.
5  *
6  */
7 
8 #ifndef GAUDI_FW_IF_H
9 #define GAUDI_FW_IF_H
10 
11 #include <linux/types.h>
12 
13 #define GAUDI_EVENT_QUEUE_MSI_IDX	8
14 #define GAUDI_NIC_PORT1_MSI_IDX		10
15 #define GAUDI_NIC_PORT3_MSI_IDX		12
16 #define GAUDI_NIC_PORT5_MSI_IDX		14
17 #define GAUDI_NIC_PORT7_MSI_IDX		16
18 #define GAUDI_NIC_PORT9_MSI_IDX		18
19 
20 #define UBOOT_FW_OFFSET			0x100000	/* 1MB in SRAM */
21 #define LINUX_FW_OFFSET			0x800000	/* 8MB in HBM */
22 
23 /* HBM thermal delta in [Deg] added to composite (CTemp) */
24 #define HBM_TEMP_ADJUST_COEFF		6
25 
26 enum gaudi_nic_axi_error {
27 	RXB,
28 	RXE,
29 	TXS,
30 	TXE,
31 	QPC_RESP,
32 	NON_AXI_ERR,
33 	TMR,
34 };
35 
36 /*
37  * struct eq_nic_sei_event - describes an AXI error cause.
38  * @axi_error_cause: one of the events defined in enum gaudi_nic_axi_error.
39  * @id: can be either 0 or 1, to further describe unit with interrupt cause
40  *      (i.e. TXE0 or TXE1).
41  * @pad[6]: padding structure to 64bit.
42  */
43 struct eq_nic_sei_event {
44 	__u8 axi_error_cause;
45 	__u8 id;
46 	__u8 pad[6];
47 };
48 
49 /*
50  * struct gaudi_nic_status - describes the status of a NIC port.
51  * @port: NIC port index.
52  * @bad_format_cnt: e.g. CRC.
53  * @responder_out_of_sequence_psn_cnt: e.g NAK.
54  * @high_ber_reinit_cnt: link reinit due to high BER.
55  * @correctable_err_cnt: e.g. bit-flip.
56  * @uncorrectable_err_cnt: e.g. MAC errors.
57  * @retraining_cnt: re-training counter.
58  * @up: is port up.
59  * @pcs_link: has PCS link.
60  * @phy_ready: is PHY ready.
61  * @auto_neg: is Autoneg enabled.
62  * @timeout_retransmission_cnt: timeout retransmission events
63  * @high_ber_cnt: high ber events
64  */
65 struct gaudi_nic_status {
66 	__u32 port;
67 	__u32 bad_format_cnt;
68 	__u32 responder_out_of_sequence_psn_cnt;
69 	__u32 high_ber_reinit;
70 	__u32 correctable_err_cnt;
71 	__u32 uncorrectable_err_cnt;
72 	__u32 retraining_cnt;
73 	__u8 up;
74 	__u8 pcs_link;
75 	__u8 phy_ready;
76 	__u8 auto_neg;
77 	__u32 timeout_retransmission_cnt;
78 	__u32 high_ber_cnt;
79 };
80 
81 struct gaudi_flops_2_data {
82 	union {
83 		struct {
84 			__u32 spsram_init_done : 1;
85 			__u32 reserved : 31;
86 		};
87 		__u32 data;
88 	};
89 };
90 
91 #define GAUDI_PLL_FREQ_LOW		200000000 /* 200 MHz */
92 
93 #endif /* GAUDI_FW_IF_H */
94