xref: /onnv-gate/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_param.h (revision 11692:8795ed2df6db)
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 2010 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  * Forward progress trigger. This is the number of times we run through
82  * watchdog before checking for forward progress.  Implicitly bound to
83  * PMCS_WATCH_INTERVAL above. For example, with a PMCS_WATCH_INTERVAL of
84  * 250000, the watchdog will run every quarter second, so forward progress
85  * will be checked every 16th watchdog fire, or every four seconds.
86  */
87 #define	PMCS_FWD_PROG_TRIGGER	16
88 
89 /*
90  * Inbound Queue definitions
91  */
92 #define	PMCS_NIQ		9	/* 9 Inbound Queues */
93 #define	PMCS_IO_IQ_MASK		7	/* IO queues are 0..7 */
94 #define	PMCS_IQ_OTHER		8	/* "Other" queue is 8 (HiPri) */
95 #define	PMCS_NON_HIPRI_QUEUES	PMCS_IO_IQ_MASK
96 
97 /*
98  * Outbound Queue definitions
99  *
100  * Note that the OQ definitions map to bits set in
101  * the Outbound Doorbell register to indicate service
102  * is needed on one of these queues.
103  */
104 #define	PMCS_NOQ		3	/* 3 Outbound Queues */
105 
106 #define	PMCS_OQ_IODONE		0	/* I/O completion Outbound Queue */
107 #define	PMCS_OQ_GENERAL		1	/* General Outbound Queue */
108 #define	PMCS_OQ_EVENTS		2	/* Event Outbound Queue */
109 
110 
111 /*
112  * External Scatter Gather come in chunks- each this many deep.
113  */
114 #define	PMCS_SGL_NCHUNKS	16	/* S/G List Chunk Size */
115 #define	PMCS_MAX_CHUNKS		32	/* max chunks per command */
116 
117 /*
118  * MSI/MSI-X related definitions.
119  *
120  * These are the maximum number of interrupt vectors we could use.
121  */
122 #define	PMCS_MAX_MSIX		(PMCS_NOQ + 1)
123 #define	PMCS_MAX_MSI		PMCS_MAX_MSIX
124 #define	PMCS_MAX_FIXED		1
125 
126 #define	PMCS_MSIX_IODONE	PMCS_OQ_IODONE	/* I/O Interrupt vector */
127 #define	PMCS_MSIX_GENERAL	PMCS_OQ_GENERAL	/* General Interrupt vector */
128 #define	PMCS_MSIX_EVENTS	PMCS_OQ_EVENTS	/* Events Interrupt vector */
129 #define	PMCS_MSIX_FATAL		(PMCS_MAX_MSIX-1)	/* Fatal Int vector */
130 
131 #define	PMCS_FATAL_INTERRUPT	15	/* fatal interrupt OBDB bit */
132 
133 /*
134  * Blessed firmware version
135  */
136 #define	PMCS_FIRMWARE_CODE_NAME		"firmware"
137 #define	PMCS_FIRMWARE_ILA_NAME		"ila"
138 #define	PMCS_FIRMWARE_SPCBOOT_NAME	"SPCBoot"
139 #define	PMCS_FIRMWARE_START_SUF		".bin_start"
140 #define	PMCS_FIRMWARE_END_SUF		".bin_end"
141 #define	PMCS_FIRMWARE_FILENAME		"misc/pmcs/pmcs8001fw"
142 #define	PMCS_FIRMWARE_VERSION_NAME	"pmcs8001_fwversion"
143 
144 #ifdef	__cplusplus
145 }
146 #endif
147 #endif	/* _PMCS_PARAM_H */
148