f6b0a2d2e51af145faf3f4b0998b7d404b7a2f0b
[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,
72                              u32               rt_offset,
73                              u32               val);
74
75 #define STORE_RT_REG(hwfn, offset, val)                         \
76         ecore_init_store_rt_reg(hwfn, offset, val)
77
78 #define OVERWRITE_RT_REG(hwfn, offset, val)                     \
79         ecore_init_store_rt_reg(hwfn, offset, val)
80
81 /**
82 * @brief
83 *
84 *
85 * @param p_hwfn
86 * @param rt_offset
87 * @param val
88 * @param size
89 */
90
91 void ecore_init_store_rt_agg(struct ecore_hwfn *p_hwfn,
92                              u32               rt_offset,
93                              u32               *val,
94                              osal_size_t       size);
95
96 #define STORE_RT_REG_AGG(hwfn, offset, val)                     \
97         ecore_init_store_rt_agg(hwfn, offset, (u32 *)&val, sizeof(val))
98
99 /**
100  * @brief
101  *      Initialize GTT global windows and set admin window
102  *      related params of GTT/PTT to default values.
103  *
104  * @param p_hwfn
105  */
106 void ecore_gtt_init(struct ecore_hwfn *p_hwfn);
107 #endif /* __ECORE_INIT_OPS__ */