habanalabs/gaudi: add NIC firmware-related definitions
[linux-2.6-microblaze.git] / drivers / misc / habanalabs / include / gaudi / gaudi_fw_if.h
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 enum gaudi_pll_index {
24         CPU_PLL = 0,
25         PCI_PLL,
26         SRAM_PLL,
27         HBM_PLL,
28         NIC_PLL,
29         DMA_PLL,
30         MESH_PLL,
31         MME_PLL,
32         TPC_PLL,
33         IF_PLL
34 };
35
36 enum gaudi_nic_axi_error {
37         RXB,
38         RXE,
39         TXS,
40         TXE,
41         QPC_RESP,
42         NON_AXI_ERR,
43 };
44
45 /*
46  * struct eq_nic_sei_event - describes an AXI error cause.
47  * @axi_error_cause: one of the events defined in enum gaudi_nic_axi_error.
48  * @id: can be either 0 or 1, to further describe unit with interrupt cause
49  *      (i.e. TXE0 or TXE1).
50  * @pad[6]: padding structure to 64bit.
51  */
52 struct eq_nic_sei_event {
53         __u8 axi_error_cause;
54         __u8 id;
55         __u8 pad[6];
56 };
57
58 #define GAUDI_PLL_FREQ_LOW              200000000 /* 200 MHz */
59
60 #endif /* GAUDI_FW_IF_H */