Imported Upstream version 16.07-rc1
[deb_dpdk.git] / drivers / net / qede / base / ecore_init_ops.h
1 /*
2  * Copyright (c) 2016 QLogic Corporation.
3  * All rights reserved.
4  * www.qlogic.com
5  *
6  * See LICENSE.qede_pmd for copyright and licensing details.
7  */
8
9 #ifndef __ECORE_INIT_OPS__
10 #define __ECORE_INIT_OPS__
11
12 #include "ecore.h"
13
14 /**
15  * @brief ecore_init_iro_array - init iro_arr.
16  *
17  *
18  * @param p_dev
19  */
20 void ecore_init_iro_array(struct ecore_dev *p_dev);
21
22 /**
23  * @brief ecore_init_run - Run the init-sequence.
24  *
25  *
26  * @param p_hwfn
27  * @param p_ptt
28  * @param phase
29  * @param phase_id
30  * @param modes
31  * @return _ecore_status_t
32  */
33 enum _ecore_status_t ecore_init_run(struct ecore_hwfn *p_hwfn,
34                                     struct ecore_ptt *p_ptt,
35                                     int phase, int phase_id, int modes);
36
37 /**
38  * @brief ecore_init_hwfn_allocate - Allocate RT array, Store 'values' ptrs.
39  *
40  *
41  * @param p_hwfn
42  *
43  * @return _ecore_status_t
44  */
45 enum _ecore_status_t ecore_init_alloc(struct ecore_hwfn *p_hwfn);
46
47 /**
48  * @brief ecore_init_hwfn_deallocate
49  *
50  *
51  * @param p_hwfn
52  */
53 void ecore_init_free(struct ecore_hwfn *p_hwfn);
54
55 /**
56  * @brief ecore_init_clear_rt_data - Clears the runtime init array.
57  *
58  *
59  * @param p_hwfn
60  */
61 void ecore_init_clear_rt_data(struct ecore_hwfn *p_hwfn);
62
63 /**
64  * @brief ecore_init_store_rt_reg - Store a configuration value in the RT array.
65  *
66  *
67  * @param p_hwfn
68  * @param rt_offset
69  * @param val
70  */
71 void ecore_init_store_rt_reg(struct ecore_hwfn *p_hwfn, u32 rt_offset, u32 val);
72
73 #define STORE_RT_REG(hwfn, offset, val)                         \
74         ecore_init_store_rt_reg(hwfn, offset, val)
75
76 #define OVERWRITE_RT_REG(hwfn, offset, val)                     \
77         ecore_init_store_rt_reg(hwfn, offset, val)
78
79 /**
80 * @brief
81 *
82 *
83 * @param p_hwfn
84 * @param rt_offset
85 * @param val
86 * @param size
87 */
88
89 void ecore_init_store_rt_agg(struct ecore_hwfn *p_hwfn,
90                              u32 rt_offset, u32 *val, osal_size_t size);
91
92 #define STORE_RT_REG_AGG(hwfn, offset, val)                     \
93         ecore_init_store_rt_agg(hwfn, offset, (u32 *)&val, sizeof(val))
94
95 /**
96  * @brief
97  *      Initialize GTT global windows and set admin window
98  *      related params of GTT/PTT to default values.
99  *
100  * @param p_hwfn
101  */
102 void ecore_gtt_init(struct ecore_hwfn *p_hwfn);
103 #endif /* __ECORE_INIT_OPS__ */