xref: /freebsd/sys/dev/isci/scil/scu_bios_definitions.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f11c7f63SJim Harris /*-
2*718cf2ccSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3*718cf2ccSPedro F. Giffuni  *
4f11c7f63SJim Harris  * This file is provided under a dual BSD/GPLv2 license.  When using or
5f11c7f63SJim Harris  * redistributing this file, you may do so under either license.
6f11c7f63SJim Harris  *
7f11c7f63SJim Harris  * GPL LICENSE SUMMARY
8f11c7f63SJim Harris  *
9f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
10f11c7f63SJim Harris  *
11f11c7f63SJim Harris  * This program is free software; you can redistribute it and/or modify
12f11c7f63SJim Harris  * it under the terms of version 2 of the GNU General Public License as
13f11c7f63SJim Harris  * published by the Free Software Foundation.
14f11c7f63SJim Harris  *
15f11c7f63SJim Harris  * This program is distributed in the hope that it will be useful, but
16f11c7f63SJim Harris  * WITHOUT ANY WARRANTY; without even the implied warranty of
17f11c7f63SJim Harris  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18f11c7f63SJim Harris  * General Public License for more details.
19f11c7f63SJim Harris  *
20f11c7f63SJim Harris  * You should have received a copy of the GNU General Public License
21f11c7f63SJim Harris  * along with this program; if not, write to the Free Software
22f11c7f63SJim Harris  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23f11c7f63SJim Harris  * The full GNU General Public License is included in this distribution
24f11c7f63SJim Harris  * in the file called LICENSE.GPL.
25f11c7f63SJim Harris  *
26f11c7f63SJim Harris  * BSD LICENSE
27f11c7f63SJim Harris  *
28f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29f11c7f63SJim Harris  * All rights reserved.
30f11c7f63SJim Harris  *
31f11c7f63SJim Harris  * Redistribution and use in source and binary forms, with or without
32f11c7f63SJim Harris  * modification, are permitted provided that the following conditions
33f11c7f63SJim Harris  * are met:
34f11c7f63SJim Harris  *
35f11c7f63SJim Harris  *   * Redistributions of source code must retain the above copyright
36f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer.
37f11c7f63SJim Harris  *   * Redistributions in binary form must reproduce the above copyright
38f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer in
39f11c7f63SJim Harris  *     the documentation and/or other materials provided with the
40f11c7f63SJim Harris  *     distribution.
41f11c7f63SJim Harris  *
42f11c7f63SJim Harris  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43f11c7f63SJim Harris  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44f11c7f63SJim Harris  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45f11c7f63SJim Harris  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46f11c7f63SJim Harris  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47f11c7f63SJim Harris  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48f11c7f63SJim Harris  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49f11c7f63SJim Harris  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50f11c7f63SJim Harris  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51f11c7f63SJim Harris  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52f11c7f63SJim Harris  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53f11c7f63SJim Harris  */
54f11c7f63SJim Harris #ifndef _SCU_BIOS_DEFINITIONS_H_
55f11c7f63SJim Harris #define _SCU_BIOS_DEFINITIONS_H_
56f11c7f63SJim Harris 
57f11c7f63SJim Harris #ifdef __cplusplus
58f11c7f63SJim Harris extern "C" {
59f11c7f63SJim Harris #endif // __cplusplus
60f11c7f63SJim Harris 
61f11c7f63SJim Harris /**
62f11c7f63SJim Harris  *  IMPORTANT NOTE:
63f11c7f63SJim Harris  *  This file can be used by an SCI Library based driver or
64f11c7f63SJim Harris  *  stand-alone where the library is excluded.  By excluding
65f11c7f63SJim Harris  *  the SCI Library, inclusion of OS specific header files can
66f11c7f63SJim Harris  *  be avoided.  For example, a BIOS utility probably does not
67f11c7f63SJim Harris  *  want to be bothered with inclusion of nested OS DDK include
68f11c7f63SJim Harris  *  files that are not necessary for its function.
69f11c7f63SJim Harris  *
70f11c7f63SJim Harris  *  To exclude the SCI Library, either uncomment the EXCLUDE_SCI_LIBRARY
71f11c7f63SJim Harris  *  #define statement in environment.h or define the statement as an input
72f11c7f63SJim Harris  *  to your compiler.
73f11c7f63SJim Harris  */
74f11c7f63SJim Harris 
75f11c7f63SJim Harris #include <dev/isci/environment.h>
76f11c7f63SJim Harris 
77f11c7f63SJim Harris #ifndef EXCLUDE_SCI_LIBRARY
78f11c7f63SJim Harris #include <dev/isci/scil/sci_types.h>
79f11c7f63SJim Harris #include <dev/isci/scil/intel_sas.h>
80f11c7f63SJim Harris #include <dev/isci/scil/sci_controller_constants.h>
81f11c7f63SJim Harris #endif /* EXCLUDE_SCI_LIBRARY */
82f11c7f63SJim Harris 
83f11c7f63SJim Harris 
84f11c7f63SJim Harris 
85f11c7f63SJim Harris // For Intel Storage Controller Unit OEM Block
86f11c7f63SJim Harris #define SCI_OEM_PARAM_SIGNATURE     "ISCUOEMB"
87f11c7f63SJim Harris 
88f11c7f63SJim Harris #define SCI_PREBOOT_SOURCE_INIT     (0x00)
89f11c7f63SJim Harris #define SCI_PREBOOT_SOURCE_OROM     (0x80)
90f11c7f63SJim Harris #define SCI_PREBOOT_SOURCE_EFI      (0x81)
91f11c7f63SJim Harris 
92f11c7f63SJim Harris #define SCI_OEM_PARAM_VER_1_0       (0x10)
93f11c7f63SJim Harris #define SCI_OEM_PARAM_VER_1_1       (0x11)
94f11c7f63SJim Harris #define SCI_OEM_PARAM_VER_1_2       (0x12)
95f11c7f63SJim Harris #define SCI_OEM_PARAM_VER_1_3       (0x13)
96f11c7f63SJim Harris 
97f11c7f63SJim Harris // current version
98f11c7f63SJim Harris #define SCI_OEM_PARAM_VER_CUR       SCI_OEM_PARAM_VER_1_3
99f11c7f63SJim Harris 
100f11c7f63SJim Harris // port configuration mode
101f11c7f63SJim Harris #define SCI_BIOS_MODE_MPC   (0x00)
102f11c7f63SJim Harris #define SCI_BIOS_MODE_APC   (0x01)
103f11c7f63SJim Harris 
104f11c7f63SJim Harris 
105f11c7f63SJim Harris #ifndef SCI_MAX_PHYS
106f11c7f63SJim Harris #define SCI_MAX_PHYS (4)
107f11c7f63SJim Harris #endif
108f11c7f63SJim Harris 
109f11c7f63SJim Harris #ifndef SCI_MAX_PORTS
110f11c7f63SJim Harris #define SCI_MAX_PORTS (4)
111f11c7f63SJim Harris #endif
112f11c7f63SJim Harris 
113f11c7f63SJim Harris 
114f11c7f63SJim Harris /**
115f11c7f63SJim Harris  * @struct SCI_BIOS_OEM_PARAM_BLOCK_HDR
116f11c7f63SJim Harris  *
117f11c7f63SJim Harris  * @brief This structure defines the OEM Parameter block header.
118f11c7f63SJim Harris  */
119f11c7f63SJim Harris typedef struct SCI_BIOS_OEM_PARAM_BLOCK_HDR
120f11c7f63SJim Harris {
121f11c7f63SJim Harris     /**
122f11c7f63SJim Harris      * This field contains the OEM Parameter Block Signature which is
123f11c7f63SJim Harris      * used by BIOS and driver software to identify that the memory location
124f11c7f63SJim Harris      * contains valid OEM Parameter data.  The value must be set to
125f11c7f63SJim Harris      * SCI_OEM_PARAM_SIGNATURE which is the string "ISCUOEMB" which
126f11c7f63SJim Harris      * stands for Intel Storage Controller Unit OEM Block.
127f11c7f63SJim Harris      */
128f11c7f63SJim Harris     U8 signature[8];
129f11c7f63SJim Harris     /**
130f11c7f63SJim Harris      * This field contains the size in bytes of the complete OEM
131f11c7f63SJim Harris      * Parameter Block, both header and payload hdr_length +
132f11c7f63SJim Harris      * (num_elements * element_length).
133f11c7f63SJim Harris      */
134f11c7f63SJim Harris     U16 total_block_length;
135f11c7f63SJim Harris     /**
136f11c7f63SJim Harris      * This field contains the size in bytes of the
137f11c7f63SJim Harris      * SCI_BIOS_OEM_PARAM_BLOCK_HDR. It also indicates the offset from
138f11c7f63SJim Harris      * the beginning of this data structure to where the actual
139f11c7f63SJim Harris      * parameter data payload begins.
140f11c7f63SJim Harris      */
141f11c7f63SJim Harris     U8 hdr_length;
142f11c7f63SJim Harris     /**
143f11c7f63SJim Harris      * This field contains the version info defining the structure
144f11c7f63SJim Harris      * of the OEM Parameter block.
145f11c7f63SJim Harris      */
146f11c7f63SJim Harris     U8  version;
147f11c7f63SJim Harris     /**
148f11c7f63SJim Harris      * This field contains a value indicating the preboot initialization
149f11c7f63SJim Harris      * method (Option ROM or UEFI driver) so that after OS transition,
150f11c7f63SJim Harris      * the OS driver can know the preboot method. OEMs who build a single
151f11c7f63SJim Harris      * flash image where the preboot method is unknown at manufacturing
152f11c7f63SJim Harris      * time should set this field to SCI_PREBOOT_SOURCE_INIT.  Then
153f11c7f63SJim Harris      * after the block is retrieved into host memory and under preboot
154f11c7f63SJim Harris      * driver control, the OROM or UEFI driver can set this field
155f11c7f63SJim Harris      * appropriately (SCI_PREBOOT_SOURCE_OROM and SCI_PREBOOT_SOURCE_EFI,
156f11c7f63SJim Harris      * respectively).
157f11c7f63SJim Harris      */
158f11c7f63SJim Harris     U8 preboot_source;
159f11c7f63SJim Harris     /**
160f11c7f63SJim Harris      * This field contains the number of parameter descriptor elements
161f11c7f63SJim Harris      * (i.e. controller_elements) following this header.  The number of
162f11c7f63SJim Harris      * elements corresponds to the number of SCU controller units contained
163f11c7f63SJim Harris      * in the platform:
164f11c7f63SJim Harris      *  controller_element[0] = SCU0
165f11c7f63SJim Harris      *  controller_element[1] = SCU1
166f11c7f63SJim Harris      */
167f11c7f63SJim Harris     U8 num_elements;
168f11c7f63SJim Harris     /**
169f11c7f63SJim Harris      * This field contains the size in bytes of the descriptor element(s)
170f11c7f63SJim Harris      * in the block.
171f11c7f63SJim Harris      */
172f11c7f63SJim Harris     U16 element_length;
173f11c7f63SJim Harris     /**
174f11c7f63SJim Harris      * Reserve fields for future use.
175f11c7f63SJim Harris      */
176f11c7f63SJim Harris     U8 reserved[8];
177f11c7f63SJim Harris 
178f11c7f63SJim Harris } SCI_BIOS_OEM_PARAM_BLOCK_HDR_T;
179f11c7f63SJim Harris 
180f11c7f63SJim Harris 
181f11c7f63SJim Harris /**
182f11c7f63SJim Harris  * @struct SCIC_SDS_OEM_PARAMETERS VER 1.0
183f11c7f63SJim Harris  *
184f11c7f63SJim Harris  * @brief This structure delineates the various OEM parameters that must
185f11c7f63SJim Harris  * be set for the Intel SAS Storage Controller Unit (SCU).
186f11c7f63SJim Harris  */
187f11c7f63SJim Harris typedef struct SCI_BIOS_OEM_PARAM_ELEMENT
188f11c7f63SJim Harris {
189f11c7f63SJim Harris     /**
190f11c7f63SJim Harris      * Per SCU Controller Data
191f11c7f63SJim Harris      */
192f11c7f63SJim Harris     struct
193f11c7f63SJim Harris     {
194f11c7f63SJim Harris         /**
195f11c7f63SJim Harris          * This field indicates the port configuration mode for
196f11c7f63SJim Harris          * this controller:
197f11c7f63SJim Harris          *   Automatic Port Configuration(APC) or
198f11c7f63SJim Harris          *   Manual Port Configuration (MPC).
199f11c7f63SJim Harris          *
200f11c7f63SJim Harris          * APC means the Platform OEM expects SCI to configure
201f11c7f63SJim Harris          * SAS Ports automatically according to the discovered SAS
202f11c7f63SJim Harris          * Address pairs of the endpoints, wide and/or narrow.
203f11c7f63SJim Harris          *
204f11c7f63SJim Harris          * MPC means the Platform OEM manually defines wide or narrow
205f11c7f63SJim Harris          * connectors by apriori assigning PHYs to SAS Ports.
206f11c7f63SJim Harris          *
207f11c7f63SJim Harris          * By default, the mode type is APC
208f11c7f63SJim Harris          * in APC mode, if ANY of the phy mask is non-zero,
209f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
210f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
211f11c7f63SJim Harris          *      configuration will be applied
212f11c7f63SJim Harris          * in MPC mode, if ALL of the phy masks are zero,
213f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
214f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
215f11c7f63SJim Harris          *      configuration will be applied
216f11c7f63SJim Harris          */
217f11c7f63SJim Harris         U8  mode_type;
218f11c7f63SJim Harris 
219f11c7f63SJim Harris         /**
220f11c7f63SJim Harris          * This field specifies the maximum number of direct attached
221f11c7f63SJim Harris          * devices the OEM will allow to have powered up simultaneously
222f11c7f63SJim Harris          * on this controller.  This allows the OEM to avoid exceeding
223f11c7f63SJim Harris          * power supply limits for this platform.  A value of zero
224f11c7f63SJim Harris          * indicates there are no restrictions.
225f11c7f63SJim Harris          */
226f11c7f63SJim Harris         U8  max_number_concurrent_device_spin_up;
227f11c7f63SJim Harris 
228f11c7f63SJim Harris         /**
229f11c7f63SJim Harris          * This field indicates OEM's desired default
230f11c7f63SJim Harris          * Spread Spectrum Clocking (SSC) setting for Tx:
231f11c7f63SJim Harris          *   enabled     = 1
232f11c7f63SJim Harris          *   disabled    = 0
233f11c7f63SJim Harris          */
234f11c7f63SJim Harris         U8 do_enable_ssc;
235f11c7f63SJim Harris 
236f11c7f63SJim Harris         U8 reserved;
237f11c7f63SJim Harris 
238f11c7f63SJim Harris     } controller;
239f11c7f63SJim Harris 
240f11c7f63SJim Harris     /**
241f11c7f63SJim Harris      * Per SAS Port data.
242f11c7f63SJim Harris      */
243f11c7f63SJim Harris     struct
244f11c7f63SJim Harris     {
245f11c7f63SJim Harris         /**
246f11c7f63SJim Harris          * This field specifies the phys to be contained inside a port.
247f11c7f63SJim Harris          * The bit position in the mask specifies the index of the phy
248f11c7f63SJim Harris          * to be contained in the port.  Multiple bits (i.e. phys)
249f11c7f63SJim Harris         * can be contained in a single port:
250f11c7f63SJim Harris         *      Bit 0 = This controller's PHY index 0     (0x01)
251f11c7f63SJim Harris         *      Bit 1 = This controller's PHY index 1     (0x02)
252f11c7f63SJim Harris         *      Bit 2 = This controller's PHY index 2     (0x04)
253f11c7f63SJim Harris         *      Bit 3 = This controller's PHY index 3     (0x08)
254f11c7f63SJim Harris         *
255f11c7f63SJim Harris         * Refer to the mode_type field for rules regarding APC and MPC mode.
256f11c7f63SJim Harris         * General rule: For APC mode phy_mask = 0
257f11c7f63SJim Harris         */
258f11c7f63SJim Harris         U8 phy_mask;
259f11c7f63SJim Harris 
260f11c7f63SJim Harris     } ports[SCI_MAX_PORTS]; // Up to 4 Ports per SCU controller unit
261f11c7f63SJim Harris 
262f11c7f63SJim Harris     /**
263f11c7f63SJim Harris      * Per PHY Parameter data.
264f11c7f63SJim Harris      */
265f11c7f63SJim Harris     struct
266f11c7f63SJim Harris     {
267f11c7f63SJim Harris         /**
268f11c7f63SJim Harris          * This field indicates the SAS Address that will be transmitted on
269f11c7f63SJim Harris          * this PHY index.  The field is defined as a union, however, the
270f11c7f63SJim Harris          * OEM should use the U8 array definition when encoding it to ensure
271f11c7f63SJim Harris          * correct byte ordering.
272f11c7f63SJim Harris          *
273f11c7f63SJim Harris          * NOTE: If using APC MODE, along with phy_mask being set to ZERO, the
274f11c7f63SJim Harris          * SAS Addresses for all PHYs within a controller group SHALL be the
275f11c7f63SJim Harris          * same.
276f11c7f63SJim Harris          */
277f11c7f63SJim Harris         union
278f11c7f63SJim Harris         {
279f11c7f63SJim Harris             /**
280f11c7f63SJim Harris              * The array should be stored in little endian order.  For example,
281f11c7f63SJim Harris              * if the desired SAS Address is 0x50010B90_0003538D, then it
282f11c7f63SJim Harris              * should be stored in the following manner:
283f11c7f63SJim Harris              *    array[0] = 0x90
284f11c7f63SJim Harris              *    array[1] = 0x0B
285f11c7f63SJim Harris              *    array[2] = 0x01
286f11c7f63SJim Harris              *    array[3] = 0x50
287f11c7f63SJim Harris              *    array[4] = 0x8D
288f11c7f63SJim Harris              *    array[5] = 0x53
289f11c7f63SJim Harris              *    array[6] = 0x03
290f11c7f63SJim Harris              *    array[7] = 0x00
291f11c7f63SJim Harris              */
292f11c7f63SJim Harris             U8 array[8];
293f11c7f63SJim Harris             /**
294f11c7f63SJim Harris              * This is the typedef'd version of the SAS Address used in
295f11c7f63SJim Harris              * the SCI Library.
296f11c7f63SJim Harris              */
297f11c7f63SJim Harris             SCI_SAS_ADDRESS_T  sci_format;
298f11c7f63SJim Harris 
299f11c7f63SJim Harris         } sas_address;
300f11c7f63SJim Harris 
301f11c7f63SJim Harris         /**
30296240c89SEitan Adler          * These are the per PHY equalization settings associated with the
303f11c7f63SJim Harris          * AFE XCVR Tx Amplitude and Equalization Control Register Set
304f11c7f63SJim Harris          * (0 thru 3).
305f11c7f63SJim Harris          *
306f11c7f63SJim Harris          * Operational Note: The following Look-Up-Table registers are engaged
307f11c7f63SJim Harris          * by the AFE block after the following:
308f11c7f63SJim Harris          *  - Software programs the Link Layer AFE Look Up Table Control
309f11c7f63SJim Harris          *    Registers (AFE_LUTCR).
310f11c7f63SJim Harris          *  - Software sets AFE XCVR Tx Control Register Tx Equalization
311f11c7f63SJim Harris          *    Enable bit.
312f11c7f63SJim Harris          */
313f11c7f63SJim Harris         /**
314f11c7f63SJim Harris          * AFE_TX_AMP_CTRL0.  This register is associated with AFE_LUTCR
315f11c7f63SJim Harris          * LUTSel=00b. It contains the Tx Equalization settings that will be
316f11c7f63SJim Harris          * used if a SATA 1.5Gbs or SATA 3.0Gbs device is direct-attached.
317f11c7f63SJim Harris          */
318f11c7f63SJim Harris         U32 afe_tx_amp_control0;
319f11c7f63SJim Harris 
320f11c7f63SJim Harris         /**
321f11c7f63SJim Harris          * AFE_TX_AMP_CTRL1.  This register is associated with AFE_LUTCR
322f11c7f63SJim Harris          * LUTSel=01b. It contains the Tx Equalization settings that will
323f11c7f63SJim Harris          * be used if a SATA 6.0Gbs device is direct-attached.
324f11c7f63SJim Harris          */
325f11c7f63SJim Harris         U32 afe_tx_amp_control1;
326f11c7f63SJim Harris 
327f11c7f63SJim Harris         /**
328f11c7f63SJim Harris          * AFE_TX_AMP_CTRL2.  This register is associated with AFE_LUTCR
329f11c7f63SJim Harris          * LUTSel=10b. It contains the Tx Equalization settings that will
330f11c7f63SJim Harris          * be used if a SAS 1.5Gbs or SAS 3.0Gbs device is direct-attached.
331f11c7f63SJim Harris          */
332f11c7f63SJim Harris         U32 afe_tx_amp_control2;
333f11c7f63SJim Harris 
334f11c7f63SJim Harris         /**
335f11c7f63SJim Harris          * AFE_TX_AMP_CTRL3.  This register is associated with AFE_LUTCR
336f11c7f63SJim Harris          * LUTSel=11b. It contains the Tx Equalization settings that will
337f11c7f63SJim Harris          * be used if a SAS 6.0Gbs device is direct-attached.
338f11c7f63SJim Harris          */
339f11c7f63SJim Harris         U32 afe_tx_amp_control3;
340f11c7f63SJim Harris 
341f11c7f63SJim Harris     } phys[SCI_MAX_PHYS];   // 4 PHYs per SCU controller unit
342f11c7f63SJim Harris 
343f11c7f63SJim Harris } SCI_BIOS_OEM_PARAM_ELEMENT_T;
344f11c7f63SJim Harris 
345f11c7f63SJim Harris /**
346f11c7f63SJim Harris  * @struct SCIC_SDS_OEM_PARAMETERS VER 1.1
347f11c7f63SJim Harris  *
348f11c7f63SJim Harris  * @brief This structure delineates the various OEM parameters that must
349f11c7f63SJim Harris  * be set for the Intel SAS Storage Controller Unit (SCU).
350f11c7f63SJim Harris  */
351f11c7f63SJim Harris typedef struct SCI_BIOS_OEM_PARAM_ELEMENT_v_1_1
352f11c7f63SJim Harris {
353f11c7f63SJim Harris     /**
354f11c7f63SJim Harris      * Per SCU Controller Data
355f11c7f63SJim Harris      */
356f11c7f63SJim Harris     struct
357f11c7f63SJim Harris     {
358f11c7f63SJim Harris         /**
359f11c7f63SJim Harris          * This field indicates the port configuration mode for
360f11c7f63SJim Harris          * this controller:
361f11c7f63SJim Harris          *   Automatic Port Configuration(APC) or
362f11c7f63SJim Harris          *   Manual Port Configuration (MPC).
363f11c7f63SJim Harris          *
364f11c7f63SJim Harris          * APC means the Platform OEM expects SCI to configure
365f11c7f63SJim Harris          * SAS Ports automatically according to the discovered SAS
366f11c7f63SJim Harris          * Address pairs of the endpoints, wide and/or narrow.
367f11c7f63SJim Harris          *
368f11c7f63SJim Harris          * MPC means the Platform OEM manually defines wide or narrow
369f11c7f63SJim Harris          * connectors by apriori assigning PHYs to SAS Ports.
370f11c7f63SJim Harris          *
371f11c7f63SJim Harris          * By default, the mode type is APC
372f11c7f63SJim Harris          * in APC mode, if ANY of the phy mask is non-zero,
373f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
374f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
375f11c7f63SJim Harris          *      configuration will be applied
376f11c7f63SJim Harris          * in MPC mode, if ALL of the phy masks are zero,
377f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
378f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
379f11c7f63SJim Harris          *      configuration will be applied
380f11c7f63SJim Harris          */
381f11c7f63SJim Harris         U8  mode_type;
382f11c7f63SJim Harris 
383f11c7f63SJim Harris         /**
384f11c7f63SJim Harris          * This field specifies the maximum number of direct attached
385f11c7f63SJim Harris          * devices the OEM will allow to have powered up simultaneously
386f11c7f63SJim Harris          * on this controller.  This allows the OEM to avoid exceeding
387f11c7f63SJim Harris          * power supply limits for this platform.  A value of zero
388f11c7f63SJim Harris          * indicates there are no restrictions.
389f11c7f63SJim Harris          */
390f11c7f63SJim Harris         U8  max_number_concurrent_device_spin_up;
391f11c7f63SJim Harris 
392f11c7f63SJim Harris         /**
393f11c7f63SJim Harris          * This bitfield indicates the OEM's desired default Tx
394f11c7f63SJim Harris          * Spread Spectrum Clocking (SSC) settings for SATA and SAS.
395f11c7f63SJim Harris          * NOTE: Default SSC Modulation Frequency is 31.5KHz.
396f11c7f63SJim Harris          *--------------------------------------------------------------------*/
397f11c7f63SJim Harris         /**
398f11c7f63SJim Harris          * NOTE: Max spread for SATA is +0 / -5000 PPM.
399f11c7f63SJim Harris          * Down-spreading SSC (only method allowed for SATA):
400f11c7f63SJim Harris          *  SATA SSC Tx Disabled                    = 0x0
401f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -1419 PPM Spread    = 0x2
402f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -2129 PPM Spread    = 0x3
403f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -4257 PPM Spread    = 0x6
404f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -4967 PPM Spread    = 0x7
405f11c7f63SJim Harris         */
406f11c7f63SJim Harris         U8 ssc_sata_tx_spread_level : 4;
407f11c7f63SJim Harris 
408f11c7f63SJim Harris         /**
409f11c7f63SJim Harris          * SAS SSC Tx Disabled                     = 0x0
410f11c7f63SJim Harris          *
411f11c7f63SJim Harris          * NOTE: Max spread for SAS down-spreading +0 / -2300 PPM
412f11c7f63SJim Harris          * Down-spreading SSC:
413f11c7f63SJim Harris          *  SAS SSC Tx at +0 / -1419 PPM Spread     = 0x2
414f11c7f63SJim Harris          *  SAS SSC Tx at +0 / -2129 PPM Spread     = 0x3
415f11c7f63SJim Harris          *
416f11c7f63SJim Harris          * NOTE: Max spread for SAS center-spreading +2300 / -2300 PPM
417f11c7f63SJim Harris          * Center-spreading SSC:
418f11c7f63SJim Harris          *  SAS SSC Tx at +1064 / -1064 PPM Spread  = 0x3
419f11c7f63SJim Harris          *  SAS SSC Tx at +2129 / -2129 PPM Spread  = 0x6
420f11c7f63SJim Harris          */
421f11c7f63SJim Harris         U8 ssc_sas_tx_spread_level : 3;
422f11c7f63SJim Harris         /**
423f11c7f63SJim Harris          * NOTE: Refer to the SSC section of the SAS 2.x Specification
424f11c7f63SJim Harris          * for proper setting of this field. For standard SAS Initiator
425f11c7f63SJim Harris          * SAS PHY operation it should be 0 for Down-spreading.
426f11c7f63SJim Harris          * SAS SSC Tx spread type:
427f11c7f63SJim Harris          *  Down-spreading SSC      = 0
428f11c7f63SJim Harris          *  Center-spreading SSC    = 1
429f11c7f63SJim Harris          */
430f11c7f63SJim Harris         U8 ssc_sas_tx_type : 1;
431f11c7f63SJim Harris         /*--------------------------------------------------------------------*/
432f11c7f63SJim Harris 
433f11c7f63SJim Harris         U8 reserved;
434f11c7f63SJim Harris 
435f11c7f63SJim Harris     } controller;
436f11c7f63SJim Harris 
437f11c7f63SJim Harris     /**
438f11c7f63SJim Harris      * Per SAS Port data.
439f11c7f63SJim Harris      */
440f11c7f63SJim Harris     struct
441f11c7f63SJim Harris     {
442f11c7f63SJim Harris         /**
443f11c7f63SJim Harris          * This field specifies the phys to be contained inside a port.
444f11c7f63SJim Harris          * The bit position in the mask specifies the index of the phy
445f11c7f63SJim Harris          * to be contained in the port.  Multiple bits (i.e. phys)
446f11c7f63SJim Harris         * can be contained in a single port:
447f11c7f63SJim Harris         *      Bit 0 = This controller's PHY index 0     (0x01)
448f11c7f63SJim Harris         *      Bit 1 = This controller's PHY index 1     (0x02)
449f11c7f63SJim Harris         *      Bit 2 = This controller's PHY index 2     (0x04)
450f11c7f63SJim Harris         *      Bit 3 = This controller's PHY index 3     (0x08)
451f11c7f63SJim Harris         *
452f11c7f63SJim Harris         * Refer to the mode_type field for rules regarding APC and MPC mode.
453f11c7f63SJim Harris         * General rule: For APC mode phy_mask = 0
454f11c7f63SJim Harris         */
455f11c7f63SJim Harris         U8 phy_mask;
456f11c7f63SJim Harris 
457f11c7f63SJim Harris     } ports[SCI_MAX_PORTS]; // Up to 4 Ports per SCU controller unit
458f11c7f63SJim Harris 
459f11c7f63SJim Harris     /**
460f11c7f63SJim Harris      * Per PHY Parameter data.
461f11c7f63SJim Harris      */
462f11c7f63SJim Harris     struct
463f11c7f63SJim Harris     {
464f11c7f63SJim Harris         /**
465f11c7f63SJim Harris          * This field indicates the SAS Address that will be transmitted on
466f11c7f63SJim Harris          * this PHY index.  The field is defined as a union, however, the
467f11c7f63SJim Harris          * OEM should use the U8 array definition when encoding it to ensure
468f11c7f63SJim Harris          * correct byte ordering.
469f11c7f63SJim Harris          *
470f11c7f63SJim Harris          * NOTE: If using APC MODE, along with phy_mask being set to ZERO, the
471f11c7f63SJim Harris          * SAS Addresses for all PHYs within a controller group SHALL be the
472f11c7f63SJim Harris          * same.
473f11c7f63SJim Harris          */
474f11c7f63SJim Harris         union
475f11c7f63SJim Harris         {
476f11c7f63SJim Harris             /**
477f11c7f63SJim Harris              * The array should be stored in little endian order.  For example,
478f11c7f63SJim Harris              * if the desired SAS Address is 0x50010B90_0003538D, then it
479f11c7f63SJim Harris              * should be stored in the following manner:
480f11c7f63SJim Harris              *    array[0] = 0x90
481f11c7f63SJim Harris              *    array[1] = 0x0B
482f11c7f63SJim Harris              *    array[2] = 0x01
483f11c7f63SJim Harris              *    array[3] = 0x50
484f11c7f63SJim Harris              *    array[4] = 0x8D
485f11c7f63SJim Harris              *    array[5] = 0x53
486f11c7f63SJim Harris              *    array[6] = 0x03
487f11c7f63SJim Harris              *    array[7] = 0x00
488f11c7f63SJim Harris              */
489f11c7f63SJim Harris             U8 array[8];
490f11c7f63SJim Harris             /**
491f11c7f63SJim Harris              * This is the typedef'd version of the SAS Address used in
492f11c7f63SJim Harris              * the SCI Library.
493f11c7f63SJim Harris              */
494f11c7f63SJim Harris             SCI_SAS_ADDRESS_T  sci_format;
495f11c7f63SJim Harris 
496f11c7f63SJim Harris         } sas_address;
497f11c7f63SJim Harris 
498f11c7f63SJim Harris         /**
49996240c89SEitan Adler          * These are the per PHY equalization settings associated with the
500f11c7f63SJim Harris          * AFE XCVR Tx Amplitude and Equalization Control Register Set
501f11c7f63SJim Harris          * (0 thru 3).
502f11c7f63SJim Harris          *
503f11c7f63SJim Harris          * Operational Note: The following Look-Up-Table registers are engaged
504f11c7f63SJim Harris          * by the AFE block after the following:
505f11c7f63SJim Harris          *  - Software programs the Link Layer AFE Look Up Table Control
506f11c7f63SJim Harris          *    Registers (AFE_LUTCR).
507f11c7f63SJim Harris          *  - Software sets AFE XCVR Tx Control Register Tx Equalization
508f11c7f63SJim Harris          *    Enable bit.
509f11c7f63SJim Harris          */
510f11c7f63SJim Harris         /**
511f11c7f63SJim Harris          * AFE_TX_AMP_CTRL0.  This register is associated with AFE_LUTCR
512f11c7f63SJim Harris          * LUTSel=00b. It contains the Tx Equalization settings that will be
513f11c7f63SJim Harris          * used if a SATA 1.5Gbs or SATA 3.0Gbs device is direct-attached.
514f11c7f63SJim Harris          */
515f11c7f63SJim Harris         U32 afe_tx_amp_control0;
516f11c7f63SJim Harris 
517f11c7f63SJim Harris         /**
518f11c7f63SJim Harris          * AFE_TX_AMP_CTRL1.  This register is associated with AFE_LUTCR
519f11c7f63SJim Harris          * LUTSel=01b. It contains the Tx Equalization settings that will
520f11c7f63SJim Harris          * be used if a SATA 6.0Gbs device is direct-attached.
521f11c7f63SJim Harris          */
522f11c7f63SJim Harris         U32 afe_tx_amp_control1;
523f11c7f63SJim Harris 
524f11c7f63SJim Harris         /**
525f11c7f63SJim Harris          * AFE_TX_AMP_CTRL2.  This register is associated with AFE_LUTCR
526f11c7f63SJim Harris          * LUTSel=10b. It contains the Tx Equalization settings that will
527f11c7f63SJim Harris          * be used if a SAS 1.5Gbs or SAS 3.0Gbs device is direct-attached.
528f11c7f63SJim Harris          */
529f11c7f63SJim Harris         U32 afe_tx_amp_control2;
530f11c7f63SJim Harris 
531f11c7f63SJim Harris         /**
532f11c7f63SJim Harris          * AFE_TX_AMP_CTRL3.  This register is associated with AFE_LUTCR
533f11c7f63SJim Harris          * LUTSel=11b. It contains the Tx Equalization settings that will
534f11c7f63SJim Harris          * be used if a SAS 6.0Gbs device is direct-attached.
535f11c7f63SJim Harris          */
536f11c7f63SJim Harris         U32 afe_tx_amp_control3;
537f11c7f63SJim Harris 
538f11c7f63SJim Harris     } phys[SCI_MAX_PHYS];   // 4 PHYs per SCU controller unit
539f11c7f63SJim Harris 
540f11c7f63SJim Harris } SCI_BIOS_OEM_PARAM_ELEMENT_v_1_1_T;
541f11c7f63SJim Harris 
542f11c7f63SJim Harris /**
543f11c7f63SJim Harris  * @struct SCIC_SDS_OEM_PARAMETERS VER 1.2
544f11c7f63SJim Harris  *
545f11c7f63SJim Harris  * @brief This structure delineates the various OEM parameters that must
546f11c7f63SJim Harris  * be set for the Intel SAS Storage Controller Unit (SCU).
547f11c7f63SJim Harris  */
548f11c7f63SJim Harris typedef struct SCI_BIOS_OEM_PARAM_ELEMENT_v_1_2
549f11c7f63SJim Harris {
550f11c7f63SJim Harris     /**
551f11c7f63SJim Harris      * Per SCU Controller Data
552f11c7f63SJim Harris      */
553f11c7f63SJim Harris     struct
554f11c7f63SJim Harris     {
555f11c7f63SJim Harris         /**
556f11c7f63SJim Harris          * This field indicates the port configuration mode for
557f11c7f63SJim Harris          * this controller:
558f11c7f63SJim Harris          *   Automatic Port Configuration(APC) or
559f11c7f63SJim Harris          *   Manual Port Configuration (MPC).
560f11c7f63SJim Harris          *
561f11c7f63SJim Harris          * APC means the Platform OEM expects SCI to configure
562f11c7f63SJim Harris          * SAS Ports automatically according to the discovered SAS
563f11c7f63SJim Harris          * Address pairs of the endpoints, wide and/or narrow.
564f11c7f63SJim Harris          *
565f11c7f63SJim Harris          * MPC means the Platform OEM manually defines wide or narrow
566f11c7f63SJim Harris          * connectors by apriori assigning PHYs to SAS Ports.
567f11c7f63SJim Harris          *
568f11c7f63SJim Harris          * By default, the mode type is APC
569f11c7f63SJim Harris          * in APC mode, if ANY of the phy mask is non-zero,
570f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
571f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
572f11c7f63SJim Harris          *      configuration will be applied
573f11c7f63SJim Harris          * in MPC mode, if ALL of the phy masks are zero,
574f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
575f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
576f11c7f63SJim Harris          *      configuration will be applied
577f11c7f63SJim Harris          */
578f11c7f63SJim Harris         U8  mode_type;
579f11c7f63SJim Harris 
580f11c7f63SJim Harris         /**
581f11c7f63SJim Harris          * This field specifies the maximum number of direct attached
582f11c7f63SJim Harris          * devices the OEM will allow to have powered up simultaneously
583f11c7f63SJim Harris          * on this controller.  This allows the OEM to avoid exceeding
584f11c7f63SJim Harris          * power supply limits for this platform.  A value of zero
585f11c7f63SJim Harris          * indicates there are no restrictions.
586f11c7f63SJim Harris          */
587f11c7f63SJim Harris         U8  max_number_concurrent_device_spin_up;
588f11c7f63SJim Harris 
589f11c7f63SJim Harris         /**
590f11c7f63SJim Harris          * This bitfield indicates the OEM's desired default Tx
591f11c7f63SJim Harris          * Spread Spectrum Clocking (SSC) settings for SATA and SAS.
592f11c7f63SJim Harris          * NOTE: Default SSC Modulation Frequency is 31.5KHz.
593f11c7f63SJim Harris          *--------------------------------------------------------------------*/
594f11c7f63SJim Harris         /**
595f11c7f63SJim Harris          * NOTE: Max spread for SATA is +0 / -5000 PPM.
596f11c7f63SJim Harris          * Down-spreading SSC (only method allowed for SATA):
597f11c7f63SJim Harris          *  SATA SSC Tx Disabled                    = 0x0
598f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -1419 PPM Spread    = 0x2
599f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -2129 PPM Spread    = 0x3
600f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -4257 PPM Spread    = 0x6
601f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -4967 PPM Spread    = 0x7
602f11c7f63SJim Harris         */
603f11c7f63SJim Harris         U8 ssc_sata_tx_spread_level : 4;
604f11c7f63SJim Harris 
605f11c7f63SJim Harris         /**
606f11c7f63SJim Harris          * SAS SSC Tx Disabled                     = 0x0
607f11c7f63SJim Harris          *
608f11c7f63SJim Harris          * NOTE: Max spread for SAS down-spreading +0 / -2300 PPM
609f11c7f63SJim Harris          * Down-spreading SSC:
610f11c7f63SJim Harris          *  SAS SSC Tx at +0 / -1419 PPM Spread     = 0x2
611f11c7f63SJim Harris          *  SAS SSC Tx at +0 / -2129 PPM Spread     = 0x3
612f11c7f63SJim Harris          *
613f11c7f63SJim Harris          * NOTE: Max spread for SAS center-spreading +2300 / -2300 PPM
614f11c7f63SJim Harris          * Center-spreading SSC:
615f11c7f63SJim Harris          *  SAS SSC Tx at +1064 / -1064 PPM Spread  = 0x3
616f11c7f63SJim Harris          *  SAS SSC Tx at +2129 / -2129 PPM Spread  = 0x6
617f11c7f63SJim Harris          */
618f11c7f63SJim Harris         U8 ssc_sas_tx_spread_level : 3;
619f11c7f63SJim Harris         /**
620f11c7f63SJim Harris          * NOTE: Refer to the SSC section of the SAS 2.x Specification
621f11c7f63SJim Harris          * for proper setting of this field. For standard SAS Initiator
622f11c7f63SJim Harris          * SAS PHY operation it should be 0 for Down-spreading.
623f11c7f63SJim Harris          * SAS SSC Tx spread type:
624f11c7f63SJim Harris          *  Down-spreading SSC      = 0
625f11c7f63SJim Harris          *  Center-spreading SSC    = 1
626f11c7f63SJim Harris          */
627f11c7f63SJim Harris         U8 ssc_sas_tx_type : 1;
628f11c7f63SJim Harris 
629f11c7f63SJim Harris         /**
630f11c7f63SJim Harris          * This field indicates length of the SAS/SATA cable between
631f11c7f63SJim Harris          * host and device.
632f11c7f63SJim Harris          * This field is used make relationship between analog parameters of
633f11c7f63SJim Harris          * the phy in the silicon and length of the cable.
634f11c7f63SJim Harris          * Supported length: "short"- up to 3m, "long"- more than 3m
635f11c7f63SJim Harris          * This is bit mask field:
636f11c7f63SJim Harris          *
637f11c7f63SJim Harris          * BIT:           7  6  5  4   3     2     1     0 (LSB)
638f11c7f63SJim Harris          * ASSIGNMENT:   <-><-><-><-><phy3><phy2><phy1><phy0>
639f11c7f63SJim Harris          *
640f11c7f63SJim Harris          * For short cable corresponding bit shall be reset,
641f11c7f63SJim Harris          * for long cable shall be set.
642f11c7f63SJim Harris          */
643f11c7f63SJim Harris         U8 long_cable_selection_mask;
644f11c7f63SJim Harris 
645f11c7f63SJim Harris     } controller;
646f11c7f63SJim Harris 
647f11c7f63SJim Harris     /**
648f11c7f63SJim Harris      * Per SAS Port data.
649f11c7f63SJim Harris      */
650f11c7f63SJim Harris     struct
651f11c7f63SJim Harris     {
652f11c7f63SJim Harris         /**
653f11c7f63SJim Harris          * This field specifies the phys to be contained inside a port.
654f11c7f63SJim Harris          * The bit position in the mask specifies the index of the phy
655f11c7f63SJim Harris          * to be contained in the port.  Multiple bits (i.e. phys)
656f11c7f63SJim Harris         * can be contained in a single port:
657f11c7f63SJim Harris         *      Bit 0 = This controller's PHY index 0     (0x01)
658f11c7f63SJim Harris         *      Bit 1 = This controller's PHY index 1     (0x02)
659f11c7f63SJim Harris         *      Bit 2 = This controller's PHY index 2     (0x04)
660f11c7f63SJim Harris         *      Bit 3 = This controller's PHY index 3     (0x08)
661f11c7f63SJim Harris         *
662f11c7f63SJim Harris         * Refer to the mode_type field for rules regarding APC and MPC mode.
663f11c7f63SJim Harris         * General rule: For APC mode phy_mask = 0
664f11c7f63SJim Harris         */
665f11c7f63SJim Harris         U8 phy_mask;
666f11c7f63SJim Harris 
667f11c7f63SJim Harris     } ports[SCI_MAX_PORTS]; // Up to 4 Ports per SCU controller unit
668f11c7f63SJim Harris 
669f11c7f63SJim Harris     /**
670f11c7f63SJim Harris      * Per PHY Parameter data.
671f11c7f63SJim Harris      */
672f11c7f63SJim Harris     struct
673f11c7f63SJim Harris     {
674f11c7f63SJim Harris         /**
675f11c7f63SJim Harris          * This field indicates the SAS Address that will be transmitted on
676f11c7f63SJim Harris          * this PHY index.  The field is defined as a union, however, the
677f11c7f63SJim Harris          * OEM should use the U8 array definition when encoding it to ensure
678f11c7f63SJim Harris          * correct byte ordering.
679f11c7f63SJim Harris          *
680f11c7f63SJim Harris          * NOTE: If using APC MODE, along with phy_mask being set to ZERO, the
681f11c7f63SJim Harris          * SAS Addresses for all PHYs within a controller group SHALL be the
682f11c7f63SJim Harris          * same.
683f11c7f63SJim Harris          */
684f11c7f63SJim Harris         union
685f11c7f63SJim Harris         {
686f11c7f63SJim Harris             /**
687f11c7f63SJim Harris              * The array should be stored in little endian order.  For example,
688f11c7f63SJim Harris              * if the desired SAS Address is 0x50010B90_0003538D, then it
689f11c7f63SJim Harris              * should be stored in the following manner:
690f11c7f63SJim Harris              *    array[0] = 0x90
691f11c7f63SJim Harris              *    array[1] = 0x0B
692f11c7f63SJim Harris              *    array[2] = 0x01
693f11c7f63SJim Harris              *    array[3] = 0x50
694f11c7f63SJim Harris              *    array[4] = 0x8D
695f11c7f63SJim Harris              *    array[5] = 0x53
696f11c7f63SJim Harris              *    array[6] = 0x03
697f11c7f63SJim Harris              *    array[7] = 0x00
698f11c7f63SJim Harris              */
699f11c7f63SJim Harris             U8 array[8];
700f11c7f63SJim Harris             /**
701f11c7f63SJim Harris              * This is the typedef'd version of the SAS Address used in
702f11c7f63SJim Harris              * the SCI Library.
703f11c7f63SJim Harris              */
704f11c7f63SJim Harris             SCI_SAS_ADDRESS_T  sci_format;
705f11c7f63SJim Harris 
706f11c7f63SJim Harris         } sas_address;
707f11c7f63SJim Harris 
708f11c7f63SJim Harris         /**
70996240c89SEitan Adler          * These are the per PHY equalization settings associated with the
710f11c7f63SJim Harris          * AFE XCVR Tx Amplitude and Equalization Control Register Set
711f11c7f63SJim Harris          * (0 thru 3).
712f11c7f63SJim Harris          *
713f11c7f63SJim Harris          * Operational Note: The following Look-Up-Table registers are engaged
714f11c7f63SJim Harris          * by the AFE block after the following:
715f11c7f63SJim Harris          *  - Software programs the Link Layer AFE Look Up Table Control
716f11c7f63SJim Harris          *    Registers (AFE_LUTCR).
717f11c7f63SJim Harris          *  - Software sets AFE XCVR Tx Control Register Tx Equalization
718f11c7f63SJim Harris          *    Enable bit.
719f11c7f63SJim Harris          */
720f11c7f63SJim Harris         /**
721f11c7f63SJim Harris          * AFE_TX_AMP_CTRL0.  This register is associated with AFE_LUTCR
722f11c7f63SJim Harris          * LUTSel=00b. It contains the Tx Equalization settings that will be
723f11c7f63SJim Harris          * used if a SATA 1.5Gbs or SATA 3.0Gbs device is direct-attached.
724f11c7f63SJim Harris          */
725f11c7f63SJim Harris         U32 afe_tx_amp_control0;
726f11c7f63SJim Harris 
727f11c7f63SJim Harris         /**
728f11c7f63SJim Harris          * AFE_TX_AMP_CTRL1.  This register is associated with AFE_LUTCR
729f11c7f63SJim Harris          * LUTSel=01b. It contains the Tx Equalization settings that will
730f11c7f63SJim Harris          * be used if a SATA 6.0Gbs device is direct-attached.
731f11c7f63SJim Harris          */
732f11c7f63SJim Harris         U32 afe_tx_amp_control1;
733f11c7f63SJim Harris 
734f11c7f63SJim Harris         /**
735f11c7f63SJim Harris          * AFE_TX_AMP_CTRL2.  This register is associated with AFE_LUTCR
736f11c7f63SJim Harris          * LUTSel=10b. It contains the Tx Equalization settings that will
737f11c7f63SJim Harris          * be used if a SAS 1.5Gbs or SAS 3.0Gbs device is direct-attached.
738f11c7f63SJim Harris          */
739f11c7f63SJim Harris         U32 afe_tx_amp_control2;
740f11c7f63SJim Harris 
741f11c7f63SJim Harris         /**
742f11c7f63SJim Harris          * AFE_TX_AMP_CTRL3.  This register is associated with AFE_LUTCR
743f11c7f63SJim Harris          * LUTSel=11b. It contains the Tx Equalization settings that will
744f11c7f63SJim Harris          * be used if a SAS 6.0Gbs device is direct-attached.
745f11c7f63SJim Harris          */
746f11c7f63SJim Harris         U32 afe_tx_amp_control3;
747f11c7f63SJim Harris 
748f11c7f63SJim Harris     } phys[SCI_MAX_PHYS];   // 4 PHYs per SCU controller unit
749f11c7f63SJim Harris 
750f11c7f63SJim Harris } SCI_BIOS_OEM_PARAM_ELEMENT_v_1_2_T;
751f11c7f63SJim Harris 
752f11c7f63SJim Harris /**
753f11c7f63SJim Harris  * @struct SCIC_SDS_OEM_PARAMETERS VER 1.3
754f11c7f63SJim Harris  *
755f11c7f63SJim Harris  * @brief This structure delineates the various OEM parameters that must
756f11c7f63SJim Harris  * be set for the Intel SAS Storage Controller Unit (SCU).
757f11c7f63SJim Harris  */
758f11c7f63SJim Harris typedef struct SCI_BIOS_OEM_PARAM_ELEMENT_v_1_3
759f11c7f63SJim Harris {
760f11c7f63SJim Harris     /**
761f11c7f63SJim Harris      * Per SCU Controller Data
762f11c7f63SJim Harris      */
763f11c7f63SJim Harris     struct
764f11c7f63SJim Harris     {
765f11c7f63SJim Harris         /**
766f11c7f63SJim Harris          * This field indicates the port configuration mode for
767f11c7f63SJim Harris          * this controller:
768f11c7f63SJim Harris          *   Automatic Port Configuration(APC) or
769f11c7f63SJim Harris          *   Manual Port Configuration (MPC).
770f11c7f63SJim Harris          *
771f11c7f63SJim Harris          * APC means the Platform OEM expects SCI to configure
772f11c7f63SJim Harris          * SAS Ports automatically according to the discovered SAS
773f11c7f63SJim Harris          * Address pairs of the endpoints, wide and/or narrow.
774f11c7f63SJim Harris          *
775f11c7f63SJim Harris          * MPC means the Platform OEM manually defines wide or narrow
776f11c7f63SJim Harris          * connectors by apriori assigning PHYs to SAS Ports.
777f11c7f63SJim Harris          *
778f11c7f63SJim Harris          * By default, the mode type is APC
779f11c7f63SJim Harris          * in APC mode, if ANY of the phy mask is non-zero,
780f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
781f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
782f11c7f63SJim Harris          *      configuration will be applied
783f11c7f63SJim Harris          * in MPC mode, if ALL of the phy masks are zero,
784f11c7f63SJim Harris          *    SCI_FAILURE_INVALID_PARAMETER_VALUE will be returned
785f11c7f63SJim Harris          *      from scic_oem_parameters_set AND the default oem
786f11c7f63SJim Harris          *      configuration will be applied
787f11c7f63SJim Harris          */
788f11c7f63SJim Harris         U8  mode_type;
789f11c7f63SJim Harris 
790f11c7f63SJim Harris         /**
791f11c7f63SJim Harris          * This field specifies the maximum number of direct attached
792f11c7f63SJim Harris          * devices the OEM will allow to have powered up simultaneously
793f11c7f63SJim Harris          * on this controller.  This allows the OEM to avoid exceeding
794f11c7f63SJim Harris          * power supply limits for this platform.  A value of zero
795f11c7f63SJim Harris          * indicates there are no restrictions.
796f11c7f63SJim Harris          */
797f11c7f63SJim Harris         U8  max_number_concurrent_device_spin_up;
798f11c7f63SJim Harris 
799f11c7f63SJim Harris         /**
800f11c7f63SJim Harris          * This bitfield indicates the OEM's desired default Tx
801f11c7f63SJim Harris          * Spread Spectrum Clocking (SSC) settings for SATA and SAS.
802f11c7f63SJim Harris          * NOTE: Default SSC Modulation Frequency is 31.5KHz.
803f11c7f63SJim Harris          *--------------------------------------------------------------------*/
804f11c7f63SJim Harris         /**
805f11c7f63SJim Harris          * NOTE: Max spread for SATA is +0 / -5000 PPM.
806f11c7f63SJim Harris          * Down-spreading SSC (only method allowed for SATA):
807f11c7f63SJim Harris          *  SATA SSC Tx Disabled                    = 0x0
808f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -1419 PPM Spread    = 0x2
809f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -2129 PPM Spread    = 0x3
810f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -4257 PPM Spread    = 0x6
811f11c7f63SJim Harris          *  SATA SSC Tx at +0 / -4967 PPM Spread    = 0x7
812f11c7f63SJim Harris         */
813f11c7f63SJim Harris         U8 ssc_sata_tx_spread_level : 4;
814f11c7f63SJim Harris 
815f11c7f63SJim Harris         /**
816f11c7f63SJim Harris          * SAS SSC Tx Disabled                     = 0x0
817f11c7f63SJim Harris          *
818f11c7f63SJim Harris          * NOTE: Max spread for SAS down-spreading +0 / -2300 PPM
819f11c7f63SJim Harris          * Down-spreading SSC:
820f11c7f63SJim Harris          *  SAS SSC Tx at +0 / -1419 PPM Spread     = 0x2
821f11c7f63SJim Harris          *  SAS SSC Tx at +0 / -2129 PPM Spread     = 0x3
822f11c7f63SJim Harris          *
823f11c7f63SJim Harris          * NOTE: Max spread for SAS center-spreading +2300 / -2300 PPM
824f11c7f63SJim Harris          * Center-spreading SSC:
825f11c7f63SJim Harris          *  SAS SSC Tx at +1064 / -1064 PPM Spread  = 0x3
826f11c7f63SJim Harris          *  SAS SSC Tx at +2129 / -2129 PPM Spread  = 0x6
827f11c7f63SJim Harris          */
828f11c7f63SJim Harris         U8 ssc_sas_tx_spread_level : 3;
829f11c7f63SJim Harris         /**
830f11c7f63SJim Harris          * NOTE: Refer to the SSC section of the SAS 2.x Specification
831f11c7f63SJim Harris          * for proper setting of this field. For standard SAS Initiator
832f11c7f63SJim Harris          * SAS PHY operation it should be 0 for Down-spreading.
833f11c7f63SJim Harris          * SAS SSC Tx spread type:
834f11c7f63SJim Harris          *  Down-spreading SSC      = 0
835f11c7f63SJim Harris          *  Center-spreading SSC    = 1
836f11c7f63SJim Harris          */
837f11c7f63SJim Harris         U8 ssc_sas_tx_type : 1;
838f11c7f63SJim Harris 
839f11c7f63SJim Harris         /**
840f11c7f63SJim Harris          * This field indicates length of the SAS/SATA cable between
841f11c7f63SJim Harris          * host and device.
842f11c7f63SJim Harris          * This field is used make relationship between analog parameters of
843f11c7f63SJim Harris          * the phy in the silicon and length of the cable.
844f11c7f63SJim Harris          * Supported cable attenuation levels:
845f11c7f63SJim Harris          * "short"- up to 3m, "medium"-3m to 6m, and "long"- more than 6m
846f11c7f63SJim Harris          * This is bit mask field:
847f11c7f63SJim Harris          *
848f11c7f63SJim Harris          * BIT:      (MSB) 7     6     5     4
849f11c7f63SJim Harris          * ASSIGNMENT:   <phy3><phy2><phy1><phy0>  - Medium cable length assignment
850f11c7f63SJim Harris          * BIT:            3     2     1     0  (LSB)
851f11c7f63SJim Harris          * ASSIGNMENT:   <phy3><phy2><phy1><phy0>  - Long cable length assignment
852f11c7f63SJim Harris          *
853f11c7f63SJim Harris          * BITS 7-4 are set when the cable length is assigned to medium
854f11c7f63SJim Harris          * BITS 3-0 are set when the cable length is assigned to long
855f11c7f63SJim Harris          * The BIT positions are clear when the cable length is assigned to short
856f11c7f63SJim Harris          * Setting the bits for both long and medium cable length is undefined.
857f11c7f63SJim Harris          *
858f11c7f63SJim Harris          * A value of 0x84 would assign
859f11c7f63SJim Harris          *    phy3 - medium
860f11c7f63SJim Harris          *    phy2 - long
861f11c7f63SJim Harris          *    phy1 - short
862f11c7f63SJim Harris          *    phy0 - short
863f11c7f63SJim Harris          */
864f11c7f63SJim Harris         U8 cable_selection_mask;
865f11c7f63SJim Harris 
866f11c7f63SJim Harris     } controller;
867f11c7f63SJim Harris 
868f11c7f63SJim Harris     /**
869f11c7f63SJim Harris      * Per SAS Port data.
870f11c7f63SJim Harris      */
871f11c7f63SJim Harris     struct
872f11c7f63SJim Harris     {
873f11c7f63SJim Harris         /**
874f11c7f63SJim Harris          * This field specifies the phys to be contained inside a port.
875f11c7f63SJim Harris          * The bit position in the mask specifies the index of the phy
876f11c7f63SJim Harris          * to be contained in the port.  Multiple bits (i.e. phys)
877f11c7f63SJim Harris         * can be contained in a single port:
878f11c7f63SJim Harris         *      Bit 0 = This controller's PHY index 0     (0x01)
879f11c7f63SJim Harris         *      Bit 1 = This controller's PHY index 1     (0x02)
880f11c7f63SJim Harris         *      Bit 2 = This controller's PHY index 2     (0x04)
881f11c7f63SJim Harris         *      Bit 3 = This controller's PHY index 3     (0x08)
882f11c7f63SJim Harris         *
883f11c7f63SJim Harris         * Refer to the mode_type field for rules regarding APC and MPC mode.
884f11c7f63SJim Harris         * General rule: For APC mode phy_mask = 0
885f11c7f63SJim Harris         */
886f11c7f63SJim Harris         U8 phy_mask;
887f11c7f63SJim Harris 
888f11c7f63SJim Harris     } ports[SCI_MAX_PORTS]; // Up to 4 Ports per SCU controller unit
889f11c7f63SJim Harris 
890f11c7f63SJim Harris     /**
891f11c7f63SJim Harris      * Per PHY Parameter data.
892f11c7f63SJim Harris      */
893f11c7f63SJim Harris     struct
894f11c7f63SJim Harris     {
895f11c7f63SJim Harris         /**
896f11c7f63SJim Harris          * This field indicates the SAS Address that will be transmitted on
897f11c7f63SJim Harris          * this PHY index.  The field is defined as a union, however, the
898f11c7f63SJim Harris          * OEM should use the U8 array definition when encoding it to ensure
899f11c7f63SJim Harris          * correct byte ordering.
900f11c7f63SJim Harris          *
901f11c7f63SJim Harris          * NOTE: If using APC MODE, along with phy_mask being set to ZERO, the
902f11c7f63SJim Harris          * SAS Addresses for all PHYs within a controller group SHALL be the
903f11c7f63SJim Harris          * same.
904f11c7f63SJim Harris          */
905f11c7f63SJim Harris         union
906f11c7f63SJim Harris         {
907f11c7f63SJim Harris             /**
908f11c7f63SJim Harris              * The array should be stored in little endian order.  For example,
909f11c7f63SJim Harris              * if the desired SAS Address is 0x50010B90_0003538D, then it
910f11c7f63SJim Harris              * should be stored in the following manner:
911f11c7f63SJim Harris              *    array[0] = 0x90
912f11c7f63SJim Harris              *    array[1] = 0x0B
913f11c7f63SJim Harris              *    array[2] = 0x01
914f11c7f63SJim Harris              *    array[3] = 0x50
915f11c7f63SJim Harris              *    array[4] = 0x8D
916f11c7f63SJim Harris              *    array[5] = 0x53
917f11c7f63SJim Harris              *    array[6] = 0x03
918f11c7f63SJim Harris              *    array[7] = 0x00
919f11c7f63SJim Harris              */
920f11c7f63SJim Harris             U8 array[8];
921f11c7f63SJim Harris             /**
922f11c7f63SJim Harris              * This is the typedef'd version of the SAS Address used in
923f11c7f63SJim Harris              * the SCI Library.
924f11c7f63SJim Harris              */
925f11c7f63SJim Harris             SCI_SAS_ADDRESS_T  sci_format;
926f11c7f63SJim Harris 
927f11c7f63SJim Harris         } sas_address;
928f11c7f63SJim Harris 
929f11c7f63SJim Harris         /**
93096240c89SEitan Adler          * These are the per PHY equalization settings associated with the
931f11c7f63SJim Harris          * AFE XCVR Tx Amplitude and Equalization Control Register Set
932f11c7f63SJim Harris          * (0 thru 3).
933f11c7f63SJim Harris          *
934f11c7f63SJim Harris          * Operational Note: The following Look-Up-Table registers are engaged
935f11c7f63SJim Harris          * by the AFE block after the following:
936f11c7f63SJim Harris          *  - Software programs the Link Layer AFE Look Up Table Control
937f11c7f63SJim Harris          *    Registers (AFE_LUTCR).
938f11c7f63SJim Harris          *  - Software sets AFE XCVR Tx Control Register Tx Equalization
939f11c7f63SJim Harris          *    Enable bit.
940f11c7f63SJim Harris          */
941f11c7f63SJim Harris         /**
942f11c7f63SJim Harris          * AFE_TX_AMP_CTRL0.  This register is associated with AFE_LUTCR
943f11c7f63SJim Harris          * LUTSel=00b. It contains the Tx Equalization settings that will be
944f11c7f63SJim Harris          * used if a SATA 1.5Gbs or SATA 3.0Gbs device is direct-attached.
945f11c7f63SJim Harris          */
946f11c7f63SJim Harris         U32 afe_tx_amp_control0;
947f11c7f63SJim Harris 
948f11c7f63SJim Harris         /**
949f11c7f63SJim Harris          * AFE_TX_AMP_CTRL1.  This register is associated with AFE_LUTCR
950f11c7f63SJim Harris          * LUTSel=01b. It contains the Tx Equalization settings that will
951f11c7f63SJim Harris          * be used if a SATA 6.0Gbs device is direct-attached.
952f11c7f63SJim Harris          */
953f11c7f63SJim Harris         U32 afe_tx_amp_control1;
954f11c7f63SJim Harris 
955f11c7f63SJim Harris         /**
956f11c7f63SJim Harris          * AFE_TX_AMP_CTRL2.  This register is associated with AFE_LUTCR
957f11c7f63SJim Harris          * LUTSel=10b. It contains the Tx Equalization settings that will
958f11c7f63SJim Harris          * be used if a SAS 1.5Gbs or SAS 3.0Gbs device is direct-attached.
959f11c7f63SJim Harris          */
960f11c7f63SJim Harris         U32 afe_tx_amp_control2;
961f11c7f63SJim Harris 
962f11c7f63SJim Harris         /**
963f11c7f63SJim Harris          * AFE_TX_AMP_CTRL3.  This register is associated with AFE_LUTCR
964f11c7f63SJim Harris          * LUTSel=11b. It contains the Tx Equalization settings that will
965f11c7f63SJim Harris          * be used if a SAS 6.0Gbs device is direct-attached.
966f11c7f63SJim Harris          */
967f11c7f63SJim Harris         U32 afe_tx_amp_control3;
968f11c7f63SJim Harris 
969f11c7f63SJim Harris     } phys[SCI_MAX_PHYS];   // 4 PHYs per SCU controller unit
970f11c7f63SJim Harris 
971f11c7f63SJim Harris } SCI_BIOS_OEM_PARAM_ELEMENT_v_1_3_T;
972f11c7f63SJim Harris 
973f11c7f63SJim Harris /**
974f11c7f63SJim Harris  *  @struct SCI_BIOS_OEM_PARAM_BLOCK
975f11c7f63SJim Harris  *
976f11c7f63SJim Harris  * @brief This structure defines the OEM Parameter block as it will be stored
977f11c7f63SJim Harris  *  in the last 512 bytes of the PDR region in the SPI flash.  It must be
978f11c7f63SJim Harris  *  unpacked or pack(1).
979f11c7f63SJim Harris  */
980f11c7f63SJim Harris typedef struct SCI_BIOS_OEM_PARAM_BLOCK
981f11c7f63SJim Harris {
982f11c7f63SJim Harris     /**
983f11c7f63SJim Harris      * OEM Parameter Block header.
984f11c7f63SJim Harris      */
985f11c7f63SJim Harris     SCI_BIOS_OEM_PARAM_BLOCK_HDR_T  header;
986f11c7f63SJim Harris 
987f11c7f63SJim Harris     /**
988f11c7f63SJim Harris      * Per controller element descriptor containing the controller's
989f11c7f63SJim Harris      * parameter data. The prototype defines just one of these descriptors,
990f11c7f63SJim Harris      * however, the actual runtime number is determined by the num_elements
991f11c7f63SJim Harris      * field in the header.
992f11c7f63SJim Harris      */
993f11c7f63SJim Harris     SCI_BIOS_OEM_PARAM_ELEMENT_T controller_element[1];
994f11c7f63SJim Harris 
995f11c7f63SJim Harris } SCI_BIOS_OEM_PARAM_BLOCK_T;
996f11c7f63SJim Harris 
997f11c7f63SJim Harris #ifdef __cplusplus
998f11c7f63SJim Harris }
999f11c7f63SJim Harris #endif // __cplusplus
1000f11c7f63SJim Harris 
1001f11c7f63SJim Harris #endif // _SCU_BIOS_DEFINITIONS_H_
1002f11c7f63SJim Harris 
1003