xref: /openbmc/linux/drivers/scsi/pm8001/pm80xx_hwi.h (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
1f5860992SSakthivel K /*
2f5860992SSakthivel K  * PMC-Sierra SPCv/ve 8088/8089 SAS/SATA based host adapters driver
3f5860992SSakthivel K  *
4f5860992SSakthivel K  * Copyright (c) 2008-2009 USI Co., Ltd.
5f5860992SSakthivel K  * All rights reserved.
6f5860992SSakthivel K  *
7f5860992SSakthivel K  * Redistribution and use in source and binary forms, with or without
8f5860992SSakthivel K  * modification, are permitted provided that the following conditions
9f5860992SSakthivel K  * are met:
10f5860992SSakthivel K  * 1. Redistributions of source code must retain the above copyright
11f5860992SSakthivel K  *	notice, this list of conditions, and the following disclaimer,
12f5860992SSakthivel K  *	without modification.
13f5860992SSakthivel K  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14f5860992SSakthivel K  *	substantially similar to the "NO WARRANTY" disclaimer below
15f5860992SSakthivel K  *	("Disclaimer") and any redistribution must be conditioned upon
16f5860992SSakthivel K  *	including a substantially similar Disclaimer requirement for further
17f5860992SSakthivel K  *	binary redistribution.
18f5860992SSakthivel K  * 3. Neither the names of the above-listed copyright holders nor the names
19f5860992SSakthivel K  *	of any contributors may be used to endorse or promote products derived
20f5860992SSakthivel K  *	from this software without specific prior written permission.
21f5860992SSakthivel K  *
22f5860992SSakthivel K  * Alternatively, this software may be distributed under the terms of the
23f5860992SSakthivel K  * GNU General Public License ("GPL") version 2 as published by the Free
24f5860992SSakthivel K  * Software Foundation.
25f5860992SSakthivel K  *
26f5860992SSakthivel K  * NO WARRANTY
27f5860992SSakthivel K  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28f5860992SSakthivel K  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29f5860992SSakthivel K  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
30f5860992SSakthivel K  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31f5860992SSakthivel K  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32f5860992SSakthivel K  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33f5860992SSakthivel K  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34f5860992SSakthivel K  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35f5860992SSakthivel K  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36f5860992SSakthivel K  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37f5860992SSakthivel K  * POSSIBILITY OF SUCH DAMAGES.
38f5860992SSakthivel K  *
39f5860992SSakthivel K  */
40f5860992SSakthivel K 
41f5860992SSakthivel K #ifndef _PMC8001_REG_H_
42f5860992SSakthivel K #define _PMC8001_REG_H_
43f5860992SSakthivel K 
44f5860992SSakthivel K #include <linux/types.h>
45f5860992SSakthivel K #include <scsi/libsas.h>
46f5860992SSakthivel K 
47f5860992SSakthivel K /* for Request Opcode of IOMB */
48f5860992SSakthivel K #define OPC_INB_ECHO				1	/* 0x000 */
49f5860992SSakthivel K #define OPC_INB_PHYSTART			4	/* 0x004 */
50f5860992SSakthivel K #define OPC_INB_PHYSTOP				5	/* 0x005 */
51f5860992SSakthivel K #define OPC_INB_SSPINIIOSTART			6	/* 0x006 */
52f5860992SSakthivel K #define OPC_INB_SSPINITMSTART			7	/* 0x007 */
53f5860992SSakthivel K /* 0x8 RESV IN SPCv */
54f5860992SSakthivel K #define OPC_INB_RSVD				8	/* 0x008 */
55f5860992SSakthivel K #define OPC_INB_DEV_HANDLE_ACCEPT		9	/* 0x009 */
56f5860992SSakthivel K #define OPC_INB_SSPTGTIOSTART			10	/* 0x00A */
57f5860992SSakthivel K #define OPC_INB_SSPTGTRSPSTART			11	/* 0x00B */
58f5860992SSakthivel K /* 0xC, 0xD, 0xE removed in SPCv */
59f5860992SSakthivel K #define OPC_INB_SSP_ABORT			15	/* 0x00F */
60f5860992SSakthivel K #define OPC_INB_DEREG_DEV_HANDLE		16	/* 0x010 */
61f5860992SSakthivel K #define OPC_INB_GET_DEV_HANDLE			17	/* 0x011 */
62f5860992SSakthivel K #define OPC_INB_SMP_REQUEST			18	/* 0x012 */
63f5860992SSakthivel K /* 0x13 SMP_RESPONSE is removed in SPCv */
64f5860992SSakthivel K #define OPC_INB_SMP_ABORT			20	/* 0x014 */
65f5860992SSakthivel K /* 0x16 RESV IN SPCv */
66f5860992SSakthivel K #define OPC_INB_RSVD1				22	/* 0x016 */
67f5860992SSakthivel K #define OPC_INB_SATA_HOST_OPSTART		23	/* 0x017 */
68f5860992SSakthivel K #define OPC_INB_SATA_ABORT			24	/* 0x018 */
69f5860992SSakthivel K #define OPC_INB_LOCAL_PHY_CONTROL		25	/* 0x019 */
70f5860992SSakthivel K /* 0x1A RESV IN SPCv */
71f5860992SSakthivel K #define OPC_INB_RSVD2				26	/* 0x01A */
72f5860992SSakthivel K #define OPC_INB_FW_FLASH_UPDATE			32	/* 0x020 */
73f5860992SSakthivel K #define OPC_INB_GPIO				34	/* 0x022 */
74f5860992SSakthivel K #define OPC_INB_SAS_DIAG_MODE_START_END		35	/* 0x023 */
75f5860992SSakthivel K #define OPC_INB_SAS_DIAG_EXECUTE		36	/* 0x024 */
76f5860992SSakthivel K /* 0x25 RESV IN SPCv */
77f5860992SSakthivel K #define OPC_INB_RSVD3				37	/* 0x025 */
78f5860992SSakthivel K #define OPC_INB_GET_TIME_STAMP			38	/* 0x026 */
79f5860992SSakthivel K #define OPC_INB_PORT_CONTROL			39	/* 0x027 */
80f5860992SSakthivel K #define OPC_INB_GET_NVMD_DATA			40	/* 0x028 */
81f5860992SSakthivel K #define OPC_INB_SET_NVMD_DATA			41	/* 0x029 */
82f5860992SSakthivel K #define OPC_INB_SET_DEVICE_STATE		42	/* 0x02A */
83f5860992SSakthivel K #define OPC_INB_GET_DEVICE_STATE		43	/* 0x02B */
84f5860992SSakthivel K #define OPC_INB_SET_DEV_INFO			44	/* 0x02C */
85f5860992SSakthivel K /* 0x2D RESV IN SPCv */
86f5860992SSakthivel K #define OPC_INB_RSVD4				45	/* 0x02D */
87f5860992SSakthivel K #define OPC_INB_SGPIO_REGISTER			46	/* 0x02E */
88f5860992SSakthivel K #define OPC_INB_PCIE_DIAG_EXEC			47	/* 0x02F */
89f5860992SSakthivel K #define OPC_INB_SET_CONTROLLER_CONFIG		48	/* 0x030 */
90f5860992SSakthivel K #define OPC_INB_GET_CONTROLLER_CONFIG		49	/* 0x031 */
91f5860992SSakthivel K #define OPC_INB_REG_DEV				50	/* 0x032 */
92f5860992SSakthivel K #define OPC_INB_SAS_HW_EVENT_ACK		51	/* 0x033 */
93f5860992SSakthivel K #define OPC_INB_GET_DEVICE_INFO			52	/* 0x034 */
94f5860992SSakthivel K #define OPC_INB_GET_PHY_PROFILE			53	/* 0x035 */
95f5860992SSakthivel K #define OPC_INB_FLASH_OP_EXT			54	/* 0x036 */
96f5860992SSakthivel K #define OPC_INB_SET_PHY_PROFILE			55	/* 0x037 */
97f5860992SSakthivel K #define OPC_INB_KEK_MANAGEMENT			256	/* 0x100 */
98f5860992SSakthivel K #define OPC_INB_DEK_MANAGEMENT			257	/* 0x101 */
99f5860992SSakthivel K #define OPC_INB_SSP_INI_DIF_ENC_IO		258	/* 0x102 */
100f5860992SSakthivel K #define OPC_INB_SATA_DIF_ENC_IO			259	/* 0x103 */
101f5860992SSakthivel K 
102f5860992SSakthivel K /* for Response Opcode of IOMB */
103f5860992SSakthivel K #define OPC_OUB_ECHO					1	/* 0x001 */
104f5860992SSakthivel K #define OPC_OUB_RSVD					4	/* 0x004 */
105f5860992SSakthivel K #define OPC_OUB_SSP_COMP				5	/* 0x005 */
106f5860992SSakthivel K #define OPC_OUB_SMP_COMP				6	/* 0x006 */
107f5860992SSakthivel K #define OPC_OUB_LOCAL_PHY_CNTRL				7	/* 0x007 */
108f5860992SSakthivel K #define OPC_OUB_RSVD1					10	/* 0x00A */
109f5860992SSakthivel K #define OPC_OUB_DEREG_DEV				11	/* 0x00B */
110f5860992SSakthivel K #define OPC_OUB_GET_DEV_HANDLE				12	/* 0x00C */
111f5860992SSakthivel K #define OPC_OUB_SATA_COMP				13	/* 0x00D */
112f5860992SSakthivel K #define OPC_OUB_SATA_EVENT				14	/* 0x00E */
113f5860992SSakthivel K #define OPC_OUB_SSP_EVENT				15	/* 0x00F */
114f5860992SSakthivel K #define OPC_OUB_RSVD2					16	/* 0x010 */
115f5860992SSakthivel K /* 0x11 - SMP_RECEIVED Notification removed in SPCv*/
116f5860992SSakthivel K #define OPC_OUB_SSP_RECV_EVENT				18	/* 0x012 */
117f5860992SSakthivel K #define OPC_OUB_RSVD3					19	/* 0x013 */
118f5860992SSakthivel K #define OPC_OUB_FW_FLASH_UPDATE				20	/* 0x014 */
119f5860992SSakthivel K #define OPC_OUB_GPIO_RESPONSE				22	/* 0x016 */
120f5860992SSakthivel K #define OPC_OUB_GPIO_EVENT				23	/* 0x017 */
121f5860992SSakthivel K #define OPC_OUB_GENERAL_EVENT				24	/* 0x018 */
122f5860992SSakthivel K #define OPC_OUB_SSP_ABORT_RSP				26	/* 0x01A */
123f5860992SSakthivel K #define OPC_OUB_SATA_ABORT_RSP				27	/* 0x01B */
124f5860992SSakthivel K #define OPC_OUB_SAS_DIAG_MODE_START_END			28	/* 0x01C */
125f5860992SSakthivel K #define OPC_OUB_SAS_DIAG_EXECUTE			29	/* 0x01D */
126f5860992SSakthivel K #define OPC_OUB_GET_TIME_STAMP				30	/* 0x01E */
127f5860992SSakthivel K #define OPC_OUB_RSVD4					31	/* 0x01F */
128f5860992SSakthivel K #define OPC_OUB_PORT_CONTROL				32	/* 0x020 */
129f5860992SSakthivel K #define OPC_OUB_SKIP_ENTRY				33	/* 0x021 */
130f5860992SSakthivel K #define OPC_OUB_SMP_ABORT_RSP				34	/* 0x022 */
131f5860992SSakthivel K #define OPC_OUB_GET_NVMD_DATA				35	/* 0x023 */
132f5860992SSakthivel K #define OPC_OUB_SET_NVMD_DATA				36	/* 0x024 */
133f5860992SSakthivel K #define OPC_OUB_DEVICE_HANDLE_REMOVAL			37	/* 0x025 */
134f5860992SSakthivel K #define OPC_OUB_SET_DEVICE_STATE			38	/* 0x026 */
135f5860992SSakthivel K #define OPC_OUB_GET_DEVICE_STATE			39	/* 0x027 */
136f5860992SSakthivel K #define OPC_OUB_SET_DEV_INFO				40	/* 0x028 */
137f5860992SSakthivel K #define OPC_OUB_RSVD5					41	/* 0x029 */
138f5860992SSakthivel K #define OPC_OUB_HW_EVENT				1792	/* 0x700 */
139f5860992SSakthivel K #define OPC_OUB_DEV_HANDLE_ARRIV			1824	/* 0x720 */
140f5860992SSakthivel K #define OPC_OUB_THERM_HW_EVENT				1840	/* 0x730 */
141f5860992SSakthivel K #define OPC_OUB_SGPIO_RESP				2094	/* 0x82E */
142f5860992SSakthivel K #define OPC_OUB_PCIE_DIAG_EXECUTE			2095	/* 0x82F */
143f5860992SSakthivel K #define OPC_OUB_DEV_REGIST				2098	/* 0x832 */
144f5860992SSakthivel K #define OPC_OUB_SAS_HW_EVENT_ACK			2099	/* 0x833 */
145f5860992SSakthivel K #define OPC_OUB_GET_DEVICE_INFO				2100	/* 0x834 */
146f5860992SSakthivel K /* spcv specific commands */
147f5860992SSakthivel K #define OPC_OUB_PHY_START_RESP				2052	/* 0x804 */
148f5860992SSakthivel K #define OPC_OUB_PHY_STOP_RESP				2053	/* 0x805 */
149f5860992SSakthivel K #define OPC_OUB_SET_CONTROLLER_CONFIG			2096	/* 0x830 */
150f5860992SSakthivel K #define OPC_OUB_GET_CONTROLLER_CONFIG			2097	/* 0x831 */
151f5860992SSakthivel K #define OPC_OUB_GET_PHY_PROFILE				2101	/* 0x835 */
152f5860992SSakthivel K #define OPC_OUB_FLASH_OP_EXT				2102	/* 0x836 */
153f5860992SSakthivel K #define OPC_OUB_SET_PHY_PROFILE				2103	/* 0x837 */
154f5860992SSakthivel K #define OPC_OUB_KEK_MANAGEMENT_RESP			2304	/* 0x900 */
155f5860992SSakthivel K #define OPC_OUB_DEK_MANAGEMENT_RESP			2305	/* 0x901 */
156f5860992SSakthivel K #define OPC_OUB_SSP_COALESCED_COMP_RESP			2306	/* 0x902 */
157f5860992SSakthivel K 
158f5860992SSakthivel K /* for phy start*/
159f5860992SSakthivel K #define SSC_DISABLE_15			(0x01 << 16)
160f5860992SSakthivel K #define SSC_DISABLE_30			(0x02 << 16)
161f5860992SSakthivel K #define SSC_DISABLE_60			(0x04 << 16)
162f5860992SSakthivel K #define SAS_ASE				(0x01 << 15)
163f5860992SSakthivel K #define SPINHOLD_DISABLE		(0x00 << 14)
164f5860992SSakthivel K #define SPINHOLD_ENABLE			(0x01 << 14)
165f5860992SSakthivel K #define LINKMODE_SAS			(0x01 << 12)
166f5860992SSakthivel K #define LINKMODE_DSATA			(0x02 << 12)
167f5860992SSakthivel K #define LINKMODE_AUTO			(0x03 << 12)
168f5860992SSakthivel K #define LINKRATE_15			(0x01 << 8)
169f5860992SSakthivel K #define LINKRATE_30			(0x02 << 8)
170790a3856SViswas G #define LINKRATE_60			(0x04 << 8)
171a9a923e5SAnand Kumar Santhanam #define LINKRATE_120			(0x08 << 8)
172f5860992SSakthivel K 
173cd135754SDeepak Ukey /*phy_stop*/
174cd135754SDeepak Ukey #define PHY_STOP_SUCCESS		0x00
175cd135754SDeepak Ukey #define PHY_STOP_ERR_DEVICE_ATTACHED	0x1046
176cd135754SDeepak Ukey 
17727909407SAnand Kumar Santhanam /* phy_profile */
17827909407SAnand Kumar Santhanam #define SAS_PHY_ANALOG_SETTINGS_PAGE	0x04
17927909407SAnand Kumar Santhanam #define PHY_DWORD_LENGTH		0xC
18027909407SAnand Kumar Santhanam 
181f5860992SSakthivel K /* Thermal related */
182f5860992SSakthivel K #define	THERMAL_ENABLE			0x1
183f5860992SSakthivel K #define	THERMAL_LOG_ENABLE		0x1
184842784e0SViswas G #define THERMAL_PAGE_CODE_7H		0x6
185842784e0SViswas G #define THERMAL_PAGE_CODE_8H		0x7
186f5860992SSakthivel K #define LTEMPHIL			 70
187f5860992SSakthivel K #define RTEMPHIL			100
188f5860992SSakthivel K 
189f5860992SSakthivel K /* Encryption info */
190f5860992SSakthivel K #define SCRATCH_PAD3_ENC_DISABLED	0x00000000
191f5860992SSakthivel K #define SCRATCH_PAD3_ENC_DIS_ERR	0x00000001
192f5860992SSakthivel K #define SCRATCH_PAD3_ENC_ENA_ERR	0x00000002
193f5860992SSakthivel K #define SCRATCH_PAD3_ENC_READY		0x00000003
194f5860992SSakthivel K #define SCRATCH_PAD3_ENC_MASK		SCRATCH_PAD3_ENC_READY
195f5860992SSakthivel K 
196f5860992SSakthivel K #define SCRATCH_PAD3_XTS_ENABLED		(1 << 14)
197f5860992SSakthivel K #define SCRATCH_PAD3_SMA_ENABLED		(1 << 4)
198f5860992SSakthivel K #define SCRATCH_PAD3_SMB_ENABLED		(1 << 5)
199f5860992SSakthivel K #define SCRATCH_PAD3_SMF_ENABLED		0
200f5860992SSakthivel K #define SCRATCH_PAD3_SM_MASK			0x000000F0
201f5860992SSakthivel K #define SCRATCH_PAD3_ERR_CODE			0x00FF0000
202f5860992SSakthivel K 
203f5860992SSakthivel K #define SEC_MODE_SMF				0x0
204f5860992SSakthivel K #define SEC_MODE_SMA				0x100
205f5860992SSakthivel K #define SEC_MODE_SMB				0x200
206f5860992SSakthivel K #define CIPHER_MODE_ECB				0x00000001
207f5860992SSakthivel K #define CIPHER_MODE_XTS				0x00000002
208f5860992SSakthivel K #define KEK_MGMT_SUBOP_KEYCARDUPDATE		0x4
209f5860992SSakthivel K 
210a6cb3d01SSakthivel K /* SAS protocol timer configuration page */
211a6cb3d01SSakthivel K #define SAS_PROTOCOL_TIMER_CONFIG_PAGE  0x04
212a6cb3d01SSakthivel K #define STP_MCT_TMO                     32
213a6cb3d01SSakthivel K #define SSP_MCT_TMO                     32
214a6cb3d01SSakthivel K #define SAS_MAX_OPEN_TIME				5
215a6cb3d01SSakthivel K #define SMP_MAX_CONN_TIMER              0xFF
216a6cb3d01SSakthivel K #define STP_FRM_TIMER                   0
217a6cb3d01SSakthivel K #define STP_IDLE_TIME                   5 /* 5 us; controller default */
218a6cb3d01SSakthivel K #define SAS_MFD                         0
219a6cb3d01SSakthivel K #define SAS_OPNRJT_RTRY_INTVL           2
220a6cb3d01SSakthivel K #define SAS_DOPNRJT_RTRY_TMO            128
221a6cb3d01SSakthivel K #define SAS_COPNRJT_RTRY_TMO            128
222a6cb3d01SSakthivel K 
223d71023afSakshatzen #define SPCV_DOORBELL_CLEAR_TIMEOUT	(30 * 50) /* 30 sec */
224d71023afSakshatzen #define SPC_DOORBELL_CLEAR_TIMEOUT	(15 * 50) /* 15 sec */
225e90e2362Sianyar 
226a6cb3d01SSakthivel K /*
227a6cb3d01SSakthivel K   Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second.
228a6cb3d01SSakthivel K   Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128
229a6cb3d01SSakthivel K   is DOPNRJT_RTRY_TMO
230a6cb3d01SSakthivel K */
231a6cb3d01SSakthivel K #define SAS_DOPNRJT_RTRY_THR            23438
232a6cb3d01SSakthivel K #define SAS_COPNRJT_RTRY_THR            23438
233a6cb3d01SSakthivel K #define SAS_MAX_AIP                     0x200000
234a6cb3d01SSakthivel K #define IT_NEXUS_TIMEOUT       0x7D0
235a6cb3d01SSakthivel K #define PORT_RECOVERY_TIMEOUT  ((IT_NEXUS_TIMEOUT/100) + 30)
236196ba662SDeepak Ukey /* Port recovery timeout, 10000 ms for PM8006 controller */
237196ba662SDeepak Ukey #define CHIP_8006_PORT_RECOVERY_TIMEOUT 0x640000
238a6cb3d01SSakthivel K 
2395990fd57SViswas G #ifdef __LITTLE_ENDIAN_BITFIELD
2405990fd57SViswas G struct sas_identify_frame_local {
2415990fd57SViswas G 	/* Byte 0 */
2425990fd57SViswas G 	u8  frame_type:4;
2435990fd57SViswas G 	u8  dev_type:3;
2445990fd57SViswas G 	u8  _un0:1;
2455990fd57SViswas G 
2465990fd57SViswas G 	/* Byte 1 */
2475990fd57SViswas G 	u8  _un1;
2485990fd57SViswas G 
2495990fd57SViswas G 	/* Byte 2 */
2505990fd57SViswas G 	union {
2515990fd57SViswas G 		struct {
2525990fd57SViswas G 			u8  _un20:1;
2535990fd57SViswas G 			u8  smp_iport:1;
2545990fd57SViswas G 			u8  stp_iport:1;
2555990fd57SViswas G 			u8  ssp_iport:1;
2565990fd57SViswas G 			u8  _un247:4;
2575990fd57SViswas G 		};
2585990fd57SViswas G 		u8 initiator_bits;
2595990fd57SViswas G 	};
2605990fd57SViswas G 
2615990fd57SViswas G 	/* Byte 3 */
2625990fd57SViswas G 	union {
2635990fd57SViswas G 		struct {
2645990fd57SViswas G 			u8  _un30:1;
2655990fd57SViswas G 			u8 smp_tport:1;
2665990fd57SViswas G 			u8 stp_tport:1;
2675990fd57SViswas G 			u8 ssp_tport:1;
2685990fd57SViswas G 			u8 _un347:4;
2695990fd57SViswas G 		};
2705990fd57SViswas G 		u8 target_bits;
2715990fd57SViswas G 	};
2725990fd57SViswas G 
2735990fd57SViswas G 	/* Byte 4 - 11 */
2745990fd57SViswas G 	u8 _un4_11[8];
2755990fd57SViswas G 
2765990fd57SViswas G 	/* Byte 12 - 19 */
2775990fd57SViswas G 	u8 sas_addr[SAS_ADDR_SIZE];
2785990fd57SViswas G 
2795990fd57SViswas G 	/* Byte 20 */
2805990fd57SViswas G 	u8 phy_id;
2815990fd57SViswas G 
2825990fd57SViswas G 	u8 _un21_27[7];
2835990fd57SViswas G 
2845990fd57SViswas G } __packed;
2855990fd57SViswas G 
2865990fd57SViswas G #elif defined(__BIG_ENDIAN_BITFIELD)
2875990fd57SViswas G struct sas_identify_frame_local {
2885990fd57SViswas G 	/* Byte 0 */
2895990fd57SViswas G 	u8  _un0:1;
2905990fd57SViswas G 	u8  dev_type:3;
2915990fd57SViswas G 	u8  frame_type:4;
2925990fd57SViswas G 
2935990fd57SViswas G 	/* Byte 1 */
2945990fd57SViswas G 	u8  _un1;
2955990fd57SViswas G 
2965990fd57SViswas G 	/* Byte 2 */
2975990fd57SViswas G 	union {
2985990fd57SViswas G 		struct {
2995990fd57SViswas G 			u8  _un247:4;
3005990fd57SViswas G 			u8  ssp_iport:1;
3015990fd57SViswas G 			u8  stp_iport:1;
3025990fd57SViswas G 			u8  smp_iport:1;
3035990fd57SViswas G 			u8  _un20:1;
3045990fd57SViswas G 		};
3055990fd57SViswas G 		u8 initiator_bits;
3065990fd57SViswas G 	};
3075990fd57SViswas G 
3085990fd57SViswas G 	/* Byte 3 */
3095990fd57SViswas G 	union {
3105990fd57SViswas G 		struct {
3115990fd57SViswas G 			u8 _un347:4;
3125990fd57SViswas G 			u8 ssp_tport:1;
3135990fd57SViswas G 			u8 stp_tport:1;
3145990fd57SViswas G 			u8 smp_tport:1;
3155990fd57SViswas G 			u8 _un30:1;
3165990fd57SViswas G 		};
3175990fd57SViswas G 		u8 target_bits;
3185990fd57SViswas G 	};
3195990fd57SViswas G 
3205990fd57SViswas G 	/* Byte 4 - 11 */
3215990fd57SViswas G 	u8 _un4_11[8];
3225990fd57SViswas G 
3235990fd57SViswas G 	/* Byte 12 - 19 */
3245990fd57SViswas G 	u8 sas_addr[SAS_ADDR_SIZE];
3255990fd57SViswas G 
3265990fd57SViswas G 	/* Byte 20 */
3275990fd57SViswas G 	u8 phy_id;
3285990fd57SViswas G 
3295990fd57SViswas G 	u8 _un21_27[7];
3305990fd57SViswas G } __packed;
3315990fd57SViswas G #else
3325990fd57SViswas G #error "Bitfield order not defined!"
3335990fd57SViswas G #endif
3345990fd57SViswas G 
335f5860992SSakthivel K struct mpi_msg_hdr {
336f5860992SSakthivel K 	__le32	header;	/* Bits [11:0] - Message operation code */
337f5860992SSakthivel K 	/* Bits [15:12] - Message Category */
338f5860992SSakthivel K 	/* Bits [21:16] - Outboundqueue ID for the
339f5860992SSakthivel K 	operation completion message */
340f5860992SSakthivel K 	/* Bits [23:22] - Reserved */
341f5860992SSakthivel K 	/* Bits [28:24] - Buffer Count, indicates how
342f5860992SSakthivel K 	many buffer are allocated for the massage */
343f5860992SSakthivel K 	/* Bits [30:29] - Reserved */
344f5860992SSakthivel K 	/* Bits [31] - Message Valid bit */
345f5860992SSakthivel K } __attribute__((packed, aligned(4)));
346f5860992SSakthivel K 
347f5860992SSakthivel K /*
348f5860992SSakthivel K  * brief the data structure of PHY Start Command
349f5860992SSakthivel K  * use to describe enable the phy (128 bytes)
350f5860992SSakthivel K  */
351f5860992SSakthivel K struct phy_start_req {
352f5860992SSakthivel K 	__le32	tag;
353f5860992SSakthivel K 	__le32	ase_sh_lm_slr_phyid;
3545990fd57SViswas G 	struct sas_identify_frame_local sas_identify; /* 28 Bytes */
355f5860992SSakthivel K 	__le32 spasti;
356f5860992SSakthivel K 	u32	reserved[21];
357f5860992SSakthivel K } __attribute__((packed, aligned(4)));
358f5860992SSakthivel K 
359f5860992SSakthivel K /*
360f5860992SSakthivel K  * brief the data structure of PHY Start Command
361f5860992SSakthivel K  * use to disable the phy (128 bytes)
362f5860992SSakthivel K  */
363f5860992SSakthivel K struct phy_stop_req {
364f5860992SSakthivel K 	__le32	tag;
365f5860992SSakthivel K 	__le32	phy_id;
366f5860992SSakthivel K 	u32	reserved[29];
367f5860992SSakthivel K } __attribute__((packed, aligned(4)));
368f5860992SSakthivel K 
369f5860992SSakthivel K /* set device bits fis - device to host */
370f5860992SSakthivel K struct set_dev_bits_fis {
371f5860992SSakthivel K 	u8	fis_type;	/* 0xA1*/
372f5860992SSakthivel K 	u8	n_i_pmport;
373f5860992SSakthivel K 	/* b7 : n Bit. Notification bit. If set device needs attention. */
374f5860992SSakthivel K 	/* b6 : i Bit. Interrupt Bit */
375f5860992SSakthivel K 	/* b5-b4: reserved2 */
376f5860992SSakthivel K 	/* b3-b0: PM Port */
377f5860992SSakthivel K 	u8	status;
378f5860992SSakthivel K 	u8	error;
379f5860992SSakthivel K 	u32	_r_a;
380f5860992SSakthivel K } __attribute__ ((packed));
381f5860992SSakthivel K /* PIO setup FIS - device to host */
382f5860992SSakthivel K struct pio_setup_fis {
383f5860992SSakthivel K 	u8	fis_type;	/* 0x5f */
384f5860992SSakthivel K 	u8	i_d_pmPort;
385f5860992SSakthivel K 	/* b7 : reserved */
386f5860992SSakthivel K 	/* b6 : i bit. Interrupt bit */
387f5860992SSakthivel K 	/* b5 : d bit. data transfer direction. set to 1 for device to host
388f5860992SSakthivel K 	xfer */
389f5860992SSakthivel K 	/* b4 : reserved */
390f5860992SSakthivel K 	/* b3-b0: PM Port */
391f5860992SSakthivel K 	u8	status;
392f5860992SSakthivel K 	u8	error;
393f5860992SSakthivel K 	u8	lbal;
394f5860992SSakthivel K 	u8	lbam;
395f5860992SSakthivel K 	u8	lbah;
396f5860992SSakthivel K 	u8	device;
397f5860992SSakthivel K 	u8	lbal_exp;
398f5860992SSakthivel K 	u8	lbam_exp;
399f5860992SSakthivel K 	u8	lbah_exp;
400f5860992SSakthivel K 	u8	_r_a;
401f5860992SSakthivel K 	u8	sector_count;
402f5860992SSakthivel K 	u8	sector_count_exp;
403f5860992SSakthivel K 	u8	_r_b;
404f5860992SSakthivel K 	u8	e_status;
405f5860992SSakthivel K 	u8	_r_c[2];
406f5860992SSakthivel K 	u8	transfer_count;
407f5860992SSakthivel K } __attribute__ ((packed));
408f5860992SSakthivel K 
409f5860992SSakthivel K /*
410f5860992SSakthivel K  * brief the data structure of SATA Completion Response
411f5860992SSakthivel K  * use to describe the sata task response (64 bytes)
412f5860992SSakthivel K  */
413f5860992SSakthivel K struct sata_completion_resp {
414f5860992SSakthivel K 	__le32	tag;
415f5860992SSakthivel K 	__le32	status;
416f5860992SSakthivel K 	__le32	param;
417f5860992SSakthivel K 	u32	sata_resp[12];
418f5860992SSakthivel K } __attribute__((packed, aligned(4)));
419f5860992SSakthivel K 
420f5860992SSakthivel K /*
421f5860992SSakthivel K  * brief the data structure of SAS HW Event Notification
422f5860992SSakthivel K  * use to alert the host about the hardware event(64 bytes)
423f5860992SSakthivel K  */
424f5860992SSakthivel K /* updated outbound struct for spcv */
425f5860992SSakthivel K 
426f5860992SSakthivel K struct hw_event_resp {
427f5860992SSakthivel K 	__le32	lr_status_evt_portid;
428f5860992SSakthivel K 	__le32	evt_param;
429f5860992SSakthivel K 	__le32	phyid_npip_portstate;
430f5860992SSakthivel K 	struct sas_identify_frame	sas_identify;
431f5860992SSakthivel K 	struct dev_to_host_fis	sata_fis;
432f5860992SSakthivel K } __attribute__((packed, aligned(4)));
433f5860992SSakthivel K 
434f5860992SSakthivel K /*
435f5860992SSakthivel K  * brief the data structure for thermal event notification
436f5860992SSakthivel K  */
437f5860992SSakthivel K 
438f5860992SSakthivel K struct thermal_hw_event {
439f5860992SSakthivel K 	__le32	thermal_event;
440f5860992SSakthivel K 	__le32	rht_lht;
441f5860992SSakthivel K } __attribute__((packed, aligned(4)));
442f5860992SSakthivel K 
443f5860992SSakthivel K /*
444f5860992SSakthivel K  * brief the data structure of REGISTER DEVICE Command
445f5860992SSakthivel K  * use to describe MPI REGISTER DEVICE Command (64 bytes)
446f5860992SSakthivel K  */
447f5860992SSakthivel K 
448f5860992SSakthivel K struct reg_dev_req {
449f5860992SSakthivel K 	__le32	tag;
450f5860992SSakthivel K 	__le32	phyid_portid;
451f5860992SSakthivel K 	__le32	dtype_dlr_mcn_ir_retry;
452f5860992SSakthivel K 	__le32	firstburstsize_ITNexustimeout;
453f5860992SSakthivel K 	u8	sas_addr[SAS_ADDR_SIZE];
454f5860992SSakthivel K 	__le32	upper_device_id;
455f5860992SSakthivel K 	u32	reserved[24];
456f5860992SSakthivel K } __attribute__((packed, aligned(4)));
457f5860992SSakthivel K 
458f5860992SSakthivel K /*
459f5860992SSakthivel K  * brief the data structure of DEREGISTER DEVICE Command
460f5860992SSakthivel K  * use to request spc to remove all internal resources associated
461f5860992SSakthivel K  * with the device id (64 bytes)
462f5860992SSakthivel K  */
463f5860992SSakthivel K 
464f5860992SSakthivel K struct dereg_dev_req {
465f5860992SSakthivel K 	__le32	tag;
466f5860992SSakthivel K 	__le32	device_id;
467f5860992SSakthivel K 	u32	reserved[29];
468f5860992SSakthivel K } __attribute__((packed, aligned(4)));
469f5860992SSakthivel K 
470f5860992SSakthivel K /*
471f5860992SSakthivel K  * brief the data structure of DEVICE_REGISTRATION Response
472f5860992SSakthivel K  * use to notify the completion of the device registration (64 bytes)
473f5860992SSakthivel K  */
474f5860992SSakthivel K struct dev_reg_resp {
475f5860992SSakthivel K 	__le32	tag;
476f5860992SSakthivel K 	__le32	status;
477f5860992SSakthivel K 	__le32	device_id;
478f5860992SSakthivel K 	u32	reserved[12];
479f5860992SSakthivel K } __attribute__((packed, aligned(4)));
480f5860992SSakthivel K 
481f5860992SSakthivel K /*
482f5860992SSakthivel K  * brief the data structure of Local PHY Control Command
483f5860992SSakthivel K  * use to issue PHY CONTROL to local phy (64 bytes)
484f5860992SSakthivel K  */
485f5860992SSakthivel K struct local_phy_ctl_req {
486f5860992SSakthivel K 	__le32	tag;
487f5860992SSakthivel K 	__le32	phyop_phyid;
488f5860992SSakthivel K 	u32	reserved1[29];
489f5860992SSakthivel K } __attribute__((packed, aligned(4)));
490f5860992SSakthivel K 
491f5860992SSakthivel K /**
492f5860992SSakthivel K  * brief the data structure of Local Phy Control Response
493f5860992SSakthivel K  * use to describe MPI Local Phy Control Response (64 bytes)
494f5860992SSakthivel K  */
495f5860992SSakthivel K  struct local_phy_ctl_resp {
496f5860992SSakthivel K 	__le32	tag;
497f5860992SSakthivel K 	__le32	phyop_phyid;
498f5860992SSakthivel K 	__le32	status;
499f5860992SSakthivel K 	u32	reserved[12];
500f5860992SSakthivel K } __attribute__((packed, aligned(4)));
501f5860992SSakthivel K 
502f5860992SSakthivel K #define OP_BITS 0x0000FF00
503f5860992SSakthivel K #define ID_BITS 0x000000FF
504f5860992SSakthivel K 
505f5860992SSakthivel K /*
506f5860992SSakthivel K  * brief the data structure of PORT Control Command
507f5860992SSakthivel K  * use to control port properties (64 bytes)
508f5860992SSakthivel K  */
509f5860992SSakthivel K 
510f5860992SSakthivel K struct port_ctl_req {
511f5860992SSakthivel K 	__le32	tag;
512f5860992SSakthivel K 	__le32	portop_portid;
513f5860992SSakthivel K 	__le32	param0;
514f5860992SSakthivel K 	__le32	param1;
515f5860992SSakthivel K 	u32	reserved1[27];
516f5860992SSakthivel K } __attribute__((packed, aligned(4)));
517f5860992SSakthivel K 
518f5860992SSakthivel K /*
519f5860992SSakthivel K  * brief the data structure of HW Event Ack Command
520f5860992SSakthivel K  * use to acknowledge receive HW event (64 bytes)
521f5860992SSakthivel K  */
522f5860992SSakthivel K struct hw_event_ack_req {
523f5860992SSakthivel K 	__le32	tag;
524f5860992SSakthivel K 	__le32	phyid_sea_portid;
525f5860992SSakthivel K 	__le32	param0;
526f5860992SSakthivel K 	__le32	param1;
527f5860992SSakthivel K 	u32	reserved1[27];
528f5860992SSakthivel K } __attribute__((packed, aligned(4)));
529f5860992SSakthivel K 
530f5860992SSakthivel K /*
531f5860992SSakthivel K  * brief the data structure of PHY_START Response Command
532f5860992SSakthivel K  * indicates the completion of PHY_START command (64 bytes)
533f5860992SSakthivel K  */
534f5860992SSakthivel K struct phy_start_resp {
535f5860992SSakthivel K 	__le32	tag;
536f5860992SSakthivel K 	__le32	status;
537f5860992SSakthivel K 	__le32	phyid;
538f5860992SSakthivel K 	u32	reserved[12];
539f5860992SSakthivel K } __attribute__((packed, aligned(4)));
540f5860992SSakthivel K 
541f5860992SSakthivel K /*
542f5860992SSakthivel K  * brief the data structure of PHY_STOP Response Command
543f5860992SSakthivel K  * indicates the completion of PHY_STOP command (64 bytes)
544f5860992SSakthivel K  */
545f5860992SSakthivel K struct phy_stop_resp {
546f5860992SSakthivel K 	__le32	tag;
547f5860992SSakthivel K 	__le32	status;
548f5860992SSakthivel K 	__le32	phyid;
549f5860992SSakthivel K 	u32	reserved[12];
550f5860992SSakthivel K } __attribute__((packed, aligned(4)));
551f5860992SSakthivel K 
552f5860992SSakthivel K /*
553f5860992SSakthivel K  * brief the data structure of SSP Completion Response
554f5860992SSakthivel K  * use to indicate a SSP Completion (n bytes)
555f5860992SSakthivel K  */
556f5860992SSakthivel K struct ssp_completion_resp {
557f5860992SSakthivel K 	__le32	tag;
558f5860992SSakthivel K 	__le32	status;
559f5860992SSakthivel K 	__le32	param;
560f5860992SSakthivel K 	__le32	ssptag_rescv_rescpad;
561f5860992SSakthivel K 	struct ssp_response_iu ssp_resp_iu;
562f5860992SSakthivel K 	__le32	residual_count;
563f5860992SSakthivel K } __attribute__((packed, aligned(4)));
564f5860992SSakthivel K 
565f5860992SSakthivel K #define SSP_RESCV_BIT	0x00010000
566f5860992SSakthivel K 
567f5860992SSakthivel K /*
568f5860992SSakthivel K  * brief the data structure of SATA EVNET response
569f5860992SSakthivel K  * use to indicate a SATA Completion (64 bytes)
570f5860992SSakthivel K  */
571f5860992SSakthivel K struct sata_event_resp {
572f5860992SSakthivel K 	__le32 tag;
573f5860992SSakthivel K 	__le32 event;
574f5860992SSakthivel K 	__le32 port_id;
575f5860992SSakthivel K 	__le32 device_id;
576f5860992SSakthivel K 	u32 reserved;
577f5860992SSakthivel K 	__le32 event_param0;
578f5860992SSakthivel K 	__le32 event_param1;
579f5860992SSakthivel K 	__le32 sata_addr_h32;
580f5860992SSakthivel K 	__le32 sata_addr_l32;
581f5860992SSakthivel K 	__le32 e_udt1_udt0_crc;
582f5860992SSakthivel K 	__le32 e_udt5_udt4_udt3_udt2;
583f5860992SSakthivel K 	__le32 a_udt1_udt0_crc;
584f5860992SSakthivel K 	__le32 a_udt5_udt4_udt3_udt2;
585f5860992SSakthivel K 	__le32 hwdevid_diferr;
586f5860992SSakthivel K 	__le32 err_framelen_byteoffset;
587f5860992SSakthivel K 	__le32 err_dataframe;
588f5860992SSakthivel K } __attribute__((packed, aligned(4)));
589f5860992SSakthivel K 
590f5860992SSakthivel K /*
591f5860992SSakthivel K  * brief the data structure of SSP EVNET esponse
592f5860992SSakthivel K  * use to indicate a SSP Completion (64 bytes)
593f5860992SSakthivel K  */
594f5860992SSakthivel K struct ssp_event_resp {
595f5860992SSakthivel K 	__le32 tag;
596f5860992SSakthivel K 	__le32 event;
597f5860992SSakthivel K 	__le32 port_id;
598f5860992SSakthivel K 	__le32 device_id;
599f5860992SSakthivel K 	__le32 ssp_tag;
600f5860992SSakthivel K 	__le32 event_param0;
601f5860992SSakthivel K 	__le32 event_param1;
602f5860992SSakthivel K 	__le32 sas_addr_h32;
603f5860992SSakthivel K 	__le32 sas_addr_l32;
604f5860992SSakthivel K 	__le32 e_udt1_udt0_crc;
605f5860992SSakthivel K 	__le32 e_udt5_udt4_udt3_udt2;
606f5860992SSakthivel K 	__le32 a_udt1_udt0_crc;
607f5860992SSakthivel K 	__le32 a_udt5_udt4_udt3_udt2;
608f5860992SSakthivel K 	__le32 hwdevid_diferr;
609f5860992SSakthivel K 	__le32 err_framelen_byteoffset;
610f5860992SSakthivel K 	__le32 err_dataframe;
611f5860992SSakthivel K } __attribute__((packed, aligned(4)));
612f5860992SSakthivel K 
613f5860992SSakthivel K /**
614f5860992SSakthivel K  * brief the data structure of General Event Notification Response
615f5860992SSakthivel K  * use to describe MPI General Event Notification Response (64 bytes)
616f5860992SSakthivel K  */
617f5860992SSakthivel K struct general_event_resp {
618f5860992SSakthivel K 	__le32	status;
619f5860992SSakthivel K 	__le32	inb_IOMB_payload[14];
620f5860992SSakthivel K } __attribute__((packed, aligned(4)));
621f5860992SSakthivel K 
622f5860992SSakthivel K #define GENERAL_EVENT_PAYLOAD	14
623f5860992SSakthivel K #define OPCODE_BITS	0x00000fff
624f5860992SSakthivel K 
625f5860992SSakthivel K /*
626f5860992SSakthivel K  * brief the data structure of SMP Request Command
627f5860992SSakthivel K  * use to describe MPI SMP REQUEST Command (64 bytes)
628f5860992SSakthivel K  */
629f5860992SSakthivel K struct smp_req {
630f5860992SSakthivel K 	__le32	tag;
631f5860992SSakthivel K 	__le32	device_id;
632f5860992SSakthivel K 	__le32	len_ip_ir;
633f5860992SSakthivel K 	/* Bits [0] - Indirect response */
634f5860992SSakthivel K 	/* Bits [1] - Indirect Payload */
635f5860992SSakthivel K 	/* Bits [15:2] - Reserved */
636f5860992SSakthivel K 	/* Bits [23:16] - direct payload Len */
637f5860992SSakthivel K 	/* Bits [31:24] - Reserved */
638f5860992SSakthivel K 	u8	smp_req16[16];
639f5860992SSakthivel K 	union {
640f5860992SSakthivel K 		u8	smp_req[32];
641f5860992SSakthivel K 		struct {
642f5860992SSakthivel K 			__le64 long_req_addr;/* sg dma address, LE */
643f5860992SSakthivel K 			__le32 long_req_size;/* LE */
644f5860992SSakthivel K 			u32	_r_a;
645f5860992SSakthivel K 			__le64 long_resp_addr;/* sg dma address, LE */
646f5860992SSakthivel K 			__le32 long_resp_size;/* LE */
647f5860992SSakthivel K 			u32	_r_b;
648f5860992SSakthivel K 			} long_smp_req;/* sequencer extension */
649f5860992SSakthivel K 	};
650f5860992SSakthivel K 	__le32	rsvd[16];
651f5860992SSakthivel K } __attribute__((packed, aligned(4)));
652f5860992SSakthivel K /*
653f5860992SSakthivel K  * brief the data structure of SMP Completion Response
654f5860992SSakthivel K  * use to describe MPI SMP Completion Response (64 bytes)
655f5860992SSakthivel K  */
656f5860992SSakthivel K struct smp_completion_resp {
657f5860992SSakthivel K 	__le32	tag;
658f5860992SSakthivel K 	__le32	status;
659f5860992SSakthivel K 	__le32	param;
660f5860992SSakthivel K 	u8	_r_a[252];
661f5860992SSakthivel K } __attribute__((packed, aligned(4)));
662f5860992SSakthivel K 
663f5860992SSakthivel K /*
664f5860992SSakthivel K  *brief the data structure of SSP SMP SATA Abort Command
665f5860992SSakthivel K  * use to describe MPI SSP SMP & SATA Abort Command (64 bytes)
666f5860992SSakthivel K  */
667f5860992SSakthivel K struct task_abort_req {
668f5860992SSakthivel K 	__le32	tag;
669f5860992SSakthivel K 	__le32	device_id;
670f5860992SSakthivel K 	__le32	tag_to_abort;
671f5860992SSakthivel K 	__le32	abort_all;
672f5860992SSakthivel K 	u32	reserved[27];
673f5860992SSakthivel K } __attribute__((packed, aligned(4)));
674f5860992SSakthivel K 
675f5860992SSakthivel K /**
676f5860992SSakthivel K  * brief the data structure of SSP SATA SMP Abort Response
677f5860992SSakthivel K  * use to describe SSP SMP & SATA Abort Response ( 64 bytes)
678f5860992SSakthivel K  */
679f5860992SSakthivel K struct task_abort_resp {
680f5860992SSakthivel K 	__le32	tag;
681f5860992SSakthivel K 	__le32	status;
682f5860992SSakthivel K 	__le32	scp;
683f5860992SSakthivel K 	u32	reserved[12];
684f5860992SSakthivel K } __attribute__((packed, aligned(4)));
685f5860992SSakthivel K 
686f5860992SSakthivel K /**
687f5860992SSakthivel K  * brief the data structure of SAS Diagnostic Start/End Command
688f5860992SSakthivel K  * use to describe MPI SAS Diagnostic Start/End Command (64 bytes)
689f5860992SSakthivel K  */
690f5860992SSakthivel K struct sas_diag_start_end_req {
691f5860992SSakthivel K 	__le32	tag;
692f5860992SSakthivel K 	__le32	operation_phyid;
693f5860992SSakthivel K 	u32	reserved[29];
694f5860992SSakthivel K } __attribute__((packed, aligned(4)));
695f5860992SSakthivel K 
696f5860992SSakthivel K /**
697f5860992SSakthivel K  * brief the data structure of SAS Diagnostic Execute Command
698f5860992SSakthivel K  * use to describe MPI SAS Diagnostic Execute Command (64 bytes)
699f5860992SSakthivel K  */
700f5860992SSakthivel K struct sas_diag_execute_req {
701f5860992SSakthivel K 	__le32	tag;
702f5860992SSakthivel K 	__le32	cmdtype_cmddesc_phyid;
703f5860992SSakthivel K 	__le32	pat1_pat2;
704f5860992SSakthivel K 	__le32	threshold;
705f5860992SSakthivel K 	__le32	codepat_errmsk;
706f5860992SSakthivel K 	__le32	pmon;
707f5860992SSakthivel K 	__le32	pERF1CTL;
708f5860992SSakthivel K 	u32	reserved[24];
709f5860992SSakthivel K } __attribute__((packed, aligned(4)));
710f5860992SSakthivel K 
711f5860992SSakthivel K #define SAS_DIAG_PARAM_BYTES 24
712f5860992SSakthivel K 
713f5860992SSakthivel K /*
714f5860992SSakthivel K  * brief the data structure of Set Device State Command
715f5860992SSakthivel K  * use to describe MPI Set Device State Command (64 bytes)
716f5860992SSakthivel K  */
717f5860992SSakthivel K struct set_dev_state_req {
718f5860992SSakthivel K 	__le32	tag;
719f5860992SSakthivel K 	__le32	device_id;
720f5860992SSakthivel K 	__le32	nds;
721f5860992SSakthivel K 	u32	reserved[28];
722f5860992SSakthivel K } __attribute__((packed, aligned(4)));
723f5860992SSakthivel K 
724f5860992SSakthivel K /*
725f5860992SSakthivel K  * brief the data structure of SATA Start Command
726f5860992SSakthivel K  * use to describe MPI SATA IO Start Command (64 bytes)
727f5860992SSakthivel K  * Note: This structure is common for normal / encryption I/O
728f5860992SSakthivel K  */
729f5860992SSakthivel K 
730f5860992SSakthivel K struct sata_start_req {
731f5860992SSakthivel K 	__le32	tag;
732f5860992SSakthivel K 	__le32	device_id;
733f5860992SSakthivel K 	__le32	data_len;
734*54543295SIgor Pylypiv 	__le32	retfis_ncqtag_atap_dir_m_dad;
735f5860992SSakthivel K 	struct host_to_dev_fis	sata_fis;
736f5860992SSakthivel K 	u32	reserved1;
737f5860992SSakthivel K 	u32	reserved2;	/* dword 11. rsvd for normal I/O. */
738f5860992SSakthivel K 				/* EPLE Descl for enc I/O */
739f5860992SSakthivel K 	u32	addr_low;	/* dword 12. rsvd for enc I/O */
740f5860992SSakthivel K 	u32	addr_high;	/* dword 13. reserved for enc I/O */
741f5860992SSakthivel K 	__le32	len;		/* dword 14: length for normal I/O. */
742f5860992SSakthivel K 				/* EPLE Desch for enc I/O */
743f5860992SSakthivel K 	__le32	esgl;		/* dword 15. rsvd for enc I/O */
744f5860992SSakthivel K 	__le32	atapi_scsi_cdb[4];	/* dword 16-19. rsvd for enc I/O */
745f5860992SSakthivel K 	/* The below fields are reserved for normal I/O */
746f5860992SSakthivel K 	__le32	key_index_mode;	/* dword 20 */
747f5860992SSakthivel K 	__le32	sector_cnt_enss;/* dword 21 */
748f5860992SSakthivel K 	__le32	keytagl;	/* dword 22 */
749f5860992SSakthivel K 	__le32	keytagh;	/* dword 23 */
750f5860992SSakthivel K 	__le32	twk_val0;	/* dword 24 */
751f5860992SSakthivel K 	__le32	twk_val1;	/* dword 25 */
752f5860992SSakthivel K 	__le32	twk_val2;	/* dword 26 */
753f5860992SSakthivel K 	__le32	twk_val3;	/* dword 27 */
754f5860992SSakthivel K 	__le32	enc_addr_low;	/* dword 28. Encryption SGL address high */
755f5860992SSakthivel K 	__le32	enc_addr_high;	/* dword 29. Encryption SGL address low */
756f5860992SSakthivel K 	__le32	enc_len;	/* dword 30. Encryption length */
757f5860992SSakthivel K 	__le32	enc_esgl;	/* dword 31. Encryption esgl bit */
758f5860992SSakthivel K } __attribute__((packed, aligned(4)));
759f5860992SSakthivel K 
760f5860992SSakthivel K /**
761f5860992SSakthivel K  * brief the data structure of SSP INI TM Start Command
762f5860992SSakthivel K  * use to describe MPI SSP INI TM Start Command (64 bytes)
763f5860992SSakthivel K  */
764f5860992SSakthivel K struct ssp_ini_tm_start_req {
765f5860992SSakthivel K 	__le32	tag;
766f5860992SSakthivel K 	__le32	device_id;
767f5860992SSakthivel K 	__le32	relate_tag;
768f5860992SSakthivel K 	__le32	tmf;
769f5860992SSakthivel K 	u8	lun[8];
770f5860992SSakthivel K 	__le32	ds_ads_m;
771f5860992SSakthivel K 	u32	reserved[24];
772f5860992SSakthivel K } __attribute__((packed, aligned(4)));
773f5860992SSakthivel K 
774f5860992SSakthivel K struct ssp_info_unit {
775f5860992SSakthivel K 	u8	lun[8];/* SCSI Logical Unit Number */
776f5860992SSakthivel K 	u8	reserved1;/* reserved */
777f5860992SSakthivel K 	u8	efb_prio_attr;
778f5860992SSakthivel K 	/* B7 : enabledFirstBurst */
779f5860992SSakthivel K 	/* B6-3 : taskPriority */
780f5860992SSakthivel K 	/* B2-0 : taskAttribute */
781f5860992SSakthivel K 	u8	reserved2;	/* reserved */
782f5860992SSakthivel K 	u8	additional_cdb_len;
783f5860992SSakthivel K 	/* B7-2 : additional_cdb_len */
784f5860992SSakthivel K 	/* B1-0 : reserved */
785f5860992SSakthivel K 	u8	cdb[16];/* The SCSI CDB up to 16 bytes length */
786f5860992SSakthivel K } __attribute__((packed, aligned(4)));
787f5860992SSakthivel K 
788f5860992SSakthivel K /**
789f5860992SSakthivel K  * brief the data structure of SSP INI IO Start Command
790f5860992SSakthivel K  * use to describe MPI SSP INI IO Start Command (64 bytes)
791f5860992SSakthivel K  * Note: This structure is common for normal / encryption I/O
792f5860992SSakthivel K  */
793f5860992SSakthivel K struct ssp_ini_io_start_req {
794f5860992SSakthivel K 	__le32	tag;
795f5860992SSakthivel K 	__le32	device_id;
796f5860992SSakthivel K 	__le32	data_len;
797f5860992SSakthivel K 	__le32	dad_dir_m_tlr;
798f5860992SSakthivel K 	struct ssp_info_unit	ssp_iu;
799f5860992SSakthivel K 	__le32	addr_low;	/* dword 12: sgl low for normal I/O. */
800f5860992SSakthivel K 				/* epl_descl for encryption I/O */
801f5860992SSakthivel K 	__le32	addr_high;	/* dword 13: sgl hi for normal I/O */
802f5860992SSakthivel K 				/* dpl_descl for encryption I/O */
803f5860992SSakthivel K 	__le32	len;		/* dword 14: len for normal I/O. */
804f5860992SSakthivel K 				/* edpl_desch for encryption I/O */
805f5860992SSakthivel K 	__le32	esgl;		/* dword 15: ESGL bit for normal I/O. */
806f5860992SSakthivel K 				/* user defined tag mask for enc I/O */
807f5860992SSakthivel K 	/* The below fields are reserved for normal I/O */
808f5860992SSakthivel K 	u8	udt[12];	/* dword 16-18 */
809f5860992SSakthivel K 	__le32	sectcnt_ios;	/* dword 19 */
810f5860992SSakthivel K 	__le32	key_cmode;	/* dword 20 */
811f5860992SSakthivel K 	__le32	ks_enss;	/* dword 21 */
812f5860992SSakthivel K 	__le32	keytagl;	/* dword 22 */
813f5860992SSakthivel K 	__le32	keytagh;	/* dword 23 */
814f5860992SSakthivel K 	__le32	twk_val0;	/* dword 24 */
815f5860992SSakthivel K 	__le32	twk_val1;	/* dword 25 */
816f5860992SSakthivel K 	__le32	twk_val2;	/* dword 26 */
817f5860992SSakthivel K 	__le32	twk_val3;	/* dword 27 */
818f5860992SSakthivel K 	__le32	enc_addr_low;	/* dword 28: Encryption sgl addr low */
819f5860992SSakthivel K 	__le32	enc_addr_high;	/* dword 29: Encryption sgl addr hi */
820f5860992SSakthivel K 	__le32	enc_len;	/* dword 30: Encryption length */
821f5860992SSakthivel K 	__le32	enc_esgl;	/* dword 31: ESGL bit for encryption */
822f5860992SSakthivel K } __attribute__((packed, aligned(4)));
823f5860992SSakthivel K 
824f5860992SSakthivel K /**
825f5860992SSakthivel K  * brief the data structure for SSP_INI_DIF_ENC_IO COMMAND
826f5860992SSakthivel K  * use to initiate SSP I/O operation with optional DIF/ENC
827f5860992SSakthivel K  */
828f5860992SSakthivel K struct ssp_dif_enc_io_req {
829f5860992SSakthivel K 	__le32	tag;
830f5860992SSakthivel K 	__le32	device_id;
831f5860992SSakthivel K 	__le32	data_len;
832f5860992SSakthivel K 	__le32	dirMTlr;
833f5860992SSakthivel K 	__le32	sspiu0;
834f5860992SSakthivel K 	__le32	sspiu1;
835f5860992SSakthivel K 	__le32	sspiu2;
836f5860992SSakthivel K 	__le32	sspiu3;
837f5860992SSakthivel K 	__le32	sspiu4;
838f5860992SSakthivel K 	__le32	sspiu5;
839f5860992SSakthivel K 	__le32	sspiu6;
840f5860992SSakthivel K 	__le32	epl_des;
841f5860992SSakthivel K 	__le32	dpl_desl_ndplr;
842f5860992SSakthivel K 	__le32	dpl_desh;
843f5860992SSakthivel K 	__le32	uum_uuv_bss_difbits;
844f5860992SSakthivel K 	u8	udt[12];
845f5860992SSakthivel K 	__le32	sectcnt_ios;
846f5860992SSakthivel K 	__le32	key_cmode;
847f5860992SSakthivel K 	__le32	ks_enss;
848f5860992SSakthivel K 	__le32	keytagl;
849f5860992SSakthivel K 	__le32	keytagh;
850f5860992SSakthivel K 	__le32	twk_val0;
851f5860992SSakthivel K 	__le32	twk_val1;
852f5860992SSakthivel K 	__le32	twk_val2;
853f5860992SSakthivel K 	__le32	twk_val3;
854f5860992SSakthivel K 	__le32	addr_low;
855f5860992SSakthivel K 	__le32	addr_high;
856f5860992SSakthivel K 	__le32	len;
857f5860992SSakthivel K 	__le32	esgl;
858f5860992SSakthivel K } __attribute__((packed, aligned(4)));
859f5860992SSakthivel K 
860f5860992SSakthivel K /**
861f5860992SSakthivel K  * brief the data structure of Firmware download
862f5860992SSakthivel K  * use to describe MPI FW DOWNLOAD Command (64 bytes)
863f5860992SSakthivel K  */
864f5860992SSakthivel K struct fw_flash_Update_req {
865f5860992SSakthivel K 	__le32	tag;
866f5860992SSakthivel K 	__le32	cur_image_offset;
867f5860992SSakthivel K 	__le32	cur_image_len;
868f5860992SSakthivel K 	__le32	total_image_len;
869f5860992SSakthivel K 	u32	reserved0[7];
870f5860992SSakthivel K 	__le32	sgl_addr_lo;
871f5860992SSakthivel K 	__le32	sgl_addr_hi;
872f5860992SSakthivel K 	__le32	len;
873f5860992SSakthivel K 	__le32	ext_reserved;
874f5860992SSakthivel K 	u32	reserved1[16];
875f5860992SSakthivel K } __attribute__((packed, aligned(4)));
876f5860992SSakthivel K 
877f5860992SSakthivel K #define FWFLASH_IOMB_RESERVED_LEN 0x07
878f5860992SSakthivel K /**
879f5860992SSakthivel K  * brief the data structure of FW_FLASH_UPDATE Response
880f5860992SSakthivel K  * use to describe MPI FW_FLASH_UPDATE Response (64 bytes)
881f5860992SSakthivel K  *
882f5860992SSakthivel K  */
883f5860992SSakthivel K  struct fw_flash_Update_resp {
884f5860992SSakthivel K 	__le32	tag;
885f5860992SSakthivel K 	__le32	status;
886f5860992SSakthivel K 	u32	reserved[13];
887f5860992SSakthivel K } __attribute__((packed, aligned(4)));
888f5860992SSakthivel K 
889f5860992SSakthivel K /**
890f5860992SSakthivel K  * brief the data structure of Get NVM Data Command
891f5860992SSakthivel K  * use to get data from NVM in HBA(64 bytes)
892f5860992SSakthivel K  */
893f5860992SSakthivel K struct get_nvm_data_req {
894f5860992SSakthivel K 	__le32	tag;
895f5860992SSakthivel K 	__le32	len_ir_vpdd;
896f5860992SSakthivel K 	__le32	vpd_offset;
897f5860992SSakthivel K 	u32	reserved[8];
898f5860992SSakthivel K 	__le32	resp_addr_lo;
899f5860992SSakthivel K 	__le32	resp_addr_hi;
900f5860992SSakthivel K 	__le32	resp_len;
901f5860992SSakthivel K 	u32	reserved1[17];
902f5860992SSakthivel K } __attribute__((packed, aligned(4)));
903f5860992SSakthivel K 
904f5860992SSakthivel K struct set_nvm_data_req {
905f5860992SSakthivel K 	__le32	tag;
906f5860992SSakthivel K 	__le32	len_ir_vpdd;
907f5860992SSakthivel K 	__le32	vpd_offset;
908f5860992SSakthivel K 	u32	reserved[8];
909f5860992SSakthivel K 	__le32	resp_addr_lo;
910f5860992SSakthivel K 	__le32	resp_addr_hi;
911f5860992SSakthivel K 	__le32	resp_len;
912f5860992SSakthivel K 	u32	reserved1[17];
913f5860992SSakthivel K } __attribute__((packed, aligned(4)));
914f5860992SSakthivel K 
915f5860992SSakthivel K /**
916f5860992SSakthivel K  * brief the data structure for SET CONTROLLER CONFIG COMMAND
917f5860992SSakthivel K  * use to modify controller configuration
918f5860992SSakthivel K  */
919f5860992SSakthivel K struct set_ctrl_cfg_req {
920f5860992SSakthivel K 	__le32	tag;
921f5860992SSakthivel K 	__le32	cfg_pg[14];
922f5860992SSakthivel K 	u32	reserved[16];
923f5860992SSakthivel K } __attribute__((packed, aligned(4)));
924f5860992SSakthivel K 
925f5860992SSakthivel K /**
926f5860992SSakthivel K  * brief the data structure for GET CONTROLLER CONFIG COMMAND
927f5860992SSakthivel K  * use to get controller configuration page
928f5860992SSakthivel K  */
929f5860992SSakthivel K struct get_ctrl_cfg_req {
930f5860992SSakthivel K 	__le32	tag;
931f5860992SSakthivel K 	__le32	pgcd;
932f5860992SSakthivel K 	__le32	int_vec;
933f5860992SSakthivel K 	u32	reserved[28];
934f5860992SSakthivel K } __attribute__((packed, aligned(4)));
935f5860992SSakthivel K 
936f5860992SSakthivel K /**
937f5860992SSakthivel K  * brief the data structure for KEK_MANAGEMENT COMMAND
938f5860992SSakthivel K  * use for KEK management
939f5860992SSakthivel K  */
940f5860992SSakthivel K struct kek_mgmt_req {
941f5860992SSakthivel K 	__le32	tag;
942f5860992SSakthivel K 	__le32	new_curidx_ksop;
943f5860992SSakthivel K 	u32	reserved;
944f5860992SSakthivel K 	__le32	kblob[12];
945f5860992SSakthivel K 	u32	reserved1[16];
946f5860992SSakthivel K } __attribute__((packed, aligned(4)));
947f5860992SSakthivel K 
948f5860992SSakthivel K /**
949f5860992SSakthivel K  * brief the data structure for DEK_MANAGEMENT COMMAND
950f5860992SSakthivel K  * use for DEK management
951f5860992SSakthivel K  */
952f5860992SSakthivel K struct dek_mgmt_req {
953f5860992SSakthivel K 	__le32	tag;
954f5860992SSakthivel K 	__le32	kidx_dsop;
955f5860992SSakthivel K 	__le32	dekidx;
956f5860992SSakthivel K 	__le32	addr_l;
957f5860992SSakthivel K 	__le32	addr_h;
958f5860992SSakthivel K 	__le32	nent;
959f5860992SSakthivel K 	__le32	dbf_tblsize;
960f5860992SSakthivel K 	u32	reserved[24];
961f5860992SSakthivel K } __attribute__((packed, aligned(4)));
962f5860992SSakthivel K 
963f5860992SSakthivel K /**
964f5860992SSakthivel K  * brief the data structure for SET PHY PROFILE COMMAND
965f5860992SSakthivel K  * use to retrive phy specific information
966f5860992SSakthivel K  */
967f5860992SSakthivel K struct set_phy_profile_req {
968f5860992SSakthivel K 	__le32	tag;
969f5860992SSakthivel K 	__le32	ppc_phyid;
970e5039a92SDamien Le Moal 	__le32	reserved[29];
971f5860992SSakthivel K } __attribute__((packed, aligned(4)));
972f5860992SSakthivel K 
973f5860992SSakthivel K /**
974f5860992SSakthivel K  * brief the data structure for GET PHY PROFILE COMMAND
975f5860992SSakthivel K  * use to retrive phy specific information
976f5860992SSakthivel K  */
977f5860992SSakthivel K struct get_phy_profile_req {
978f5860992SSakthivel K 	__le32	tag;
979f5860992SSakthivel K 	__le32	ppc_phyid;
980f5860992SSakthivel K 	__le32	profile[29];
981f5860992SSakthivel K } __attribute__((packed, aligned(4)));
982f5860992SSakthivel K 
983f5860992SSakthivel K /**
984f5860992SSakthivel K  * brief the data structure for EXT FLASH PARTITION
985f5860992SSakthivel K  * use to manage ext flash partition
986f5860992SSakthivel K  */
987f5860992SSakthivel K struct ext_flash_partition_req {
988f5860992SSakthivel K 	__le32	tag;
989f5860992SSakthivel K 	__le32	cmd;
990f5860992SSakthivel K 	__le32	offset;
991f5860992SSakthivel K 	__le32	len;
992f5860992SSakthivel K 	u32	reserved[7];
993f5860992SSakthivel K 	__le32	addr_low;
994f5860992SSakthivel K 	__le32	addr_high;
995f5860992SSakthivel K 	__le32	len1;
996f5860992SSakthivel K 	__le32	ext;
997f5860992SSakthivel K 	u32	reserved1[16];
998f5860992SSakthivel K } __attribute__((packed, aligned(4)));
999f5860992SSakthivel K 
1000f5860992SSakthivel K #define TWI_DEVICE	0x0
1001f5860992SSakthivel K #define C_SEEPROM	0x1
1002f5860992SSakthivel K #define VPD_FLASH	0x4
1003f5860992SSakthivel K #define AAP1_RDUMP	0x5
1004f5860992SSakthivel K #define IOP_RDUMP	0x6
1005f5860992SSakthivel K #define EXPAN_ROM	0x7
1006f5860992SSakthivel K 
1007f5860992SSakthivel K #define IPMode		0x80000000
1008f5860992SSakthivel K #define NVMD_TYPE	0x0000000F
1009f5860992SSakthivel K #define NVMD_STAT	0x0000FFFF
1010f5860992SSakthivel K #define NVMD_LEN	0xFF000000
1011f5860992SSakthivel K /**
1012f5860992SSakthivel K  * brief the data structure of Get NVMD Data Response
1013f5860992SSakthivel K  * use to describe MPI Get NVMD Data Response (64 bytes)
1014f5860992SSakthivel K  */
1015f5860992SSakthivel K struct get_nvm_data_resp {
1016f5860992SSakthivel K 	__le32		tag;
1017f5860992SSakthivel K 	__le32		ir_tda_bn_dps_das_nvm;
1018f5860992SSakthivel K 	__le32		dlen_status;
1019f5860992SSakthivel K 	__le32		nvm_data[12];
1020f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1021f5860992SSakthivel K 
1022f5860992SSakthivel K /**
1023f5860992SSakthivel K  * brief the data structure of SAS Diagnostic Start/End Response
1024f5860992SSakthivel K  * use to describe MPI SAS Diagnostic Start/End Response (64 bytes)
1025f5860992SSakthivel K  *
1026f5860992SSakthivel K  */
1027f5860992SSakthivel K struct sas_diag_start_end_resp {
1028f5860992SSakthivel K 	__le32		tag;
1029f5860992SSakthivel K 	__le32		status;
1030f5860992SSakthivel K 	u32		reserved[13];
1031f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1032f5860992SSakthivel K 
1033f5860992SSakthivel K /**
1034f5860992SSakthivel K  * brief the data structure of SAS Diagnostic Execute Response
1035f5860992SSakthivel K  * use to describe MPI SAS Diagnostic Execute Response (64 bytes)
1036f5860992SSakthivel K  *
1037f5860992SSakthivel K  */
1038f5860992SSakthivel K struct sas_diag_execute_resp {
1039f5860992SSakthivel K 	__le32		tag;
1040f5860992SSakthivel K 	__le32		cmdtype_cmddesc_phyid;
1041f5860992SSakthivel K 	__le32		Status;
1042f5860992SSakthivel K 	__le32		ReportData;
1043f5860992SSakthivel K 	u32		reserved[11];
1044f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1045f5860992SSakthivel K 
1046f5860992SSakthivel K /**
1047f5860992SSakthivel K  * brief the data structure of Set Device State Response
1048f5860992SSakthivel K  * use to describe MPI Set Device State Response (64 bytes)
1049f5860992SSakthivel K  *
1050f5860992SSakthivel K  */
1051f5860992SSakthivel K struct set_dev_state_resp {
1052f5860992SSakthivel K 	__le32		tag;
1053f5860992SSakthivel K 	__le32		status;
1054f5860992SSakthivel K 	__le32		device_id;
1055f5860992SSakthivel K 	__le32		pds_nds;
1056f5860992SSakthivel K 	u32		reserved[11];
1057f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1058f5860992SSakthivel K 
1059f5860992SSakthivel K /* new outbound structure for spcv - begins */
1060f5860992SSakthivel K /**
1061f5860992SSakthivel K  * brief the data structure for SET CONTROLLER CONFIG COMMAND
1062f5860992SSakthivel K  * use to modify controller configuration
1063f5860992SSakthivel K  */
1064f5860992SSakthivel K struct set_ctrl_cfg_resp {
1065f5860992SSakthivel K 	__le32 tag;
1066f5860992SSakthivel K 	__le32 status;
1067f5860992SSakthivel K 	__le32 err_qlfr_pgcd;
1068f5860992SSakthivel K 	u32 reserved[12];
1069f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1070f5860992SSakthivel K 
1071f5860992SSakthivel K struct get_ctrl_cfg_resp {
1072f5860992SSakthivel K 	__le32 tag;
1073f5860992SSakthivel K 	__le32 status;
1074f5860992SSakthivel K 	__le32 err_qlfr;
1075f5860992SSakthivel K 	__le32 confg_page[12];
1076f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1077f5860992SSakthivel K 
1078f5860992SSakthivel K struct kek_mgmt_resp {
1079f5860992SSakthivel K 	__le32 tag;
1080f5860992SSakthivel K 	__le32 status;
1081f5860992SSakthivel K 	__le32 kidx_new_curr_ksop;
1082f5860992SSakthivel K 	__le32 err_qlfr;
1083f5860992SSakthivel K 	u32 reserved[11];
1084f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1085f5860992SSakthivel K 
1086f5860992SSakthivel K struct dek_mgmt_resp {
1087f5860992SSakthivel K 	__le32 tag;
1088f5860992SSakthivel K 	__le32 status;
1089f5860992SSakthivel K 	__le32 kekidx_tbls_dsop;
1090f5860992SSakthivel K 	__le32 dekidx;
1091f5860992SSakthivel K 	__le32 err_qlfr;
1092f5860992SSakthivel K 	u32 reserved[10];
1093f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1094f5860992SSakthivel K 
1095f5860992SSakthivel K struct get_phy_profile_resp {
1096f5860992SSakthivel K 	__le32 tag;
1097f5860992SSakthivel K 	__le32 status;
1098f5860992SSakthivel K 	__le32 ppc_phyid;
1099f5860992SSakthivel K 	__le32 ppc_specific_rsp[12];
1100f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1101f5860992SSakthivel K 
1102f5860992SSakthivel K struct flash_op_ext_resp {
1103f5860992SSakthivel K 	__le32 tag;
1104f5860992SSakthivel K 	__le32 cmd;
1105f5860992SSakthivel K 	__le32 status;
1106f5860992SSakthivel K 	__le32 epart_size;
1107f5860992SSakthivel K 	__le32 epart_sect_size;
1108f5860992SSakthivel K 	u32 reserved[10];
1109f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1110f5860992SSakthivel K 
1111f5860992SSakthivel K struct set_phy_profile_resp {
1112f5860992SSakthivel K 	__le32 tag;
1113f5860992SSakthivel K 	__le32 status;
1114f5860992SSakthivel K 	__le32 ppc_phyid;
1115f5860992SSakthivel K 	__le32 ppc_specific_rsp[12];
1116f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1117f5860992SSakthivel K 
1118f5860992SSakthivel K struct ssp_coalesced_comp_resp {
1119f5860992SSakthivel K 	__le32 coal_cnt;
1120f5860992SSakthivel K 	__le32 tag0;
1121f5860992SSakthivel K 	__le32 ssp_tag0;
1122f5860992SSakthivel K 	__le32 tag1;
1123f5860992SSakthivel K 	__le32 ssp_tag1;
1124f5860992SSakthivel K 	__le32 add_tag_ssp_tag[10];
1125f5860992SSakthivel K } __attribute__((packed, aligned(4)));
1126f5860992SSakthivel K 
1127f5860992SSakthivel K /* new outbound structure for spcv - ends */
1128f5860992SSakthivel K 
1129a6cb3d01SSakthivel K /* brief data structure for SAS protocol timer configuration page.
1130a6cb3d01SSakthivel K  *
1131a6cb3d01SSakthivel K  */
1132a6cb3d01SSakthivel K struct SASProtocolTimerConfig {
1133a6cb3d01SSakthivel K 	__le32 pageCode;			/* 0 */
1134a6cb3d01SSakthivel K 	__le32 MST_MSI;				/* 1 */
1135a6cb3d01SSakthivel K 	__le32 STP_SSP_MCT_TMO;			/* 2 */
1136a6cb3d01SSakthivel K 	__le32 STP_FRM_TMO;			/* 3 */
1137a6cb3d01SSakthivel K 	__le32 STP_IDLE_TMO;			/* 4 */
1138a6cb3d01SSakthivel K 	__le32 OPNRJT_RTRY_INTVL;		/* 5 */
1139a6cb3d01SSakthivel K 	__le32 Data_Cmd_OPNRJT_RTRY_TMO;	/* 6 */
1140a6cb3d01SSakthivel K 	__le32 Data_Cmd_OPNRJT_RTRY_THR;	/* 7 */
1141a6cb3d01SSakthivel K 	__le32 MAX_AIP;				/* 8 */
1142a6cb3d01SSakthivel K } __attribute__((packed, aligned(4)));
1143a6cb3d01SSakthivel K 
1144a6cb3d01SSakthivel K typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;
1145a6cb3d01SSakthivel K 
1146f5860992SSakthivel K #define NDS_BITS 0x0F
1147f5860992SSakthivel K #define PDS_BITS 0xF0
1148f5860992SSakthivel K 
1149f5860992SSakthivel K /*
1150f5860992SSakthivel K  * HW Events type
1151f5860992SSakthivel K  */
1152f5860992SSakthivel K 
1153f5860992SSakthivel K #define HW_EVENT_RESET_START			0x01
1154f5860992SSakthivel K #define HW_EVENT_CHIP_RESET_COMPLETE		0x02
1155f5860992SSakthivel K #define HW_EVENT_PHY_STOP_STATUS		0x03
1156f5860992SSakthivel K #define HW_EVENT_SAS_PHY_UP			0x04
1157f5860992SSakthivel K #define HW_EVENT_SATA_PHY_UP			0x05
1158f5860992SSakthivel K #define HW_EVENT_SATA_SPINUP_HOLD		0x06
1159f5860992SSakthivel K #define HW_EVENT_PHY_DOWN			0x07
1160f5860992SSakthivel K #define HW_EVENT_PORT_INVALID			0x08
1161f5860992SSakthivel K #define HW_EVENT_BROADCAST_CHANGE		0x09
1162f5860992SSakthivel K #define HW_EVENT_PHY_ERROR			0x0A
1163f5860992SSakthivel K #define HW_EVENT_BROADCAST_SES			0x0B
1164f5860992SSakthivel K #define HW_EVENT_INBOUND_CRC_ERROR		0x0C
1165f5860992SSakthivel K #define HW_EVENT_HARD_RESET_RECEIVED		0x0D
1166f5860992SSakthivel K #define HW_EVENT_MALFUNCTION			0x0E
1167f5860992SSakthivel K #define HW_EVENT_ID_FRAME_TIMEOUT		0x0F
1168f5860992SSakthivel K #define HW_EVENT_BROADCAST_EXP			0x10
1169f5860992SSakthivel K #define HW_EVENT_PHY_START_STATUS		0x11
1170f5860992SSakthivel K #define HW_EVENT_LINK_ERR_INVALID_DWORD		0x12
1171f5860992SSakthivel K #define HW_EVENT_LINK_ERR_DISPARITY_ERROR	0x13
1172f5860992SSakthivel K #define HW_EVENT_LINK_ERR_CODE_VIOLATION	0x14
1173f5860992SSakthivel K #define HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH	0x15
1174f5860992SSakthivel K #define HW_EVENT_LINK_ERR_PHY_RESET_FAILED	0x16
1175f5860992SSakthivel K #define HW_EVENT_PORT_RECOVERY_TIMER_TMO	0x17
1176f5860992SSakthivel K #define HW_EVENT_PORT_RECOVER			0x18
1177f5860992SSakthivel K #define HW_EVENT_PORT_RESET_TIMER_TMO		0x19
1178f5860992SSakthivel K #define HW_EVENT_PORT_RESET_COMPLETE		0x20
1179f5860992SSakthivel K #define EVENT_BROADCAST_ASYNCH_EVENT		0x21
1180f5860992SSakthivel K 
1181f5860992SSakthivel K /* port state */
1182f5860992SSakthivel K #define PORT_NOT_ESTABLISHED			0x00
1183f5860992SSakthivel K #define PORT_VALID				0x01
1184f5860992SSakthivel K #define PORT_LOSTCOMM				0x02
1185f5860992SSakthivel K #define PORT_IN_RESET				0x04
1186f5860992SSakthivel K #define PORT_3RD_PARTY_RESET			0x07
1187f5860992SSakthivel K #define PORT_INVALID				0x08
1188f5860992SSakthivel K 
1189f5860992SSakthivel K /*
1190f5860992SSakthivel K  * SSP/SMP/SATA IO Completion Status values
1191f5860992SSakthivel K  */
1192f5860992SSakthivel K 
1193f5860992SSakthivel K #define IO_SUCCESS				0x00
1194f5860992SSakthivel K #define IO_ABORTED				0x01
1195f5860992SSakthivel K #define IO_OVERFLOW				0x02
1196f5860992SSakthivel K #define IO_UNDERFLOW				0x03
1197f5860992SSakthivel K #define IO_FAILED				0x04
1198f5860992SSakthivel K #define IO_ABORT_RESET				0x05
1199f5860992SSakthivel K #define IO_NOT_VALID				0x06
1200f5860992SSakthivel K #define IO_NO_DEVICE				0x07
1201f5860992SSakthivel K #define IO_ILLEGAL_PARAMETER			0x08
1202f5860992SSakthivel K #define IO_LINK_FAILURE				0x09
1203f5860992SSakthivel K #define IO_PROG_ERROR				0x0A
1204f5860992SSakthivel K 
1205f5860992SSakthivel K #define IO_EDC_IN_ERROR				0x0B
1206f5860992SSakthivel K #define IO_EDC_OUT_ERROR			0x0C
1207f5860992SSakthivel K #define IO_ERROR_HW_TIMEOUT			0x0D
1208f5860992SSakthivel K #define IO_XFER_ERROR_BREAK			0x0E
1209f5860992SSakthivel K #define IO_XFER_ERROR_PHY_NOT_READY		0x0F
1210f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED	0x10
1211f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_ZONE_VIOLATION		0x11
1212f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_BREAK				0x12
1213f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS			0x13
1214f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_BAD_DESTINATION		0x14
1215f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED	0x15
1216f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY		0x16
1217f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_WRONG_DESTINATION		0x17
1218f5860992SSakthivel K /* This error code 0x18 is not used on SPCv */
1219f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_UNKNOWN_ERROR			0x18
1220f5860992SSakthivel K #define IO_XFER_ERROR_NAK_RECEIVED			0x19
1221f5860992SSakthivel K #define IO_XFER_ERROR_ACK_NAK_TIMEOUT			0x1A
1222f5860992SSakthivel K #define IO_XFER_ERROR_PEER_ABORTED			0x1B
1223f5860992SSakthivel K #define IO_XFER_ERROR_RX_FRAME				0x1C
1224f5860992SSakthivel K #define IO_XFER_ERROR_DMA				0x1D
1225f5860992SSakthivel K #define IO_XFER_ERROR_CREDIT_TIMEOUT			0x1E
1226f5860992SSakthivel K #define IO_XFER_ERROR_SATA_LINK_TIMEOUT			0x1F
1227f5860992SSakthivel K #define IO_XFER_ERROR_SATA				0x20
1228f5860992SSakthivel K 
1229f5860992SSakthivel K /* This error code 0x22 is not used on SPCv */
1230f5860992SSakthivel K #define IO_XFER_ERROR_ABORTED_DUE_TO_SRST		0x22
1231f5860992SSakthivel K #define IO_XFER_ERROR_REJECTED_NCQ_MODE			0x21
1232f5860992SSakthivel K #define IO_XFER_ERROR_ABORTED_NCQ_MODE			0x23
1233f5860992SSakthivel K #define IO_XFER_OPEN_RETRY_TIMEOUT			0x24
1234f5860992SSakthivel K /* This error code 0x25 is not used on SPCv */
1235f5860992SSakthivel K #define IO_XFER_SMP_RESP_CONNECTION_ERROR		0x25
1236f5860992SSakthivel K #define IO_XFER_ERROR_UNEXPECTED_PHASE			0x26
1237f5860992SSakthivel K #define IO_XFER_ERROR_XFER_RDY_OVERRUN			0x27
1238f5860992SSakthivel K #define IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED		0x28
1239f5860992SSakthivel K #define IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT		0x30
1240f5860992SSakthivel K 
1241f5860992SSakthivel K /* The following error code 0x31 and 0x32 are not using (obsolete) */
1242f5860992SSakthivel K #define IO_XFER_ERROR_CMD_ISSUE_BREAK_BEFORE_ACK_NAK	0x31
1243f5860992SSakthivel K #define IO_XFER_ERROR_CMD_ISSUE_PHY_DOWN_BEFORE_ACK_NAK	0x32
1244f5860992SSakthivel K 
1245f5860992SSakthivel K #define IO_XFER_ERROR_OFFSET_MISMATCH			0x34
1246f5860992SSakthivel K #define IO_XFER_ERROR_XFER_ZERO_DATA_LEN		0x35
1247f5860992SSakthivel K #define IO_XFER_CMD_FRAME_ISSUED			0x36
1248f5860992SSakthivel K #define IO_ERROR_INTERNAL_SMP_RESOURCE			0x37
1249f5860992SSakthivel K #define IO_PORT_IN_RESET				0x38
1250f5860992SSakthivel K #define IO_DS_NON_OPERATIONAL				0x39
1251f5860992SSakthivel K #define IO_DS_IN_RECOVERY				0x3A
1252f5860992SSakthivel K #define IO_TM_TAG_NOT_FOUND				0x3B
1253f5860992SSakthivel K #define IO_XFER_PIO_SETUP_ERROR				0x3C
1254f5860992SSakthivel K #define IO_SSP_EXT_IU_ZERO_LEN_ERROR			0x3D
1255f5860992SSakthivel K #define IO_DS_IN_ERROR					0x3E
1256f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY		0x3F
1257f5860992SSakthivel K #define IO_ABORT_IN_PROGRESS				0x40
1258f5860992SSakthivel K #define IO_ABORT_DELAYED				0x41
1259f5860992SSakthivel K #define IO_INVALID_LENGTH				0x42
1260f5860992SSakthivel K 
1261f5860992SSakthivel K /********** additional response event values *****************/
1262f5860992SSakthivel K 
1263f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT		0x43
1264f5860992SSakthivel K #define IO_XFER_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED	0x44
1265f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO	0x45
1266f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST		0x46
1267f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE	0x47
1268f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED	0x48
1269f5860992SSakthivel K #define IO_DS_INVALID					0x49
12704f5deeb4SRuksar Devadi #define IO_FATAL_ERROR					0x51
1271f5860992SSakthivel K /* WARNING: the value is not contiguous from here */
1272f5860992SSakthivel K #define IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR	0x52
1273a6cb3d01SSakthivel K #define IO_XFER_DMA_ACTIVATE_TIMEOUT		0x53
1274a6cb3d01SSakthivel K #define IO_XFER_ERROR_INTERNAL_CRC_ERROR	0x54
1275f5860992SSakthivel K #define MPI_IO_RQE_BUSY_FULL			0x55
1276f5860992SSakthivel K #define IO_XFER_ERR_EOB_DATA_OVERRUN		0x56
127727ecfa5eSViswas G #define IO_XFER_ERROR_INVALID_SSP_RSP_FRAME	0x57
1278f5860992SSakthivel K #define IO_OPEN_CNX_ERROR_OPEN_PREEMPTED	0x58
1279f5860992SSakthivel K 
1280f5860992SSakthivel K #define MPI_ERR_IO_RESOURCE_UNAVAILABLE		0x1004
1281f5860992SSakthivel K #define MPI_ERR_ATAPI_DEVICE_BUSY		0x1024
1282f5860992SSakthivel K 
1283f5860992SSakthivel K #define IO_XFR_ERROR_DEK_KEY_CACHE_MISS		0x2040
1284f5860992SSakthivel K /*
1285f5860992SSakthivel K  * An encryption IO request failed due to DEK Key Tag mismatch.
1286f5860992SSakthivel K  * The key tag supplied in the encryption IOMB does not match with
1287f5860992SSakthivel K  * the Key Tag in the referenced DEK Entry.
1288f5860992SSakthivel K  */
1289f5860992SSakthivel K #define IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH	0x2041
1290f5860992SSakthivel K #define IO_XFR_ERROR_CIPHER_MODE_INVALID	0x2042
1291f5860992SSakthivel K /*
1292f5860992SSakthivel K  * An encryption I/O request failed because the initial value (IV)
1293f5860992SSakthivel K  * in the unwrapped DEK blob didn't match the IV used to unwrap it.
1294f5860992SSakthivel K  */
1295f5860992SSakthivel K #define IO_XFR_ERROR_DEK_IV_MISMATCH		0x2043
1296f5860992SSakthivel K /* An encryption I/O request failed due to an internal RAM ECC or
1297f5860992SSakthivel K  * interface error while unwrapping the DEK. */
1298f5860992SSakthivel K #define IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR	0x2044
1299f5860992SSakthivel K /* An encryption I/O request failed due to an internal RAM ECC or
1300f5860992SSakthivel K  * interface error while unwrapping the DEK. */
1301f5860992SSakthivel K #define IO_XFR_ERROR_INTERNAL_RAM		0x2045
1302f5860992SSakthivel K /*
1303f5860992SSakthivel K  * An encryption I/O request failed
1304f5860992SSakthivel K  * because the DEK index specified in the I/O was outside the bounds of
1305f5860992SSakthivel K  * the total number of entries in the host DEK table.
1306f5860992SSakthivel K  */
1307f5860992SSakthivel K #define IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS0x2046
1308f5860992SSakthivel K 
1309f5860992SSakthivel K /* define DIF IO response error status code */
1310f5860992SSakthivel K #define IO_XFR_ERROR_DIF_MISMATCH			0x3000
1311f5860992SSakthivel K #define IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH	0x3001
1312f5860992SSakthivel K #define IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH		0x3002
1313f5860992SSakthivel K #define IO_XFR_ERROR_DIF_CRC_MISMATCH			0x3003
1314f5860992SSakthivel K 
1315f5860992SSakthivel K /* define operator management response status and error qualifier code */
1316f5860992SSakthivel K #define OPR_MGMT_OP_NOT_SUPPORTED			0x2060
1317f5860992SSakthivel K #define OPR_MGMT_MPI_ENC_ERR_OPR_PARAM_ILLEGAL		0x2061
1318f5860992SSakthivel K #define OPR_MGMT_MPI_ENC_ERR_OPR_ID_NOT_FOUND		0x2062
1319f5860992SSakthivel K #define OPR_MGMT_MPI_ENC_ERR_OPR_ROLE_NOT_MATCH		0x2063
1320f5860992SSakthivel K #define OPR_MGMT_MPI_ENC_ERR_OPR_MAX_NUM_EXCEEDED	0x2064
1321f5860992SSakthivel K #define OPR_MGMT_MPI_ENC_ERR_KEK_UNWRAP_FAIL		0x2022
1322f5860992SSakthivel K #define OPR_MGMT_MPI_ENC_ERR_NVRAM_OPERATION_FAILURE	0x2023
1323f5860992SSakthivel K /***************** additional response event values ***************/
1324f5860992SSakthivel K 
1325f5860992SSakthivel K /* WARNING: This error code must always be the last number.
1326f5860992SSakthivel K  * If you add error code, modify this code also
1327f5860992SSakthivel K  * It is used as an index
1328f5860992SSakthivel K  */
1329f5860992SSakthivel K #define IO_ERROR_UNKNOWN_GENERIC			0x2023
1330f5860992SSakthivel K 
1331f5860992SSakthivel K /* MSGU CONFIGURATION TABLE*/
1332f5860992SSakthivel K 
1333a9a923e5SAnand Kumar Santhanam #define SPCv_MSGU_CFG_TABLE_UPDATE		0x001
1334a9a923e5SAnand Kumar Santhanam #define SPCv_MSGU_CFG_TABLE_RESET		0x002
1335a9a923e5SAnand Kumar Santhanam #define SPCv_MSGU_CFG_TABLE_FREEZE		0x004
1336a9a923e5SAnand Kumar Santhanam #define SPCv_MSGU_CFG_TABLE_UNFREEZE		0x008
1337f5860992SSakthivel K #define MSGU_IBDB_SET				0x00
1338f5860992SSakthivel K #define MSGU_HOST_INT_STATUS			0x08
1339f5860992SSakthivel K #define MSGU_HOST_INT_MASK			0x0C
1340f5860992SSakthivel K #define MSGU_IOPIB_INT_STATUS			0x18
1341f5860992SSakthivel K #define MSGU_IOPIB_INT_MASK			0x1C
1342f5860992SSakthivel K #define MSGU_IBDB_CLEAR				0x20
1343f5860992SSakthivel K 
1344f5860992SSakthivel K #define MSGU_MSGU_CONTROL			0x24
1345f5860992SSakthivel K #define MSGU_ODR				0x20
1346f5860992SSakthivel K #define MSGU_ODCR				0x28
1347f5860992SSakthivel K 
1348f5860992SSakthivel K #define MSGU_ODMR				0x30
1349f5860992SSakthivel K #define MSGU_ODMR_U				0x34
1350f5860992SSakthivel K #define MSGU_ODMR_CLR				0x38
1351f5860992SSakthivel K #define MSGU_ODMR_CLR_U				0x3C
1352f5860992SSakthivel K #define MSGU_OD_RSVD				0x40
1353f5860992SSakthivel K 
1354f5860992SSakthivel K #define MSGU_SCRATCH_PAD_0			0x44
1355f5860992SSakthivel K #define MSGU_SCRATCH_PAD_1			0x48
1356f5860992SSakthivel K #define MSGU_SCRATCH_PAD_2			0x4C
1357f5860992SSakthivel K #define MSGU_SCRATCH_PAD_3			0x50
1358f5860992SSakthivel K #define MSGU_HOST_SCRATCH_PAD_0			0x54
1359f5860992SSakthivel K #define MSGU_HOST_SCRATCH_PAD_1			0x58
1360f5860992SSakthivel K #define MSGU_HOST_SCRATCH_PAD_2			0x5C
1361f5860992SSakthivel K #define MSGU_HOST_SCRATCH_PAD_3			0x60
1362f5860992SSakthivel K #define MSGU_HOST_SCRATCH_PAD_4			0x64
1363f5860992SSakthivel K #define MSGU_HOST_SCRATCH_PAD_5			0x68
136480cac47bSAjish Koshy #define MSGU_SCRATCH_PAD_RSVD_0			0x6C
136580cac47bSAjish Koshy #define MSGU_SCRATCH_PAD_RSVD_1			0x70
1366f5860992SSakthivel K 
1367a961ea0aSakshatzen #define MSGU_SCRATCHPAD1_RAAE_STATE_ERR(x) ((x & 0x3) == 0x2)
1368a961ea0aSakshatzen #define MSGU_SCRATCHPAD1_ILA_STATE_ERR(x) (((x >> 2) & 0x3) == 0x2)
1369a961ea0aSakshatzen #define MSGU_SCRATCHPAD1_BOOTLDR_STATE_ERR(x) ((((x >> 4) & 0x7) == 0x7) || \
1370a961ea0aSakshatzen 						(((x >> 4) & 0x7) == 0x4))
1371a961ea0aSakshatzen #define MSGU_SCRATCHPAD1_IOP0_STATE_ERR(x) (((x >> 10) & 0x3) == 0x2)
1372a961ea0aSakshatzen #define MSGU_SCRATCHPAD1_IOP1_STATE_ERR(x) (((x >> 12) & 0x3) == 0x2)
1373a961ea0aSakshatzen #define MSGU_SCRATCHPAD1_STATE_FATAL_ERROR(x)  \
1374a961ea0aSakshatzen 			(MSGU_SCRATCHPAD1_RAAE_STATE_ERR(x) ||      \
1375a961ea0aSakshatzen 			 MSGU_SCRATCHPAD1_ILA_STATE_ERR(x) ||       \
1376a961ea0aSakshatzen 			 MSGU_SCRATCHPAD1_BOOTLDR_STATE_ERR(x) ||   \
1377a961ea0aSakshatzen 			 MSGU_SCRATCHPAD1_IOP0_STATE_ERR(x) ||      \
1378a961ea0aSakshatzen 			 MSGU_SCRATCHPAD1_IOP1_STATE_ERR(x))
1379a961ea0aSakshatzen 
1380f5860992SSakthivel K /* bit definition for ODMR register */
1381f5860992SSakthivel K #define ODMR_MASK_ALL			0xFFFFFFFF/* mask all
1382f5860992SSakthivel K 					interrupt vector */
1383f5860992SSakthivel K #define ODMR_CLEAR_ALL			0	/* clear all
1384f5860992SSakthivel K 					interrupt vector */
1385f5860992SSakthivel K /* bit definition for ODCR register */
1386f5860992SSakthivel K #define ODCR_CLEAR_ALL			0xFFFFFFFF /* mask all
1387f5860992SSakthivel K 					interrupt vector*/
1388f5860992SSakthivel K /* MSIX Interupts */
1389f5860992SSakthivel K #define MSIX_TABLE_OFFSET		0x2000
1390f5860992SSakthivel K #define MSIX_TABLE_ELEMENT_SIZE		0x10
1391f5860992SSakthivel K #define MSIX_INTERRUPT_CONTROL_OFFSET	0xC
1392f5860992SSakthivel K #define MSIX_TABLE_BASE			(MSIX_TABLE_OFFSET + \
1393f5860992SSakthivel K 					MSIX_INTERRUPT_CONTROL_OFFSET)
1394f5860992SSakthivel K #define MSIX_INTERRUPT_DISABLE		0x1
1395f5860992SSakthivel K #define MSIX_INTERRUPT_ENABLE		0x0
1396f5860992SSakthivel K 
1397f5860992SSakthivel K /* state definition for Scratch Pad1 register */
1398f5860992SSakthivel K #define SCRATCH_PAD_RAAE_READY		0x3
1399f5860992SSakthivel K #define SCRATCH_PAD_ILA_READY		0xC
1400f5860992SSakthivel K #define SCRATCH_PAD_BOOT_LOAD_SUCCESS	0x0
1401f5860992SSakthivel K #define SCRATCH_PAD_IOP0_READY		0xC00
1402f5860992SSakthivel K #define SCRATCH_PAD_IOP1_READY		0x3000
140362afb379SJohn Garry #define SCRATCH_PAD_MIPSALL_READY_16PORT	(SCRATCH_PAD_IOP1_READY | \
140472349b62SDeepak Ukey 					SCRATCH_PAD_IOP0_READY | \
140562afb379SJohn Garry 					SCRATCH_PAD_ILA_READY | \
140662afb379SJohn Garry 					SCRATCH_PAD_RAAE_READY)
140762afb379SJohn Garry #define SCRATCH_PAD_MIPSALL_READY_8PORT	(SCRATCH_PAD_IOP0_READY | \
140862afb379SJohn Garry 					SCRATCH_PAD_ILA_READY | \
140972349b62SDeepak Ukey 					SCRATCH_PAD_RAAE_READY)
1410f5860992SSakthivel K 
1411f5860992SSakthivel K /* boot loader state */
1412f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_MASK		0x70	/* Bit 4-6 */
1413f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_SUCESS		0x0	/* Load successful */
1414f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_HDA_SEEPROM	0x10	/* HDA SEEPROM */
1415f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_HDA_BOOTSTRAP	0x20	/* HDA BootStrap Pins */
1416f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_HDA_SOFTRESET	0x30	/* HDA Soft Reset */
1417f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_CRIT_ERROR	0x40	/* HDA critical error */
1418f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_R1		0x50	/* Reserved */
1419f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_R2		0x60	/* Reserved */
1420f5860992SSakthivel K #define SCRATCH_PAD1_BOOTSTATE_FATAL		0x70	/* Fatal Error */
1421f5860992SSakthivel K 
1422f5860992SSakthivel K  /* state definition for Scratch Pad2 register */
1423f5860992SSakthivel K #define SCRATCH_PAD2_POR		0x00	/* power on state */
1424f5860992SSakthivel K #define SCRATCH_PAD2_SFR		0x01	/* soft reset state */
1425f5860992SSakthivel K #define SCRATCH_PAD2_ERR		0x02	/* error state */
1426f5860992SSakthivel K #define SCRATCH_PAD2_RDY		0x03	/* ready state */
1427f5860992SSakthivel K #define SCRATCH_PAD2_FWRDY_RST		0x04	/* FW rdy for soft reset flag */
1428f5860992SSakthivel K #define SCRATCH_PAD2_IOPRDY_RST		0x08	/* IOP ready for soft reset */
1429f5860992SSakthivel K #define SCRATCH_PAD2_STATE_MASK		0xFFFFFFF4 /* ScratchPad 2
1430f5860992SSakthivel K  Mask, bit1-0 State */
1431f5860992SSakthivel K #define SCRATCH_PAD2_RESERVED		0x000003FC/* Scratch Pad1
1432f5860992SSakthivel K  Reserved bit 2 to 9 */
1433f5860992SSakthivel K 
1434f5860992SSakthivel K #define SCRATCH_PAD_ERROR_MASK		0xFFFFFC00 /* Error mask bits */
1435f5860992SSakthivel K #define SCRATCH_PAD_STATE_MASK		0x00000003 /* State Mask bits */
1436f5860992SSakthivel K 
143780cac47bSAjish Koshy /*state definition for Scratchpad Rsvd 0, Offset 0x6C, Non-fatal*/
143880cac47bSAjish Koshy #define NON_FATAL_SPBC_LBUS_ECC_ERR	0x70000001
143980cac47bSAjish Koshy #define NON_FATAL_BDMA_ERR		0xE0000001
144080cac47bSAjish Koshy #define NON_FATAL_THERM_OVERTEMP_ERR	0x80000001
144180cac47bSAjish Koshy 
1442f5860992SSakthivel K /* main configuration offset - byte offset */
1443f5860992SSakthivel K #define MAIN_SIGNATURE_OFFSET		0x00 /* DWORD 0x00 */
1444f5860992SSakthivel K #define MAIN_INTERFACE_REVISION		0x04 /* DWORD 0x01 */
1445f5860992SSakthivel K #define MAIN_FW_REVISION		0x08 /* DWORD 0x02 */
1446f5860992SSakthivel K #define MAIN_MAX_OUTSTANDING_IO_OFFSET	0x0C /* DWORD 0x03 */
1447f5860992SSakthivel K #define MAIN_MAX_SGL_OFFSET		0x10 /* DWORD 0x04 */
1448f5860992SSakthivel K #define MAIN_CNTRL_CAP_OFFSET		0x14 /* DWORD 0x05 */
1449f5860992SSakthivel K #define MAIN_GST_OFFSET			0x18 /* DWORD 0x06 */
1450f5860992SSakthivel K #define MAIN_IBQ_OFFSET			0x1C /* DWORD 0x07 */
1451f5860992SSakthivel K #define MAIN_OBQ_OFFSET			0x20 /* DWORD 0x08 */
1452f5860992SSakthivel K #define MAIN_IQNPPD_HPPD_OFFSET		0x24 /* DWORD 0x09 */
1453f5860992SSakthivel K 
1454f5860992SSakthivel K /* 0x28 - 0x4C - RSVD */
1455c6b9ef57SSakthivel K #define MAIN_EVENT_CRC_CHECK		0x48 /* DWORD 0x12 */
1456f5860992SSakthivel K #define MAIN_EVENT_LOG_ADDR_HI		0x50 /* DWORD 0x14 */
1457f5860992SSakthivel K #define MAIN_EVENT_LOG_ADDR_LO		0x54 /* DWORD 0x15 */
1458f5860992SSakthivel K #define MAIN_EVENT_LOG_BUFF_SIZE	0x58 /* DWORD 0x16 */
1459f5860992SSakthivel K #define MAIN_EVENT_LOG_OPTION		0x5C /* DWORD 0x17 */
1460f5860992SSakthivel K #define MAIN_PCS_EVENT_LOG_ADDR_HI	0x60 /* DWORD 0x18 */
1461f5860992SSakthivel K #define MAIN_PCS_EVENT_LOG_ADDR_LO	0x64 /* DWORD 0x19 */
1462f5860992SSakthivel K #define MAIN_PCS_EVENT_LOG_BUFF_SIZE	0x68 /* DWORD 0x1A */
1463f5860992SSakthivel K #define MAIN_PCS_EVENT_LOG_OPTION	0x6C /* DWORD 0x1B */
1464f5860992SSakthivel K #define MAIN_FATAL_ERROR_INTERRUPT	0x70 /* DWORD 0x1C */
1465f5860992SSakthivel K #define MAIN_FATAL_ERROR_RDUMP0_OFFSET	0x74 /* DWORD 0x1D */
1466f5860992SSakthivel K #define MAIN_FATAL_ERROR_RDUMP0_LENGTH	0x78 /* DWORD 0x1E */
1467f5860992SSakthivel K #define MAIN_FATAL_ERROR_RDUMP1_OFFSET	0x7C /* DWORD 0x1F */
1468f5860992SSakthivel K #define MAIN_FATAL_ERROR_RDUMP1_LENGTH	0x80 /* DWORD 0x20 */
1469f5860992SSakthivel K #define MAIN_GPIO_LED_FLAGS_OFFSET	0x84 /* DWORD 0x21 */
1470f5860992SSakthivel K #define MAIN_ANALOG_SETUP_OFFSET	0x88 /* DWORD 0x22 */
1471f5860992SSakthivel K 
1472f5860992SSakthivel K #define MAIN_INT_VECTOR_TABLE_OFFSET	0x8C /* DWORD 0x23 */
1473f5860992SSakthivel K #define MAIN_SAS_PHY_ATTR_TABLE_OFFSET	0x90 /* DWORD 0x24 */
1474f5860992SSakthivel K #define MAIN_PORT_RECOVERY_TIMER	0x94 /* DWORD 0x25 */
1475f5860992SSakthivel K #define MAIN_INT_REASSERTION_DELAY	0x98 /* DWORD 0x26 */
147624fff017SViswas G #define MAIN_MPI_ILA_RELEASE_TYPE	0xA4 /* DWORD 0x29 */
147724fff017SViswas G #define MAIN_MPI_INACTIVE_FW_VERSION	0XB0 /* DWORD 0x2C */
1478f5860992SSakthivel K 
1479f5860992SSakthivel K /* Gereral Status Table offset - byte offset */
1480f5860992SSakthivel K #define GST_GSTLEN_MPIS_OFFSET		0x00
1481f5860992SSakthivel K #define GST_IQ_FREEZE_STATE0_OFFSET	0x04
1482f5860992SSakthivel K #define GST_IQ_FREEZE_STATE1_OFFSET	0x08
1483f5860992SSakthivel K #define GST_MSGUTCNT_OFFSET		0x0C
1484f5860992SSakthivel K #define GST_IOPTCNT_OFFSET		0x10
1485f5860992SSakthivel K /* 0x14 - 0x34 - RSVD */
1486f5860992SSakthivel K #define GST_GPIO_INPUT_VAL		0x38
1487f5860992SSakthivel K /* 0x3c - 0x40 - RSVD */
1488f5860992SSakthivel K #define GST_RERRINFO_OFFSET0		0x44
1489f5860992SSakthivel K #define GST_RERRINFO_OFFSET1		0x48
1490f5860992SSakthivel K #define GST_RERRINFO_OFFSET2		0x4c
1491f5860992SSakthivel K #define GST_RERRINFO_OFFSET3		0x50
1492f5860992SSakthivel K #define GST_RERRINFO_OFFSET4		0x54
1493f5860992SSakthivel K #define GST_RERRINFO_OFFSET5		0x58
1494f5860992SSakthivel K #define GST_RERRINFO_OFFSET6		0x5c
1495f5860992SSakthivel K #define GST_RERRINFO_OFFSET7		0x60
1496f5860992SSakthivel K 
1497f5860992SSakthivel K /* General Status Table - MPI state */
1498f5860992SSakthivel K #define GST_MPI_STATE_UNINIT		0x00
1499f5860992SSakthivel K #define GST_MPI_STATE_INIT		0x01
1500f5860992SSakthivel K #define GST_MPI_STATE_TERMINATION	0x02
1501f5860992SSakthivel K #define GST_MPI_STATE_ERROR		0x03
1502f5860992SSakthivel K #define GST_MPI_STATE_MASK		0x07
1503f5860992SSakthivel K 
1504f5860992SSakthivel K /* Per SAS PHY Attributes */
1505f5860992SSakthivel K 
1506f5860992SSakthivel K #define PSPA_PHYSTATE0_OFFSET		0x00 /* Dword V */
1507f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID0_OFFSET	0x04 /* DWORD V+1 */
1508f5860992SSakthivel K #define PSPA_PHYSTATE1_OFFSET		0x08 /* Dword V+2 */
1509f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID1_OFFSET	0x0C /* DWORD V+3 */
1510f5860992SSakthivel K #define PSPA_PHYSTATE2_OFFSET		0x10 /* Dword V+4 */
1511f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID2_OFFSET	0x14 /* DWORD V+5 */
1512f5860992SSakthivel K #define PSPA_PHYSTATE3_OFFSET		0x18 /* Dword V+6 */
1513f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID3_OFFSET	0x1C /* DWORD V+7 */
1514f5860992SSakthivel K #define PSPA_PHYSTATE4_OFFSET		0x20 /* Dword V+8 */
1515f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID4_OFFSET	0x24 /* DWORD V+9 */
1516f5860992SSakthivel K #define PSPA_PHYSTATE5_OFFSET		0x28 /* Dword V+10 */
1517f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID5_OFFSET	0x2C /* DWORD V+11 */
1518f5860992SSakthivel K #define PSPA_PHYSTATE6_OFFSET		0x30 /* Dword V+12 */
1519f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID6_OFFSET	0x34 /* DWORD V+13 */
1520f5860992SSakthivel K #define PSPA_PHYSTATE7_OFFSET		0x38 /* Dword V+14 */
1521f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID7_OFFSET	0x3C /* DWORD V+15 */
1522f5860992SSakthivel K #define PSPA_PHYSTATE8_OFFSET		0x40 /* DWORD V+16 */
1523f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID8_OFFSET	0x44 /* DWORD V+17 */
1524f5860992SSakthivel K #define PSPA_PHYSTATE9_OFFSET		0x48 /* DWORD V+18 */
1525f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID9_OFFSET	0x4C /* DWORD V+19 */
1526f5860992SSakthivel K #define PSPA_PHYSTATE10_OFFSET		0x50 /* DWORD V+20 */
1527f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID10_OFFSET	0x54 /* DWORD V+21 */
1528f5860992SSakthivel K #define PSPA_PHYSTATE11_OFFSET		0x58 /* DWORD V+22 */
1529f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID11_OFFSET	0x5C /* DWORD V+23 */
1530f5860992SSakthivel K #define PSPA_PHYSTATE12_OFFSET		0x60 /* DWORD V+24 */
1531f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID12_OFFSET	0x64 /* DWORD V+25 */
1532f5860992SSakthivel K #define PSPA_PHYSTATE13_OFFSET		0x68 /* DWORD V+26 */
1533f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID13_OFFSET	0x6c /* DWORD V+27 */
1534f5860992SSakthivel K #define PSPA_PHYSTATE14_OFFSET		0x70 /* DWORD V+28 */
1535f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID14_OFFSET	0x74 /* DWORD V+29 */
1536f5860992SSakthivel K #define PSPA_PHYSTATE15_OFFSET		0x78 /* DWORD V+30 */
1537f5860992SSakthivel K #define PSPA_OB_HW_EVENT_PID15_OFFSET	0x7c /* DWORD V+31 */
1538f5860992SSakthivel K /* end PSPA */
1539f5860992SSakthivel K 
1540f5860992SSakthivel K /* inbound queue configuration offset - byte offset */
1541f5860992SSakthivel K #define IB_PROPERITY_OFFSET		0x00
1542f5860992SSakthivel K #define IB_BASE_ADDR_HI_OFFSET		0x04
1543f5860992SSakthivel K #define IB_BASE_ADDR_LO_OFFSET		0x08
1544f5860992SSakthivel K #define IB_CI_BASE_ADDR_HI_OFFSET	0x0C
1545f5860992SSakthivel K #define IB_CI_BASE_ADDR_LO_OFFSET	0x10
1546f5860992SSakthivel K #define IB_PIPCI_BAR			0x14
1547f5860992SSakthivel K #define IB_PIPCI_BAR_OFFSET		0x18
1548f5860992SSakthivel K #define IB_RESERVED_OFFSET		0x1C
1549f5860992SSakthivel K 
1550f5860992SSakthivel K /* outbound queue configuration offset - byte offset */
1551f5860992SSakthivel K #define OB_PROPERITY_OFFSET		0x00
1552f5860992SSakthivel K #define OB_BASE_ADDR_HI_OFFSET		0x04
1553f5860992SSakthivel K #define OB_BASE_ADDR_LO_OFFSET		0x08
1554f5860992SSakthivel K #define OB_PI_BASE_ADDR_HI_OFFSET	0x0C
1555f5860992SSakthivel K #define OB_PI_BASE_ADDR_LO_OFFSET	0x10
1556f5860992SSakthivel K #define OB_CIPCI_BAR			0x14
1557f5860992SSakthivel K #define OB_CIPCI_BAR_OFFSET		0x18
1558f5860992SSakthivel K #define OB_INTERRUPT_COALES_OFFSET	0x1C
1559f5860992SSakthivel K #define OB_DYNAMIC_COALES_OFFSET	0x20
1560f5860992SSakthivel K #define OB_PROPERTY_INT_ENABLE		0x40000000
1561f5860992SSakthivel K 
1562f5860992SSakthivel K #define MBIC_NMI_ENABLE_VPE0_IOP	0x000418
1563f5860992SSakthivel K #define MBIC_NMI_ENABLE_VPE0_AAP1	0x000418
1564f5860992SSakthivel K /* PCIE registers - BAR2(0x18), BAR1(win) 0x010000 */
1565f5860992SSakthivel K #define PCIE_EVENT_INTERRUPT_ENABLE	0x003040
1566f5860992SSakthivel K #define PCIE_EVENT_INTERRUPT		0x003044
1567f5860992SSakthivel K #define PCIE_ERROR_INTERRUPT_ENABLE	0x003048
1568f5860992SSakthivel K #define PCIE_ERROR_INTERRUPT		0x00304C
1569f5860992SSakthivel K 
1570f5860992SSakthivel K /* SPCV soft reset */
1571f5860992SSakthivel K #define SPC_REG_SOFT_RESET 0x00001000
1572f5860992SSakthivel K #define SPCv_NORMAL_RESET_VALUE		0x1
1573f5860992SSakthivel K 
1574f5860992SSakthivel K #define SPCv_SOFT_RESET_READ_MASK		0xC0
1575f5860992SSakthivel K #define SPCv_SOFT_RESET_NO_RESET		0x0
1576f5860992SSakthivel K #define SPCv_SOFT_RESET_NORMAL_RESET_OCCURED	0x40
1577f5860992SSakthivel K #define SPCv_SOFT_RESET_HDA_MODE_OCCURED	0x80
1578f5860992SSakthivel K #define SPCv_SOFT_RESET_CHIP_RESET_OCCURED	0xC0
1579f5860992SSakthivel K 
1580f5860992SSakthivel K /* signature definition for host scratch pad0 register */
1581f5860992SSakthivel K #define SPC_SOFT_RESET_SIGNATURE	0x252acbcd
1582f5860992SSakthivel K /* Signature for Soft Reset */
1583f5860992SSakthivel K 
1584f5860992SSakthivel K /* SPC Reset register - BAR4(0x20), BAR2(win) (need dynamic mapping) */
1585f5860992SSakthivel K #define SPC_REG_RESET			0x000000/* reset register */
1586f5860992SSakthivel K 
1587f5860992SSakthivel K /* bit definition for SPC_RESET register */
1588f5860992SSakthivel K #define SPC_REG_RESET_OSSP		0x00000001
1589f5860992SSakthivel K #define SPC_REG_RESET_RAAE		0x00000002
1590f5860992SSakthivel K #define SPC_REG_RESET_PCS_SPBC		0x00000004
1591f5860992SSakthivel K #define SPC_REG_RESET_PCS_IOP_SS	0x00000008
1592f5860992SSakthivel K #define SPC_REG_RESET_PCS_AAP1_SS	0x00000010
1593f5860992SSakthivel K #define SPC_REG_RESET_PCS_AAP2_SS	0x00000020
1594f5860992SSakthivel K #define SPC_REG_RESET_PCS_LM		0x00000040
1595f5860992SSakthivel K #define SPC_REG_RESET_PCS		0x00000080
1596f5860992SSakthivel K #define SPC_REG_RESET_GSM		0x00000100
1597f5860992SSakthivel K #define SPC_REG_RESET_DDR2		0x00010000
1598f5860992SSakthivel K #define SPC_REG_RESET_BDMA_CORE		0x00020000
1599f5860992SSakthivel K #define SPC_REG_RESET_BDMA_SXCBI	0x00040000
1600f5860992SSakthivel K #define SPC_REG_RESET_PCIE_AL_SXCBI	0x00080000
1601f5860992SSakthivel K #define SPC_REG_RESET_PCIE_PWR		0x00100000
1602f5860992SSakthivel K #define SPC_REG_RESET_PCIE_SFT		0x00200000
1603f5860992SSakthivel K #define SPC_REG_RESET_PCS_SXCBI		0x00400000
1604f5860992SSakthivel K #define SPC_REG_RESET_LMS_SXCBI		0x00800000
1605f5860992SSakthivel K #define SPC_REG_RESET_PMIC_SXCBI	0x01000000
1606f5860992SSakthivel K #define SPC_REG_RESET_PMIC_CORE		0x02000000
1607f5860992SSakthivel K #define SPC_REG_RESET_PCIE_PC_SXCBI	0x04000000
1608f5860992SSakthivel K #define SPC_REG_RESET_DEVICE		0x80000000
1609f5860992SSakthivel K 
1610f5860992SSakthivel K /* registers for BAR Shifting - BAR2(0x18), BAR1(win) */
1611f5860992SSakthivel K #define SPCV_IBW_AXI_TRANSLATION_LOW	0x001010
1612f5860992SSakthivel K 
1613f5860992SSakthivel K #define MBIC_AAP1_ADDR_BASE		0x060000
1614f5860992SSakthivel K #define MBIC_IOP_ADDR_BASE		0x070000
1615f5860992SSakthivel K #define GSM_ADDR_BASE			0x0700000
1616f5860992SSakthivel K /* Dynamic map through Bar4 - 0x00700000 */
1617f5860992SSakthivel K #define GSM_CONFIG_RESET		0x00000000
1618f5860992SSakthivel K #define RAM_ECC_DB_ERR			0x00000018
1619f5860992SSakthivel K #define GSM_READ_ADDR_PARITY_INDIC	0x00000058
1620f5860992SSakthivel K #define GSM_WRITE_ADDR_PARITY_INDIC	0x00000060
1621f5860992SSakthivel K #define GSM_WRITE_DATA_PARITY_INDIC	0x00000068
1622f5860992SSakthivel K #define GSM_READ_ADDR_PARITY_CHECK	0x00000038
1623f5860992SSakthivel K #define GSM_WRITE_ADDR_PARITY_CHECK	0x00000040
1624f5860992SSakthivel K #define GSM_WRITE_DATA_PARITY_CHECK	0x00000048
1625f5860992SSakthivel K 
1626f5860992SSakthivel K #define RB6_ACCESS_REG			0x6A0000
1627f5860992SSakthivel K #define HDAC_EXEC_CMD			0x0002
1628f5860992SSakthivel K #define HDA_C_PA			0xcb
1629f5860992SSakthivel K #define HDA_SEQ_ID_BITS			0x00ff0000
1630f5860992SSakthivel K #define HDA_GSM_OFFSET_BITS		0x00FFFFFF
1631f5860992SSakthivel K #define HDA_GSM_CMD_OFFSET_BITS		0x42C0
1632f5860992SSakthivel K #define HDA_GSM_RSP_OFFSET_BITS		0x42E0
1633f5860992SSakthivel K 
1634f5860992SSakthivel K #define MBIC_AAP1_ADDR_BASE		0x060000
1635f5860992SSakthivel K #define MBIC_IOP_ADDR_BASE		0x070000
1636f5860992SSakthivel K #define GSM_ADDR_BASE			0x0700000
1637f5860992SSakthivel K #define SPC_TOP_LEVEL_ADDR_BASE		0x000000
1638f5860992SSakthivel K #define GSM_CONFIG_RESET_VALUE		0x00003b00
1639f5860992SSakthivel K #define GPIO_ADDR_BASE			0x00090000
1640f5860992SSakthivel K #define GPIO_GPIO_0_0UTPUT_CTL_OFFSET	0x0000010c
1641f5860992SSakthivel K 
1642f5860992SSakthivel K /* RB6 offset */
1643f5860992SSakthivel K #define SPC_RB6_OFFSET			0x80C0
1644f5860992SSakthivel K /* Magic number of soft reset for RB6 */
1645f5860992SSakthivel K #define RB6_MAGIC_NUMBER_RST		0x1234
1646f5860992SSakthivel K 
1647f5860992SSakthivel K /* Device Register status */
1648f5860992SSakthivel K #define DEVREG_SUCCESS					0x00
1649f5860992SSakthivel K #define DEVREG_FAILURE_OUT_OF_RESOURCE			0x01
1650f5860992SSakthivel K #define DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED	0x02
1651f5860992SSakthivel K #define DEVREG_FAILURE_INVALID_PHY_ID			0x03
1652f5860992SSakthivel K #define DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED	0x04
1653f5860992SSakthivel K #define DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE		0x05
1654f5860992SSakthivel K #define DEVREG_FAILURE_PORT_NOT_VALID_STATE		0x06
1655f5860992SSakthivel K #define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID		0x07
1656f5860992SSakthivel K 
1657d078b511SAnand Kumar Santhanam 
1658d078b511SAnand Kumar Santhanam #define MEMBASE_II_SHIFT_REGISTER       0x1010
1659f5860992SSakthivel K #endif
166048cd6b38Sakshatzen 
166148cd6b38Sakshatzen /**
166248cd6b38Sakshatzen  * As we know sleep (1~20) ms may result in sleep longer than ~20 ms, hence we
166348cd6b38Sakshatzen  * choose 20 ms interval.
166448cd6b38Sakshatzen  */
166548cd6b38Sakshatzen #define FW_READY_INTERVAL	20
1666