[golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support
[ipxe.git] / src / drivers / infiniband / mlx_nodnic / include / mlx_device.h
1 #ifndef NODNIC_DEVICE_H_
2 #define NODNIC_DEVICE_H_
3
4 /*
5 * Copyright (C) 2015 Mellanox Technologies Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 FILE_LICENCE ( GPL2_OR_LATER );
24
25 #include "mlx_nodnic_data_structures.h"
26
27 #define NODIC_SUPPORTED_REVISION 1
28 //Initialization segment
29 #define NODNIC_CMDQ_PHY_ADDR_HIGH_OFFSET 0x10
30 #define NODNIC_CMDQ_PHY_ADDR_LOW_OFFSET 0x14
31 #define NODNIC_NIC_INTERFACE_OFFSET 0x14
32 #define NODNIC_INITIALIZING_OFFSET 0x1fc
33 #define NODNIC_NIC_INTERFACE_SUPPORTED_OFFSET 0x1fc
34 #define NODNIC_LOCATION_OFFSET 0x240
35
36 #define NODNIC_CMDQ_PHY_ADDR_LOW_MASK 0xFFFFE000
37 #define NODNIC_NIC_INTERFACE_SUPPORTED_MASK 0x4000000
38
39 #define NODNIC_NIC_INTERFACE_BIT 9
40 #define NODNIC_DISABLE_INTERFACE_BIT 8
41 #define NODNIC_NIC_INTERFACE_SUPPORTED_BIT 26
42 #define NODNIC_INITIALIZING_BIT 31
43
44 #define NODNIC_NIC_DISABLE_INT_OFFSET 0x100c
45
46 //nodnic segment
47 #define NODNIC_REVISION_OFFSET 0x0
48 #define NODNIC_HARDWARE_FORMAT_OFFSET 0x0
49
50
51
52 mlx_status
53 nodnic_device_init(
54 IN nodnic_device_priv *device_priv
55 );
56
57 mlx_status
58 nodnic_device_teardown(
59 IN nodnic_device_priv *device_priv
60 );
61
62
63 mlx_status
64 nodnic_device_get_cap(
65 IN nodnic_device_priv *device_priv
66 );
67
68 mlx_status
69 nodnic_device_clear_int (
70 IN nodnic_device_priv *device_priv
71 );
72
73 mlx_status
74 nodnic_device_get_fw_version(
75 IN nodnic_device_priv *device_priv,
76 OUT mlx_uint16 *fw_ver_minor,
77 OUT mlx_uint16 *fw_ver_sub_minor,
78 OUT mlx_uint16 *fw_ver_major
79 );
80 #endif /* STUB_NODNIC_DEVICE_H_ */