2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 #ifndef _SCIC_SDS_USER_PARAMETERS_H_
55 #define _SCIC_SDS_USER_PARAMETERS_H_
60 * @brief This file contains all of the structure definitions and interface
61 * methods that can be called by a SCIC user on the SCU Driver
62 * Standard (SCIC_SDS_USER_PARAMETERS_T) user parameter block.
69 #include <dev/isci/scil/sci_types.h>
70 #include <dev/isci/scil/sci_status.h>
71 #include <dev/isci/scil/intel_sas.h>
72 #include <dev/isci/scil/sci_controller_constants.h>
73 #include <dev/isci/scil/scu_bios_definitions.h>
76 * @name SCIC_SDS_PARM_PHY_SPEED
78 * These constants define the speeds utilized for a phy/port.
81 #define SCIC_SDS_PARM_NO_SPEED 0
84 * This value of 1 indicates generation 1 (i.e. 1.5 Gb/s).
86 #define SCIC_SDS_PARM_GEN1_SPEED 1
89 * This value of 2 indicates generation 2 (i.e. 3.0 Gb/s).
91 #define SCIC_SDS_PARM_GEN2_SPEED 2
94 * This value of 3 indicates generation 3 (i.e. 6.0 Gb/s).
96 #define SCIC_SDS_PARM_GEN3_SPEED 3
99 * For range checks, the max speed generation
101 #define SCIC_SDS_PARM_MAX_SPEED SCIC_SDS_PARM_GEN3_SPEED
105 * @struct SCIC_SDS_USER_PARAMETERS
107 * @brief This structure delineates the various user parameters that can be
108 * changed by the core user.
110 typedef struct SCIC_SDS_USER_PARAMETERS
115 * This field specifies the NOTIFY (ENABLE SPIN UP) primitive
116 * insertion frequency for this phy index.
118 U32 notify_enable_spin_up_insertion_frequency;
121 * This method specifies the number of transmitted DWORDs within which
122 * to transmit a single ALIGN primitive. This value applies regardless
123 * of what type of device is attached or connection state. A value of
124 * 0 indicates that no ALIGN primitives will be inserted.
126 U16 align_insertion_frequency;
129 * This method specifies the number of transmitted DWORDs within which
130 * to transmit 2 ALIGN primitives. This applies for SAS connections
131 * only. A minimum value of 3 is required for this field.
133 U16 in_connection_align_insertion_frequency;
136 * This field indicates the maximum speed generation to be utilized
137 * by phys in the supplied port.
138 * - A value of 1 indicates generation 1 (i.e. 1.5 Gb/s).
139 * - A value of 2 indicates generation 2 (i.e. 3.0 Gb/s).
140 * - A value of 3 indicates generation 3 (i.e. 6.0 Gb/s).
142 U8 max_speed_generation;
144 } phys[SCI_MAX_PHYS];
148 * This field specifies the number of seconds to allow a phy to consume
149 * power before yielding to another phy.
152 U8 phy_spin_up_delay_interval;
155 * These timer values specifies how long a link will remain open with no
156 * activity in increments of a microsecond, it can be in increments of
157 * 100 microseconds if the upper most bit is set.
160 U16 stp_inactivity_timeout;
161 U16 ssp_inactivity_timeout;
164 * These timer values specifies how long a link will remain open in increments
165 * of 100 microseconds.
168 U16 stp_max_occupancy_timeout;
169 U16 ssp_max_occupancy_timeout;
172 * This timer value specifies how long a link will remain open with no
173 * outbound traffic in increments of a microsecond.
176 U8 no_outbound_task_timeout;
178 } SCIC_SDS_USER_PARAMETERS_T;
181 * @union SCIC_USER_PARAMETERS
182 * @brief This structure/union specifies the various different user
183 * parameter sets available. Each type is specific to a hardware
184 * controller version.
186 typedef union SCIC_USER_PARAMETERS
189 * This field specifies the user parameters specific to the
190 * Storage Controller Unit (SCU) Driver Standard (SDS) version
193 SCIC_SDS_USER_PARAMETERS_T sds1;
195 } SCIC_USER_PARAMETERS_T;
199 * @name SCIC_SDS_OEM_PHY_MASK
201 * These constants define the valid values for phy_mask
206 * This is the min value assignable to a port's phy mask
208 #define SCIC_SDS_PARM_PHY_MASK_MIN 0x0
211 * This is the max value assignable to a port's phy mask
213 #define SCIC_SDS_PARM_PHY_MASK_MAX 0xF
216 #define MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT 4
218 typedef SCI_BIOS_OEM_PARAM_ELEMENT_v_1_3_T SCIC_SDS_OEM_PARAMETERS_T;
221 * @union SCIC_OEM_PARAMETERS
223 * @brief This structure/union specifies the various different OEM
224 * parameter sets available. Each type is specific to a hardware
225 * controller version.
227 typedef union SCIC_OEM_PARAMETERS
230 * This field specifies the OEM parameters specific to the
231 * Storage Controller Unit (SCU) Driver Standard (SDS) version
234 SCIC_SDS_OEM_PARAMETERS_T sds1;
236 } SCIC_OEM_PARAMETERS_T;
239 * @union OEM_SSC_DATA
241 * @brief This typedef provides a means to convert from the original
242 * 1.0 version of the OEM PARAMETER do_enable_ssc to the more
243 * comprehensive 1.1 version of enabling SSC parameters.
244 * For the definition of the field members see scu_bios_definitions.h
245 * header file or refer to the SCU BIOS Writers Guide.
247 typedef union OEM_SSC_PARAMETERS
251 U8 ssc_sata_tx_spread_level : 4;
252 U8 ssc_sas_tx_spread_level : 3;
253 U8 ssc_sas_tx_type : 1;
258 } OEM_SSC_PARAMETERS_T;
261 * @brief This method allows the user to attempt to change the user
262 * parameters utilized by the controller.
264 * @param[in] controller This parameter specifies the controller on which
265 * to set the user parameters.
266 * @param[in] user_parameters This parameter specifies the USER_PARAMETERS
267 * object containing the potential new values.
269 * @return Indicate if the update of the user parameters was successful.
270 * @retval SCI_SUCCESS This value is returned if the operation succeeded.
271 * @retval SCI_FAILURE_INVALID_STATE This value is returned if the attempt
272 * to change the user parameter failed, because changing one of
273 * the parameters is not currently allowed.
274 * @retval SCI_FAILURE_INVALID_PARAMETER_VALUE This value is returned if the
275 * user supplied an invalid interrupt coalescence time, spin up
276 * delay interval, etc.
278 SCI_STATUS scic_user_parameters_set(
279 SCI_CONTROLLER_HANDLE_T controller,
280 SCIC_USER_PARAMETERS_T * user_parameters
284 * @brief This method allows the user to retrieve the user parameters
285 * utilized by the controller.
287 * @param[in] controller This parameter specifies the controller on which
288 * to set the user parameters.
289 * @param[in] user_parameters This parameter specifies the USER_PARAMETERS
290 * object into which the framework shall save it's parameters.
294 void scic_user_parameters_get(
295 SCI_CONTROLLER_HANDLE_T controller,
296 SCIC_USER_PARAMETERS_T * user_parameters
300 * @brief This method allows the user to attempt to change the OEM
301 * parameters utilized by the controller.
303 * @param[in] controller This parameter specifies the controller on which
304 * to set the user parameters.
305 * @param[in] oem_parameters This parameter specifies the OEM parameters
306 * object containing the potential new values.
307 * @param[in] oem_parameters_version This parameter is the OEM block version
308 * value indicating the format of the data associated with
311 * @return Indicate if the update of the user parameters was successful.
312 * @retval SCI_SUCCESS This value is returned if the operation succeeded.
313 * @retval SCI_FAILURE_INVALID_STATE This value is returned if the attempt
314 * to change the user parameter failed, because changing one of
315 * the parameters is not currently allowed.
316 * @retval SCI_FAILURE_INVALID_PARAMETER_VALUE This value is returned if the
317 * user supplied an unsupported value for one of the OEM parameters.
319 SCI_STATUS scic_oem_parameters_set(
320 SCI_CONTROLLER_HANDLE_T controller,
321 SCIC_OEM_PARAMETERS_T * oem_parameters,
322 U8 oem_parameters_version
326 * @brief This method allows the user to retreive the OEM
327 * parameters utilized by the controller.
329 * @param[in] controller This parameter specifies the controller on which
330 * to set the user parameters.
331 * @param[out] oem_parameters This parameter specifies the OEM parameters
332 * object in which to write the core's OEM parameters.
336 void scic_oem_parameters_get(
337 SCI_CONTROLLER_HANDLE_T controller,
338 SCIC_OEM_PARAMETERS_T * oem_parameters
343 #endif // __cplusplus
345 #endif // _SCIC_SDS_USER_PARAMETERS_H_