5
5
/* */
6
6
/* OpenPOWER HostBoot Project */
7
7
/* */
8
- /* Contributors Listed Below - COPYRIGHT 2016 */
8
+ /* Contributors Listed Below - COPYRIGHT 2016,2017 */
9
9
/* [+] International Business Machines Corp. */
10
10
/* */
11
11
/* */
29
29
/// *HWP HWP Owner: Joe McGill <jmcgill@us.ibm.com>
30
30
/// *HWP FW Owner: Thi Tran <thi@us.ibm.com>
31
31
/// *HWP Team: Nest
32
- /// *HWP Level: 2
32
+ /// *HWP Level: 3
33
33
/// *HWP Consumed by: HB,FSP
34
34
///
35
35
46
46
47
47
/// @brief Determine link address/data & aggregation settings
48
48
///
49
+ /// @param[in] i_target Chip target
49
50
/// @param[in] i_max_links Size of input/output arrays
50
51
/// @param[in] i_en Set of local link enables (index = local link ID)
51
52
/// @param[in] i_loc_fbc_id Local chip fabric ID
58
59
///
59
60
/// @return fapi2:ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
60
61
fapi2 ::ReturnCode p9_fbc_eff_config_aggregate_link_setup (
62
+ const fapi2 ::Target < fapi2 ::TARGET_TYPE_PROC_CHIP > & i_target ,
61
63
const uint8_t i_max_links ,
62
64
const uint8_t i_en [],
63
65
const uint8_t i_loc_fbc_id ,
@@ -72,6 +74,7 @@ fapi2::ReturnCode p9_fbc_eff_config_aggregate_link_setup(
72
74
// mark number of links targeting each fabric ID
73
75
// set output defaults to disable aggregate mode (all links carry coherent traffic)
74
76
uint8_t l_fbc_id_active_count [P9_FBC_UTILS_NUM_CHIP_IDS ] = { 0 };
77
+ uint8_t l_aggregate_rem_fbc_id ;
75
78
76
79
for (uint8_t l_loc_link_id = 0 ; l_loc_link_id < i_max_links ; l_loc_link_id ++ )
77
80
{
@@ -94,9 +97,15 @@ fapi2::ReturnCode p9_fbc_eff_config_aggregate_link_setup(
94
97
{
95
98
// only one set of aggregate links are supported
96
99
FAPI_ASSERT (!o_aggregate_mode ,
97
- fapi2 ::P9_FBC_EFF_CONFIG_AGGREGATE_INVALID_CONFIG_ERR (),
100
+ fapi2 ::P9_FBC_EFF_CONFIG_AGGREGATE_INVALID_CONFIG_ERR ().
101
+ set_TARGET (i_target ).
102
+ set_NUM_LINKS (i_max_links ).
103
+ set_LOCAL_FBC_ID (i_loc_fbc_id ).
104
+ set_REMOTE_FBC_ID1 (l_aggregate_rem_fbc_id ).
105
+ set_REMOTE_FBC_ID2 (l_rem_fbc_id ),
98
106
"Invalid aggregate link configuration!" );
99
107
o_aggregate_mode = 1 ;
108
+ l_aggregate_rem_fbc_id = l_rem_fbc_id ;
100
109
101
110
// flip default value for link address disable
102
111
for (uint8_t l_loc_link_id = 0 ; l_loc_link_id < i_max_links ; l_loc_link_id ++ )
@@ -134,7 +143,6 @@ fapi2::ReturnCode p9_fbc_eff_config_aggregate_link_setup(
134
143
// ties must be broken consistenty on both connected chips (i.e., we
135
144
// need to pick both ends of the same link to carry coherency
136
145
// select link with lowest link ID number on chip with smaller fabric ID
137
- // (chip ID if X links, group ID if A links)
138
146
if (l_matches != 1 )
139
147
{
140
148
FAPI_DBG ("Breaking tie" );
@@ -193,8 +201,7 @@ p9_fbc_eff_config_aggregate(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i
193
201
uint8_t l_loc_fbc_chip_id ;
194
202
uint8_t l_loc_fbc_group_id ;
195
203
196
- // logical link (X/A) configuration parameters
197
- // arrays indexed by link ID on local end
204
+ // logical link (X/A) configuration parameters, arrays indexed by link ID on local end
198
205
// enable on local end
199
206
uint8_t l_x_en [P9_FBC_UTILS_MAX_X_LINKS ];
200
207
uint8_t l_a_en [P9_FBC_UTILS_MAX_A_LINKS ];
@@ -206,7 +213,7 @@ p9_fbc_eff_config_aggregate(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i
206
213
// aggregate (local+remote) delays
207
214
uint32_t l_x_agg_link_delay [P9_FBC_UTILS_MAX_X_LINKS ];
208
215
uint32_t l_a_agg_link_delay [P9_FBC_UTILS_MAX_A_LINKS ];
209
- // aggregate model /address disable on local end
216
+ // aggregate mode /address disable on local end
210
217
uint8_t l_x_addr_dis [P9_FBC_UTILS_MAX_X_LINKS ];
211
218
uint8_t l_x_aggregate ;
212
219
uint8_t l_a_addr_dis [P9_FBC_UTILS_MAX_A_LINKS ];
@@ -262,6 +269,7 @@ p9_fbc_eff_config_aggregate(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i
262
269
263
270
// calculate aggregate configuration
264
271
FAPI_TRY (p9_fbc_eff_config_aggregate_link_setup (
272
+ i_target ,
265
273
P9_FBC_UTILS_MAX_X_LINKS ,
266
274
l_x_en ,
267
275
(l_pump_mode == fapi2 ::ENUM_ATTR_PROC_FABRIC_PUMP_MODE_CHIP_IS_NODE ) ? (l_loc_fbc_chip_id ) : (l_loc_fbc_group_id ),
@@ -272,14 +280,16 @@ p9_fbc_eff_config_aggregate(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i
272
280
l_x_addr_dis ),
273
281
"Error from p9_fbc_eff_config_aggregate_link_setup (X)" );
274
282
275
- FAPI_TRY (p9_fbc_eff_config_aggregate_link_setup (P9_FBC_UTILS_MAX_A_LINKS ,
276
- l_a_en ,
277
- l_loc_fbc_group_id ,
278
- l_a_rem_link_id ,
279
- l_a_rem_fbc_group_id ,
280
- l_a_agg_link_delay ,
281
- l_a_aggregate ,
282
- l_a_addr_dis ),
283
+ FAPI_TRY (p9_fbc_eff_config_aggregate_link_setup (
284
+ i_target ,
285
+ P9_FBC_UTILS_MAX_A_LINKS ,
286
+ l_a_en ,
287
+ l_loc_fbc_group_id ,
288
+ l_a_rem_link_id ,
289
+ l_a_rem_fbc_group_id ,
290
+ l_a_agg_link_delay ,
291
+ l_a_aggregate ,
292
+ l_a_addr_dis ),
283
293
"Error from p9_fbc_eff_config_aggregate_link_setup (A)" );
284
294
285
295
// set attributes
0 commit comments