Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / dev / pci / n8 / common / n8_driver_parms.h
blob5542056e684252fc43e49fc0f4732564aab5e87d
1 /*-
2 * Copyright (C) 2001-2003 by NBMK Encryption Technologies.
3 * All rights reserved.
5 * NBMK Encryption Technologies provides no support of any kind for
6 * this software. Questions or concerns about it may be addressed to
7 * the members of the relevant open-source community at
8 * <tech-crypto@netbsd.org>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
12 * met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 /*****************************************************************************
36 * @(#) n8_driver_parms.h 1.46@(#)
37 *****************************************************************************/
39 /*****************************************************************************/
40 /** @file n8_driver_parms.h
41 * @brief NSP2000 Device Driver parameters
43 * This file contains all global parameters used in configuring or tuning
44 * the NSP2000 Device Driver.
46 *****************************************************************************/
48 /*****************************************************************************
49 * Revision history:
50 * 02/15/04 jpw Change default queue pool size to support one chip. Linux
51 * and vxworks will properly compute the total number of chips
52 * and queue size required. FreeBSD must have this number
53 * increased by hand to support more than one chip unless
54 * a kernel patch is applied.
55 * 10/28/03 pjm Removed incorrect comment on optimum performance tuning.
56 * 05/08/03 brr Remove VxWorks conditional compile flag & updated comments.
57 * 04/22/03 brr Bump N8_EA_POOL_SIZE to 4MB.
58 * 04/21/03 brr Added defines for size and granularity for multiple memory
59 * regions. Also moved non-configuration constants out of here.
60 * 04/01/03 brr Moved defines needed by user space to n8_sdk_config.
61 * 04/01/03 brr Eliminated N8_ENABLE_CMD_COMPLETE and changed default value
62 * for the AMBA timer.
63 * 03/19/03 brr Renamed N8_USE_AMBA_TIMER to N8_ENABLE_CMD_COMPLETE since
64 * the AMBA will always run with outstanding request and we
65 * conditionally configure the command complete interrupt.
66 * 03/03/03 jpw Changed USE_AMBA_TIMER to N8_USE_AMBA_TIMER (default = 1)
67 * 03/10/03 brr Added support for API callbacks.
68 * 12/09/02 brr Added N8_RNG_UNIT parameter.
69 * 11/19/02 brr Moved several nonconfiguration defines to more appopriate
70 * files and updated commments.
71 * 10/10/02 brr Elimated N8_EVENT_WAIT_TYPE.
72 * 09/10/02 brr Added optional definition of USE_AMBA_TIMER
73 * 06/25/02 brr Renamed constants used to define the user memory pool.
74 * 06/12/02 hml Reduced size of request bank so BSD machine will boot.
75 * 06/10/02 hml Added parameters for size and granularity of request
76 * bank and process request pool.
77 * 05/02/02 brr Removed AMBANumWaitBlocks.
78 * 03/29/02 brr Added N8_AMBA_TIMER_CHIP define.
79 * 02/26/02 brr Break circular dependency.
80 * 02/18/02 brr Removed obsolete context memory defines.
81 * 02/01/02 bac Changed the default for DEF_BIGALLOC_POOL_SIZE from 8 to 6.
82 * 01/21/02 msz Config of event wait type
83 * 01/15/02 msz Support of an array of AMBA wait blocks.
84 * 01/03/01 brr Added Bridge timer preset constant.
85 * 12/14/01 brr Support queue resizing on install & changed memory
86 * allocation granularity.
87 * 12/06/01 brr Added seperate define for RNG queue sizing, moved SKS init
88 * to the driver, and correct context memory detection.
89 * 12/05/01 brr Moved queue initialization to the driver.
90 * 11/15/01 mmd Updated ASIC device/vendor IDs.
91 * 11/14/01 mmd Original version.
92 ****************************************************************************/
94 #ifndef N8_DRIVER_PARMS_H
95 #define N8_DRIVER_PARMS_H
97 #include "n8_sdk_config.h"
99 /*****************************************************************************
100 * DRIVER NAME - *
101 * This null-terminated ASCII string is the name by which the driver is *
102 * registered upon being loaded and started. *
103 *****************************************************************************/
105 #define DEF_SIMON_DRIVER_NAME "nsp2000"
108 /*****************************************************************************
109 * MAJOR/MINOR NUMBERS - *
110 * The default major number is significant mainly for Linux, where 0 allows *
111 * the system to dynamically assign a major number to the driver. *
112 *****************************************************************************/
114 #define DEF_DEFAULT_MAJOR_NUMBER 0
117 /*****************************************************************************
118 * MEMORY RESOURCES - *
119 * These values dictate the amounts of memory to be allocated for certain *
120 * memory resources required by the hardware - command queues, Context *
121 * Memory, SKS, and RNG parameters. *
122 *****************************************************************************/
124 /* The POOL_SIZE constants determine this size of the contiguous memory region
125 * allocated for each NSP2000 core. If zero copy is enabled or used in either the
126 * API, openssl, or ipsec, this number must be increased to the total number
127 * of MB used to support a number of simultaneous connections or in use
128 * buffers.
130 #define N8_EA_POOL_SIZE 4096 /* kilobytes of memory in EA pool */
131 #define N8_EA_GRANULARITY 1024
133 #define N8_PK_POOL_SIZE 512 /* kilobytes of memory in PK pool */
134 #define N8_PK_GRANULARITY 1024
137 /* The N8_QUEUE_POOL_SIZE constant determines this size of the contiguous memory
138 * region allocated for the NSP2000's command queues. By default the 425 value
139 * supports a single chip. Linux/VxWorks will automatically multiply the value
140 * by the number of chips autodiscovered. FreeBSD can only autodiscover with
141 * a kernel change. To support two chips under FreeBSD - double the 425 value.
142 * If the queue sizes are modifed, the pool size should also be changed.
144 #define N8_QUEUE_POOL_SIZE 425 /* kilobytes of memory for command queues */
145 #define N8_QUEUE_GRANULARITY 4096 /* This should ensure page alignment to */
146 /* support diagnostic mmap of cmd queues. */
148 /* The following defines are power of 2 representations of the command queue */
149 /* lengths. The N8_DEF_CMD_QUE_EXP applies to both the EA & PK command queues */
150 #define N8_DEF_CMD_QUE_EXP 10
151 #define N8_DEF_RNG_QUE_EXP 15
153 #define MAX_API_REQS 128 /* Specifies the depth of the */
154 /* circular queue of API requests */
155 /* THIS MUST BE A POWER OF 2!! */
158 /* User pool banks map chunks of memory into user space for a process to use
159 * Single processes may benefit from this, but multithreaded applications
160 * may be slower - By default USER_POOL_BANKS is 0 which disables user pooling.
161 * A non-zero bank number will enable pooling and may require the POOL_SIZE
162 * to be increased for each user space allocated pool
164 #define DEF_USER_POOL_SIZE 1 /* megs allocated for each bank */
165 #define DEF_USER_POOL_BANKS 0 /* number of banks allocated */
166 #define DEF_USER_GRANULARITY 4096
169 /*****************************************************************************
170 * AMBA TIMER *
171 * The AMBA timer value is computed as: *
172 * at a chip clock of 167Mhz the AMBA bus runs at 83Mhz so each tick is 12ns.*
173 * A timer preset value of 0x4000 hex = 16384 dec which means that *
174 * 16384 ticks * 12 nanosecond tick length / 1000 = 196 microseconds tick *
175 * interval. An interrupt will be generated every 196 microseconds. *
176 *****************************************************************************/
178 #define N8_CONTEXT_MEMORY_TIMEOUT 30
180 #define N8_AMBA_TIMER_PRESET 0x2BF2
182 /* This constant defines which chip in the system will have the AMBA timer */
183 /* enabled. If it is set to something other and zero, systems with fewer */
184 /* chips than this value will not be operational. */
186 #define N8_AMBA_TIMER_CHIP 0
188 #endif /* N8_DRIVER_PARMS_H */