1*14b24e2bSVaishali Kulkarni /*
2*14b24e2bSVaishali Kulkarni * CDDL HEADER START
3*14b24e2bSVaishali Kulkarni *
4*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the
5*14b24e2bSVaishali Kulkarni * Common Development and Distribution License, v.1,  (the "License").
6*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
7*14b24e2bSVaishali Kulkarni *
8*14b24e2bSVaishali Kulkarni * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*14b24e2bSVaishali Kulkarni * or http://opensource.org/licenses/CDDL-1.0.
10*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions
11*14b24e2bSVaishali Kulkarni * and limitations under the License.
12*14b24e2bSVaishali Kulkarni *
13*14b24e2bSVaishali Kulkarni * When distributing Covered Code, include this CDDL HEADER in each
14*14b24e2bSVaishali Kulkarni * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*14b24e2bSVaishali Kulkarni * If applicable, add the following below this CDDL HEADER, with the
16*14b24e2bSVaishali Kulkarni * fields enclosed by brackets "[]" replaced with your own identifying
17*14b24e2bSVaishali Kulkarni * information: Portions Copyright [yyyy] [name of copyright owner]
18*14b24e2bSVaishali Kulkarni *
19*14b24e2bSVaishali Kulkarni * CDDL HEADER END
20*14b24e2bSVaishali Kulkarni */
21*14b24e2bSVaishali Kulkarni 
22*14b24e2bSVaishali Kulkarni /*
23*14b24e2bSVaishali Kulkarni * Copyright 2014-2017 Cavium, Inc.
24*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the Common Development
25*14b24e2bSVaishali Kulkarni * and Distribution License, v.1,  (the "License").
26*14b24e2bSVaishali Kulkarni 
27*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
28*14b24e2bSVaishali Kulkarni 
29*14b24e2bSVaishali Kulkarni * You can obtain a copy of the License at available
30*14b24e2bSVaishali Kulkarni * at http://opensource.org/licenses/CDDL-1.0
31*14b24e2bSVaishali Kulkarni 
32*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions and
33*14b24e2bSVaishali Kulkarni * limitations under the License.
34*14b24e2bSVaishali Kulkarni */
35*14b24e2bSVaishali Kulkarni 
36*14b24e2bSVaishali Kulkarni #ifndef __ECORE_INIT_OPS__
37*14b24e2bSVaishali Kulkarni #define __ECORE_INIT_OPS__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #include "ecore.h"
40*14b24e2bSVaishali Kulkarni 
41*14b24e2bSVaishali Kulkarni /**
42*14b24e2bSVaishali Kulkarni  * @brief ecore_init_iro_array - init iro_arr.
43*14b24e2bSVaishali Kulkarni  *
44*14b24e2bSVaishali Kulkarni  *
45*14b24e2bSVaishali Kulkarni  * @param p_dev
46*14b24e2bSVaishali Kulkarni  */
47*14b24e2bSVaishali Kulkarni void ecore_init_iro_array(struct ecore_dev *p_dev);
48*14b24e2bSVaishali Kulkarni 
49*14b24e2bSVaishali Kulkarni /**
50*14b24e2bSVaishali Kulkarni  * @brief ecore_init_run - Run the init-sequence.
51*14b24e2bSVaishali Kulkarni  *
52*14b24e2bSVaishali Kulkarni  *
53*14b24e2bSVaishali Kulkarni  * @param p_hwfn
54*14b24e2bSVaishali Kulkarni  * @param p_ptt
55*14b24e2bSVaishali Kulkarni  * @param phase
56*14b24e2bSVaishali Kulkarni  * @param phase_id
57*14b24e2bSVaishali Kulkarni  * @param modes
58*14b24e2bSVaishali Kulkarni  * @return _ecore_status_t
59*14b24e2bSVaishali Kulkarni  */
60*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_init_run(struct ecore_hwfn *p_hwfn,
61*14b24e2bSVaishali Kulkarni 				    struct ecore_ptt  *p_ptt,
62*14b24e2bSVaishali Kulkarni 				    int               phase,
63*14b24e2bSVaishali Kulkarni 				    int               phase_id,
64*14b24e2bSVaishali Kulkarni 				    int               modes);
65*14b24e2bSVaishali Kulkarni 
66*14b24e2bSVaishali Kulkarni /**
67*14b24e2bSVaishali Kulkarni  * @brief ecore_init_hwfn_allocate - Allocate RT array, Store 'values' ptrs.
68*14b24e2bSVaishali Kulkarni  *
69*14b24e2bSVaishali Kulkarni  *
70*14b24e2bSVaishali Kulkarni  * @param p_hwfn
71*14b24e2bSVaishali Kulkarni  *
72*14b24e2bSVaishali Kulkarni  * @return _ecore_status_t
73*14b24e2bSVaishali Kulkarni  */
74*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_init_alloc(struct ecore_hwfn *p_hwfn);
75*14b24e2bSVaishali Kulkarni 
76*14b24e2bSVaishali Kulkarni /**
77*14b24e2bSVaishali Kulkarni  * @brief ecore_init_hwfn_deallocate
78*14b24e2bSVaishali Kulkarni  *
79*14b24e2bSVaishali Kulkarni  *
80*14b24e2bSVaishali Kulkarni  * @param p_hwfn
81*14b24e2bSVaishali Kulkarni  */
82*14b24e2bSVaishali Kulkarni void ecore_init_free(struct ecore_hwfn *p_hwfn);
83*14b24e2bSVaishali Kulkarni 
84*14b24e2bSVaishali Kulkarni 
85*14b24e2bSVaishali Kulkarni /**
86*14b24e2bSVaishali Kulkarni  * @brief ecore_init_clear_rt_data - Clears the runtime init array.
87*14b24e2bSVaishali Kulkarni  *
88*14b24e2bSVaishali Kulkarni  *
89*14b24e2bSVaishali Kulkarni  * @param p_hwfn
90*14b24e2bSVaishali Kulkarni  */
91*14b24e2bSVaishali Kulkarni void ecore_init_clear_rt_data(struct ecore_hwfn *p_hwfn);
92*14b24e2bSVaishali Kulkarni 
93*14b24e2bSVaishali Kulkarni /**
94*14b24e2bSVaishali Kulkarni  * @brief ecore_init_store_rt_reg - Store a configuration value in the RT array.
95*14b24e2bSVaishali Kulkarni  *
96*14b24e2bSVaishali Kulkarni  *
97*14b24e2bSVaishali Kulkarni  * @param p_hwfn
98*14b24e2bSVaishali Kulkarni  * @param rt_offset
99*14b24e2bSVaishali Kulkarni  * @param val
100*14b24e2bSVaishali Kulkarni  */
101*14b24e2bSVaishali Kulkarni void ecore_init_store_rt_reg(struct ecore_hwfn *p_hwfn,
102*14b24e2bSVaishali Kulkarni 			     u32               	rt_offset,
103*14b24e2bSVaishali Kulkarni 			     u32               	val);
104*14b24e2bSVaishali Kulkarni 
105*14b24e2bSVaishali Kulkarni #define STORE_RT_REG(hwfn, offset, val)				\
106*14b24e2bSVaishali Kulkarni 	ecore_init_store_rt_reg(hwfn, offset, val)
107*14b24e2bSVaishali Kulkarni 
108*14b24e2bSVaishali Kulkarni #define OVERWRITE_RT_REG(hwfn, offset, val)			\
109*14b24e2bSVaishali Kulkarni 	ecore_init_store_rt_reg(hwfn, offset, val)
110*14b24e2bSVaishali Kulkarni 
111*14b24e2bSVaishali Kulkarni /**
112*14b24e2bSVaishali Kulkarni * @brief
113*14b24e2bSVaishali Kulkarni *
114*14b24e2bSVaishali Kulkarni *
115*14b24e2bSVaishali Kulkarni * @param p_hwfn
116*14b24e2bSVaishali Kulkarni * @param rt_offset
117*14b24e2bSVaishali Kulkarni * @param val
118*14b24e2bSVaishali Kulkarni * @param size
119*14b24e2bSVaishali Kulkarni */
120*14b24e2bSVaishali Kulkarni 
121*14b24e2bSVaishali Kulkarni void ecore_init_store_rt_agg(struct ecore_hwfn *p_hwfn,
122*14b24e2bSVaishali Kulkarni 			     u32               rt_offset,
123*14b24e2bSVaishali Kulkarni 			     u32               *val,
124*14b24e2bSVaishali Kulkarni 			     osal_size_t       size);
125*14b24e2bSVaishali Kulkarni 
126*14b24e2bSVaishali Kulkarni #define STORE_RT_REG_AGG(hwfn, offset, val)			\
127*14b24e2bSVaishali Kulkarni 	ecore_init_store_rt_agg(hwfn, offset, (u32*)&val, sizeof(val))
128*14b24e2bSVaishali Kulkarni 
129*14b24e2bSVaishali Kulkarni 
130*14b24e2bSVaishali Kulkarni /**
131*14b24e2bSVaishali Kulkarni  * @brief
132*14b24e2bSVaishali Kulkarni  *      Initialize GTT global windows and set admin window
133*14b24e2bSVaishali Kulkarni  *      related params of GTT/PTT to default values.
134*14b24e2bSVaishali Kulkarni  *
135*14b24e2bSVaishali Kulkarni  * @param p_hwfn
136*14b24e2bSVaishali Kulkarni  */
137*14b24e2bSVaishali Kulkarni void ecore_gtt_init(struct ecore_hwfn *p_hwfn);
138*14b24e2bSVaishali Kulkarni #endif /* __ECORE_INIT_OPS__ */