xref: /illumos-gate/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_param.h (revision 5bbb4db2c3f208d12bf0fd11769728f9e5ba66a2)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  *
21  *
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*
26  * PMC Compile Time Tunable Parameters
27  */
28 #ifndef	_PMCS_PARAM_H
29 #define	_PMCS_PARAM_H
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * Maximum number of microseconds we will try to configure a PHY
36  */
37 #define	PMCS_MAX_CONFIG_TIME	(60 * 1000000)
38 
39 #define	PMCS_MAX_OQ		64	/* maximum number of OutBound Queues */
40 #define	PMCS_MAX_IQ		64	/* maximum number of InBound Queues */
41 
42 #define	PMCS_MAX_PORTS		16	/* maximum port contexts */
43 
44 #define	PMCS_MAX_XPND		16	/* 16 levels of expansion */
45 
46 #define	PMCS_INDICES_SIZE	512
47 
48 #define	PMCS_MIN_CHUNK_PAGES	512
49 #define	PMCS_ADDTL_CHUNK_PAGES	8
50 
51 /*
52  * Scratch area has to hold Max SMP Request and Max SMP Response,
53  * plus some slop.
54  */
55 #define	PMCS_SCRATCH_SIZE	2304
56 #define	PMCS_INITIAL_DMA_OFF	PMCS_INDICES_SIZE+PMCS_SCRATCH_SIZE
57 #define	PMCS_CONTROL_SIZE	ptob(1)
58 
59 /*
60  * 2M bytes was allocated to firmware log and split between two logs
61  */
62 #define	PMCS_FWLOG_SIZE		(2 << 20)
63 #define	PMCS_FWLOG_MAX		5	/* maximum logging level */
64 #define	SATLSIZE		1024
65 
66 /*
67  * PMCS_NQENTRY is tunable by setting pmcs-num-io-qentries
68  */
69 #define	PMCS_NQENTRY		512	/* 512 entries per queue */
70 #define	PMCS_MIN_NQENTRY	32	/* No less than 32 entries per queue */
71 #define	PMCS_QENTRY_SIZE	64	/* 64 bytes per entry */
72 #define	PMCS_MSG_SIZE		(PMCS_QENTRY_SIZE >> 2)
73 
74 /*
75  * Watchdog interval, in usecs.
76  * NB: Needs to be evenly divisible by 10
77  */
78 #define	PMCS_WATCH_INTERVAL	250000	/* watchdog interval in us */
79 
80 /*
81  * Inbound Queue definitions
82  */
83 #define	PMCS_NIQ		9	/* 9 Inbound Queues */
84 #define	PMCS_IO_IQ_MASK		7	/* IO queues are 0..7 */
85 #define	PMCS_IQ_OTHER		8	/* "Other" queue is 8 (HiPri) */
86 #define	PMCS_NON_HIPRI_QUEUES	PMCS_IO_IQ_MASK
87 
88 /*
89  * Outbound Queue definitions
90  *
91  * Note that the OQ definitions map to bits set in
92  * the Outbound Doorbell register to indicate service
93  * is needed on one of these queues.
94  */
95 #define	PMCS_NOQ		3	/* 3 Outbound Queues */
96 
97 #define	PMCS_OQ_IODONE		0	/* I/O completion Outbound Queue */
98 #define	PMCS_OQ_GENERAL		1	/* General Outbound Queue */
99 #define	PMCS_OQ_EVENTS		2	/* Event Outbound Queue */
100 
101 
102 /*
103  * External Scatter Gather come in chunks- each this many deep.
104  */
105 #define	PMCS_SGL_NCHUNKS	16	/* S/G List Chunk Size */
106 #define	PMCS_MAX_CHUNKS		32	/* max chunks per command */
107 
108 /*
109  * MSI/MSI-X related definitions.
110  *
111  * These are the maximum number of interrupt vectors we could use.
112  */
113 #define	PMCS_MAX_MSIX		(PMCS_NOQ + 1)
114 #define	PMCS_MAX_MSI		PMCS_MAX_MSIX
115 #define	PMCS_MAX_FIXED		1
116 
117 #define	PMCS_MSIX_IODONE	PMCS_OQ_IODONE	/* I/O Interrupt vector */
118 #define	PMCS_MSIX_GENERAL	PMCS_OQ_GENERAL	/* General Interrupt vector */
119 #define	PMCS_MSIX_EVENTS	PMCS_OQ_EVENTS	/* Events Interrupt vector */
120 #define	PMCS_MSIX_FATAL		(PMCS_MAX_MSIX-1)	/* Fatal Int vector */
121 
122 #define	PMCS_FATAL_INTERRUPT	15	/* fatal interrupt OBDB bit */
123 
124 /*
125  * Blessed firmware version
126  */
127 #define	PMCS_FIRMWARE_CODE_NAME		"firmware"
128 #define	PMCS_FIRMWARE_ILA_NAME		"ila"
129 #define	PMCS_FIRMWARE_SPCBOOT_NAME	"SPCBoot"
130 #define	PMCS_FIRMWARE_START_SUF		".bin_start"
131 #define	PMCS_FIRMWARE_END_SUF		".bin_end"
132 #define	PMCS_FIRMWARE_FILENAME		"misc/pmcs/pmcs8001fw"
133 #define	PMCS_FIRMWARE_VERSION_NAME	"pmcs8001_fwversion"
134 
135 #ifdef	__cplusplus
136 }
137 #endif
138 #endif	/* _PMCS_PARAM_H */
139