2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 * The full GNU General Public License is included in this distribution
24 * in the file called LICENSE.GPL.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
35 * * Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in
39 * the documentation and/or other materials provided with the
42 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 #ifndef _SCIC_SDS_USER_PARAMETERS_H_
57 #define _SCIC_SDS_USER_PARAMETERS_H_
62 * @brief This file contains all of the structure definitions and interface
63 * methods that can be called by a SCIC user on the SCU Driver
64 * Standard (SCIC_SDS_USER_PARAMETERS_T) user parameter block.
71 #include <dev/isci/scil/sci_types.h>
72 #include <dev/isci/scil/sci_status.h>
73 #include <dev/isci/scil/intel_sas.h>
74 #include <dev/isci/scil/sci_controller_constants.h>
75 #include <dev/isci/scil/scu_bios_definitions.h>
78 * @name SCIC_SDS_PARM_PHY_SPEED
80 * These constants define the speeds utilized for a phy/port.
83 #define SCIC_SDS_PARM_NO_SPEED 0
86 * This value of 1 indicates generation 1 (i.e. 1.5 Gb/s).
88 #define SCIC_SDS_PARM_GEN1_SPEED 1
91 * This value of 2 indicates generation 2 (i.e. 3.0 Gb/s).
93 #define SCIC_SDS_PARM_GEN2_SPEED 2
96 * This value of 3 indicates generation 3 (i.e. 6.0 Gb/s).
98 #define SCIC_SDS_PARM_GEN3_SPEED 3
101 * For range checks, the max speed generation
103 #define SCIC_SDS_PARM_MAX_SPEED SCIC_SDS_PARM_GEN3_SPEED
107 * @struct SCIC_SDS_USER_PARAMETERS
109 * @brief This structure delineates the various user parameters that can be
110 * changed by the core user.
112 typedef struct SCIC_SDS_USER_PARAMETERS
117 * This field specifies the NOTIFY (ENABLE SPIN UP) primitive
118 * insertion frequency for this phy index.
120 U32 notify_enable_spin_up_insertion_frequency;
123 * This method specifies the number of transmitted DWORDs within which
124 * to transmit a single ALIGN primitive. This value applies regardless
125 * of what type of device is attached or connection state. A value of
126 * 0 indicates that no ALIGN primitives will be inserted.
128 U16 align_insertion_frequency;
131 * This method specifies the number of transmitted DWORDs within which
132 * to transmit 2 ALIGN primitives. This applies for SAS connections
133 * only. A minimum value of 3 is required for this field.
135 U16 in_connection_align_insertion_frequency;
138 * This field indicates the maximum speed generation to be utilized
139 * by phys in the supplied port.
140 * - A value of 1 indicates generation 1 (i.e. 1.5 Gb/s).
141 * - A value of 2 indicates generation 2 (i.e. 3.0 Gb/s).
142 * - A value of 3 indicates generation 3 (i.e. 6.0 Gb/s).
144 U8 max_speed_generation;
146 } phys[SCI_MAX_PHYS];
150 * This field specifies the number of seconds to allow a phy to consume
151 * power before yielding to another phy.
154 U8 phy_spin_up_delay_interval;
157 * These timer values specifies how long a link will remain open with no
158 * activity in increments of a microsecond, it can be in increments of
159 * 100 microseconds if the upper most bit is set.
162 U16 stp_inactivity_timeout;
163 U16 ssp_inactivity_timeout;
166 * These timer values specifies how long a link will remain open in increments
167 * of 100 microseconds.
170 U16 stp_max_occupancy_timeout;
171 U16 ssp_max_occupancy_timeout;
174 * This timer value specifies how long a link will remain open with no
175 * outbound traffic in increments of a microsecond.
178 U8 no_outbound_task_timeout;
180 } SCIC_SDS_USER_PARAMETERS_T;
183 * @union SCIC_USER_PARAMETERS
184 * @brief This structure/union specifies the various different user
185 * parameter sets available. Each type is specific to a hardware
186 * controller version.
188 typedef union SCIC_USER_PARAMETERS
191 * This field specifies the user parameters specific to the
192 * Storage Controller Unit (SCU) Driver Standard (SDS) version
195 SCIC_SDS_USER_PARAMETERS_T sds1;
197 } SCIC_USER_PARAMETERS_T;
201 * @name SCIC_SDS_OEM_PHY_MASK
203 * These constants define the valid values for phy_mask
208 * This is the min value assignable to a port's phy mask
210 #define SCIC_SDS_PARM_PHY_MASK_MIN 0x0
213 * This is the max value assignable to a port's phy mask
215 #define SCIC_SDS_PARM_PHY_MASK_MAX 0xF
218 #define MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT 4
220 typedef SCI_BIOS_OEM_PARAM_ELEMENT_v_1_3_T SCIC_SDS_OEM_PARAMETERS_T;
223 * @union SCIC_OEM_PARAMETERS
225 * @brief This structure/union specifies the various different OEM
226 * parameter sets available. Each type is specific to a hardware
227 * controller version.
229 typedef union SCIC_OEM_PARAMETERS
232 * This field specifies the OEM parameters specific to the
233 * Storage Controller Unit (SCU) Driver Standard (SDS) version
236 SCIC_SDS_OEM_PARAMETERS_T sds1;
238 } SCIC_OEM_PARAMETERS_T;
241 * @union OEM_SSC_DATA
243 * @brief This typedef provides a means to convert from the original
244 * 1.0 version of the OEM PARAMETER do_enable_ssc to the more
245 * comprehensive 1.1 version of enabling SSC parameters.
246 * For the definition of the field members see scu_bios_definitions.h
247 * header file or refer to the SCU BIOS Writers Guide.
249 typedef union OEM_SSC_PARAMETERS
253 U8 ssc_sata_tx_spread_level : 4;
254 U8 ssc_sas_tx_spread_level : 3;
255 U8 ssc_sas_tx_type : 1;
260 } OEM_SSC_PARAMETERS_T;
263 * @brief This method allows the user to attempt to change the user
264 * parameters utilized by the controller.
266 * @param[in] controller This parameter specifies the controller on which
267 * to set the user parameters.
268 * @param[in] user_parameters This parameter specifies the USER_PARAMETERS
269 * object containing the potential new values.
271 * @return Indicate if the update of the user parameters was successful.
272 * @retval SCI_SUCCESS This value is returned if the operation succeeded.
273 * @retval SCI_FAILURE_INVALID_STATE This value is returned if the attempt
274 * to change the user parameter failed, because changing one of
275 * the parameters is not currently allowed.
276 * @retval SCI_FAILURE_INVALID_PARAMETER_VALUE This value is returned if the
277 * user supplied an invalid interrupt coalescence time, spin up
278 * delay interval, etc.
280 SCI_STATUS scic_user_parameters_set(
281 SCI_CONTROLLER_HANDLE_T controller,
282 SCIC_USER_PARAMETERS_T * user_parameters
286 * @brief This method allows the user to retrieve the user parameters
287 * utilized by the controller.
289 * @param[in] controller This parameter specifies the controller on which
290 * to set the user parameters.
291 * @param[in] user_parameters This parameter specifies the USER_PARAMETERS
292 * object into which the framework shall save it's parameters.
296 void scic_user_parameters_get(
297 SCI_CONTROLLER_HANDLE_T controller,
298 SCIC_USER_PARAMETERS_T * user_parameters
302 * @brief This method allows the user to attempt to change the OEM
303 * parameters utilized by the controller.
305 * @param[in] controller This parameter specifies the controller on which
306 * to set the user parameters.
307 * @param[in] oem_parameters This parameter specifies the OEM parameters
308 * object containing the potential new values.
309 * @param[in] oem_parameters_version This parameter is the OEM block version
310 * value indicating the format of the data associated with
313 * @return Indicate if the update of the user parameters was successful.
314 * @retval SCI_SUCCESS This value is returned if the operation succeeded.
315 * @retval SCI_FAILURE_INVALID_STATE This value is returned if the attempt
316 * to change the user parameter failed, because changing one of
317 * the parameters is not currently allowed.
318 * @retval SCI_FAILURE_INVALID_PARAMETER_VALUE This value is returned if the
319 * user supplied an unsupported value for one of the OEM parameters.
321 SCI_STATUS scic_oem_parameters_set(
322 SCI_CONTROLLER_HANDLE_T controller,
323 SCIC_OEM_PARAMETERS_T * oem_parameters,
324 U8 oem_parameters_version
328 * @brief This method allows the user to retrieve the OEM
329 * parameters utilized by the controller.
331 * @param[in] controller This parameter specifies the controller on which
332 * to set the user parameters.
333 * @param[out] oem_parameters This parameter specifies the OEM parameters
334 * object in which to write the core's OEM parameters.
338 void scic_oem_parameters_get(
339 SCI_CONTROLLER_HANDLE_T controller,
340 SCIC_OEM_PARAMETERS_T * oem_parameters
345 #endif // __cplusplus
347 #endif // _SCIC_SDS_USER_PARAMETERS_H_