3 * sep_driver_config.h - Security Processor Driver configuration
5 * Copyright(c) 2009 Intel Corporation. All rights reserved.
6 * Copyright(c) 2009 Discretix. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along with
19 * this program; if not, write to the Free Software Foundation, Inc., 59
20 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * Mark Allyn mark.a.allyn@intel.com
28 * 2009.06.26 Initial publish
32 #ifndef __SEP_DRIVER_CONFIG_H__
33 #define __SEP_DRIVER_CONFIG_H__
36 /*--------------------------------------
37 DRIVER CONFIGURATION FLAGS
38 -------------------------------------*/
40 /* if flag is on , then the driver is running in polling and
42 #define SEP_DRIVER_POLLING_MODE 1
44 /* flag which defines if the shared area address should be
45 reconfiged (send to SEP anew) during init of the driver */
46 #define SEP_DRIVER_RECONFIG_MESSAGE_AREA 0
48 /* the mode for running on the ARM1172 Evaluation platform (flag is 1) */
49 #define SEP_DRIVER_ARM_DEBUG_MODE 0
51 /*-------------------------------------------
52 INTERNAL DATA CONFIGURATION
53 -------------------------------------------*/
55 /* flag for the input array */
56 #define SEP_DRIVER_IN_FLAG 0
58 /* flag for output array */
59 #define SEP_DRIVER_OUT_FLAG 1
61 /* maximum number of entries in one LLI tables */
62 #define SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP 8
65 /*--------------------------------------------------------
66 SHARED AREA memory total size is 36K
67 it is divided is following:
69 SHARED_MESSAGE_AREA 8K }
71 STATIC_POOL_AREA 4K } MAPPED AREA ( 24 K)
75 SYNCHRONIC_DMA_TABLES_AREA 5K
77 FLOW_DMA_TABLES_AREA 4K
81 SYSTEM_MEMORY total size is 3k
82 it is divided as following:
85 -----------------------------------------------------------*/
90 the maximum length of the message - the rest of the message shared
91 area will be dedicated to the dma lli tables
93 #define SEP_DRIVER_MAX_MESSAGE_SIZE_IN_BYTES (8 * 1024)
95 /* the size of the message shared area in pages */
96 #define SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES (8 * 1024)
98 /* the size of the data pool static area in pages */
99 #define SEP_DRIVER_STATIC_AREA_SIZE_IN_BYTES (4 * 1024)
101 /* the size of the data pool shared area size in pages */
102 #define SEP_DRIVER_DATA_POOL_SHARED_AREA_SIZE_IN_BYTES (12 * 1024)
104 /* the size of the message shared area in pages */
105 #define SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_SIZE_IN_BYTES (1024 * 5)
108 /* the size of the data pool shared area size in pages */
109 #define SEP_DRIVER_FLOW_DMA_TABLES_AREA_SIZE_IN_BYTES (1024 * 4)
111 /* system data (time, caller id etc') pool */
112 #define SEP_DRIVER_SYSTEM_DATA_MEMORY_SIZE_IN_BYTES 100
115 /* area size that is mapped - we map the MESSAGE AREA, STATIC POOL and
116 DATA POOL areas. area must be module 4k */
117 #define SEP_DRIVER_MMMAP_AREA_SIZE (1024 * 24)
120 /*-----------------------------------------------
121 offsets of the areas starting from the shared area start address
124 /* message area offset */
125 #define SEP_DRIVER_MESSAGE_AREA_OFFSET_IN_BYTES 0
127 /* static pool area offset */
128 #define SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES \
129 (SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES)
131 /* data pool area offset */
132 #define SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES \
133 (SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES + \
134 SEP_DRIVER_STATIC_AREA_SIZE_IN_BYTES)
136 /* synhronic dma tables area offset */
137 #define SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES \
138 (SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES + \
139 SEP_DRIVER_DATA_POOL_SHARED_AREA_SIZE_IN_BYTES)
141 /* sep driver flow dma tables area offset */
142 #define SEP_DRIVER_FLOW_DMA_TABLES_AREA_OFFSET_IN_BYTES \
143 (SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES + \
144 SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_SIZE_IN_BYTES)
146 /* system memory offset in bytes */
147 #define SEP_DRIVER_SYSTEM_DATA_MEMORY_OFFSET_IN_BYTES \
148 (SEP_DRIVER_FLOW_DMA_TABLES_AREA_OFFSET_IN_BYTES + \
149 SEP_DRIVER_FLOW_DMA_TABLES_AREA_SIZE_IN_BYTES)
151 /* offset of the time area */
152 #define SEP_DRIVER_SYSTEM_TIME_MEMORY_OFFSET_IN_BYTES \
153 (SEP_DRIVER_SYSTEM_DATA_MEMORY_OFFSET_IN_BYTES)
157 /* start physical address of the SEP registers memory in HOST */
158 #define SEP_IO_MEM_REGION_START_ADDRESS 0x80000000
160 /* size of the SEP registers memory region in HOST (for now 100 registers) */
161 #define SEP_IO_MEM_REGION_SIZE (2 * 0x100000)
163 /* define the number of IRQ for SEP interrupts */
164 #define SEP_DIRVER_IRQ_NUM 1
166 /* maximum number of add buffers */
167 #define SEP_MAX_NUM_ADD_BUFFERS 100
169 /* number of flows */
170 #define SEP_DRIVER_NUM_FLOWS 4
172 /* maximum number of entries in flow table */
173 #define SEP_DRIVER_MAX_FLOW_NUM_ENTRIES_IN_TABLE 25
175 /* offset of the num entries in the block length entry of the LLI */
176 #define SEP_NUM_ENTRIES_OFFSET_IN_BITS 24
178 /* offset of the interrupt flag in the block length entry of the LLI */
179 #define SEP_INT_FLAG_OFFSET_IN_BITS 31
181 /* mask for extracting data size from LLI */
182 #define SEP_TABLE_DATA_SIZE_MASK 0xFFFFFF
184 /* mask for entries after being shifted left */
185 #define SEP_NUM_ENTRIES_MASK 0x7F
187 /* default flow id */
188 #define SEP_FREE_FLOW_ID 0xFFFFFFFF
190 /* temp flow id used during cretiong of new flow until receiving
191 real flow id from sep */
192 #define SEP_TEMP_FLOW_ID (SEP_DRIVER_NUM_FLOWS + 1)
194 /* maximum add buffers message length in bytes */
195 #define SEP_MAX_ADD_MESSAGE_LENGTH_IN_BYTES (7 * 4)
197 /* maximum number of concurrent virtual buffers */
198 #define SEP_MAX_VIRT_BUFFERS_CONCURRENT 100
200 /* the token that defines the start of time address */
201 #define SEP_TIME_VAL_TOKEN 0x12345678
202 /* DEBUG LEVEL MASKS */
203 #define SEP_DEBUG_LEVEL_BASIC 0x1
205 #define SEP_DEBUG_LEVEL_REGISTERS 0x2
207 #define SEP_DEBUG_LEVEL_EXTENDED 0x4
210 /* FUNCTIONAL MACROS */
212 /* debug macro without paramaters */
213 #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \
215 if (DEBUG_LEVEL & sepDebug) \
216 printk(KERN_WARNING info); \
219 /* debug macro with 1 paramater */
220 #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \
222 if (DEBUG_LEVEL & sepDebug) \
223 printk(KERN_WARNING info, param1); \
226 /* debug macro with 2 paramaters */
227 #define DEBUG_PRINT_2(DEBUG_LEVEL, info, param1, param2) \
229 if (DEBUG_LEVEL & sepDebug) \
230 printk(KERN_WARNING info , param1, param2); \
233 /* debug macro with 3 paramaters */
234 #define DEBUG_PRINT_3(DEBUG_LEVEL, info, param1, param2, param3) \
236 if (DEBUG_LEVEL & sepDebug) \
237 printk(KERN_WARNING info , param1, param2 , param3); \
240 /* debug macro with 4 paramaters */
241 #define DEBUG_PRINT_4(DEBUG_LEVEL, info, param1, param2, param3, param4) \
243 if (DEBUG_LEVEL & sepDebug) \
244 printk(KERN_WARNING info, param1, param2, param3, param4); \