devLib2  2.12
vmedefs.h
Go to the documentation of this file.
1 #ifndef VMEDEFS_H
2 #define VMEDEFS_H
3 
4 /* From RTEMS where it is known as vme_am_defs.h */
5 /* vxworks compatible addressing modes */
6 
7 /*
8  * Authorship
9  * ----------
10  * This software was created by
11  * Till Straumann <strauman@slac.stanford.edu>, 2002-2007,
12  * Stanford Linear Accelerator Center, Stanford University.
13  *
14  * Acknowledgement of sponsorship
15  * ------------------------------
16  * This software was produced by
17  * the Stanford Linear Accelerator Center, Stanford University,
18  * under Contract DE-AC03-76SFO0515 with the Department of Energy.
19  *
20  * Government disclaimer of liability
21  * ----------------------------------
22  * Neither the United States nor the United States Department of Energy,
23  * nor any of their employees, makes any warranty, express or implied, or
24  * assumes any legal liability or responsibility for the accuracy,
25  * completeness, or usefulness of any data, apparatus, product, or process
26  * disclosed, or represents that its use would not infringe privately owned
27  * rights.
28  *
29  * Stanford disclaimer of liability
30  * --------------------------------
31  * Stanford University makes no representations or warranties, express or
32  * implied, nor assumes any liability for the use of this software.
33  *
34  * Stanford disclaimer of copyright
35  * --------------------------------
36  * Stanford University, owner of the copyright, hereby disclaims its
37  * copyright and all other rights in this software. Hence, anyone may
38  * freely use it for any purpose without restriction.
39  *
40  * Maintenance of notices
41  * ----------------------
42  * In the interest of clarity regarding the origin and status of this
43  * SLAC software, this and all the preceding Stanford University notices
44  * are to remain affixed to any copy or derivative of this software made
45  * or distributed by the recipient and are to be affixed to any copy of
46  * software made or distributed by the recipient that contains a copy or
47  * derivative of this software.
48  *
49  * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
50  */
51 /* NOTE: 64-bit *addresses* are not supported [data are]. */
52 
53 #ifndef VME_AM_STD_SUP_BLT
54 #define VME_AM_STD_SUP_BLT 0x3f
55 #endif
56 #ifndef VME_AM_STD_SUP_ASCENDING
57 #define VME_AM_STD_SUP_ASCENDING 0x3f
58 #endif
59 #ifndef VME_AM_STD_SUP_PGM
60 #define VME_AM_STD_SUP_PGM 0x3e
61 #endif
62 #ifndef VME_AM_STD_SUP_MBLT
63 #define VME_AM_STD_SUP_MBLT 0x3c
64 #endif
65 #ifndef VME_AM_STD_USR_BLT
66 #define VME_AM_STD_USR_BLT 0x3b
67 #endif
68 #ifndef VME_AM_STD_USR_ASCENDING
69 #define VME_AM_STD_USR_ASCENDING 0x3b
70 #endif
71 #ifndef VME_AM_STD_USR_PGM
72 #define VME_AM_STD_USR_PGM 0x3a
73 #endif
74 #ifndef VME_AM_STD_SUP_DATA
75 #define VME_AM_STD_SUP_DATA 0x3d
76 #endif
77 #ifndef VME_AM_STD_USR_DATA
78 #define VME_AM_STD_USR_DATA 0x39
79 #endif
80 #ifndef VME_AM_STD_USR_MBLT
81 #define VME_AM_STD_USR_MBLT 0x38
82 #endif
83 #ifndef VME_AM_EXT_SUP_BLT
84 #define VME_AM_EXT_SUP_BLT 0x0f
85 #endif
86 #ifndef VME_AM_EXT_SUP_ASCENDING
87 #define VME_AM_EXT_SUP_ASCENDING 0x0f
88 #endif
89 #ifndef VME_AM_EXT_SUP_PGM
90 #define VME_AM_EXT_SUP_PGM 0x0e
91 #endif
92 #ifndef VME_AM_EXT_SUP_DATA
93 #define VME_AM_EXT_SUP_DATA 0x0d
94 #endif
95 #ifndef VME_AM_EXT_SUP_MBLT
96 #define VME_AM_EXT_SUP_MBLT 0x0c
97 #endif
98 #ifndef VME_AM_EXT_USR_BLT
99 #define VME_AM_EXT_USR_BLT 0x0b
100 #endif
101 #ifndef VME_AM_EXT_USR_ASCENDING
102 #define VME_AM_EXT_USR_ASCENDING 0x0b
103 #endif
104 #ifndef VME_AM_EXT_USR_PGM
105 #define VME_AM_EXT_USR_PGM 0x0a
106 #endif
107 #ifndef VME_AM_EXT_USR_DATA
108 #define VME_AM_EXT_USR_DATA 0x09
109 #endif
110 #ifndef VME_AM_EXT_USR_MBLT
111 #define VME_AM_EXT_USR_MBLT 0x08
112 #endif
113 #ifndef VME_AM_2eVME_6U
114 #define VME_AM_2eVME_6U 0x20
115 #endif
116 #ifndef VME_AM_2eVME_3U
117 #define VME_AM_2eVME_3U 0x21
118 #endif
119 #ifndef VME_AM_CSR
120 #define VME_AM_CSR 0x2f
121 #endif
122 #ifndef VME_AM_SUP_SHORT_IO
123 #define VME_AM_SUP_SHORT_IO 0x2d
124 #endif
125 #ifndef VME_AM_USR_SHORT_IO
126 #define VME_AM_USR_SHORT_IO 0x29
127 #endif
128 #ifndef VME_AM_IS_SHORT
129 #define VME_AM_IS_SHORT(a) (((a) & 0x30) == 0x20)
130 #endif
131 #ifndef VME_AM_IS_STD
132 #define VME_AM_IS_STD(a) (((a) & 0x30) == 0x30)
133 #endif
134 #ifndef VME_AM_IS_EXT
135 #define VME_AM_IS_EXT(a) (((a) & 0x30) == 0x00)
136 #endif
137 #ifndef VME_AM_IS_SUP
138 #define VME_AM_IS_SUP(a) ((a) & 4)
139 #endif
140 
141 /* Mask for standard address modifiers */
142 
143 #ifndef VME_AM_MASK
144 #define VME_AM_MASK 0x3f
145 #endif
146 
147 /* Hint that a window is mapping memory; the
148  * driver may assume it to be safe to enable decoupled
149  * cycles, caching and the like...
150  */
151 #ifndef VME_AM_IS_MEMORY
152 #define VME_AM_IS_MEMORY (1<<8)
153 #endif
154 
155 /* I don't know AMs for 2eSST so we use some extra bits;
156  * HOWEVER: these are just qualifiers to the VME_AM_2eVME_xx modes
157  * i.e., if you want 2eSST you must also select 2eVME...
158  */
159 
160 /* 2eSST broadcast; you still need to set one of the speed bits */
161 #define VME_AM_2eSST_BCST (1<<9)
162 /* Low speed (driver specific) */
163 #define VME_AM_2eSST_LO (1<<10)
164 /* Mid speed (driver specific) */
165 #define VME_AM_2eSST_MID (2<<10)
166 /* High speed (driver specific) */
167 #define VME_AM_2eSST_HI (3<<10)
168 
169 #define VME_AM_IS_2eSST(am) ((am) & (3<<10))
170 
171 /* Use 8/16/32-bit transfers for coupled- or BLT cycles
172  * (MBLT, 2exxx are probably always 64-bit)
173  */
174 #define VME_MODE_DBW_MSK (3<<12)
175 #define VME_MODE_DBW8 (1<<12)
176 #define VME_MODE_DBW16 (2<<12)
177 #define VME_MODE_DBW32 (3<<12)
178 
179 /* Unused Flags 1<<14 .. 1<<23 are reserved
180  *
181  * (20-23 used by DMA API).
182  * Flags 1<<24 .. 1<<31 are for driver specific options
183  */
184 
185 
186 #endif /* VMEDEFS_H */