Thu Jan 19 09:59:08 2012 UTC ()
Add more function prototypes.


(matt)
diff -r1.1.2.6 -r1.1.2.7 src/sys/arch/mips/rmi/rmixl_fmnvar.h

cvs diff -r1.1.2.6 -r1.1.2.7 src/sys/arch/mips/rmi/rmixl_fmnvar.h (switch to unified diff)

--- src/sys/arch/mips/rmi/rmixl_fmnvar.h 2012/01/04 16:17:53 1.1.2.6
+++ src/sys/arch/mips/rmi/rmixl_fmnvar.h 2012/01/19 09:59:08 1.1.2.7
@@ -1,360 +1,367 @@ @@ -1,360 +1,367 @@
1/* $Id: rmixl_fmnvar.h,v 1.1.2.6 2012/01/04 16:17:53 matt Exp $ */ 1/* $Id: rmixl_fmnvar.h,v 1.1.2.7 2012/01/19 09:59:08 matt Exp $ */
2/*- 2/*-
3 * Copyright (c) 2010 The NetBSD Foundation, Inc. 3 * Copyright (c) 2010 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Cliff Neighbors. 7 * by Cliff Neighbors.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the 15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution. 16 * documentation and/or other materials provided with the distribution.
17 * 17 *
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#ifndef _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ 31#ifndef _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_
32#define _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ 32#define _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_
33 33
 34#include <sys/cpu.h>
34#include <mips/cpuregs.h> 35#include <mips/cpuregs.h>
35 36
36#define RMIXL_FMN_CODE_PSB_WAKEUP 200 /* firmware MSGRNG_CODE_BOOT_WAKEUP */ 37#define RMIXL_FMN_CODE_PSB_WAKEUP 200 /* firmware MSGRNG_CODE_BOOT_WAKEUP */
37#define RMIXL_FMN_CODE_HELLO_REQ 201 38#define RMIXL_FMN_CODE_HELLO_REQ 201
38#define RMIXL_FMN_CODE_HELLO_ACK 202 39#define RMIXL_FMN_CODE_HELLO_ACK 202
39 40
40#define RMIXL_FMN_HELLO_REQ_SZ 4 41#define RMIXL_FMN_HELLO_REQ_SZ 4
41#define RMIXL_FMN_HELLO_ACK_SZ 4 42#define RMIXL_FMN_HELLO_ACK_SZ 4
42 43
43typedef struct rmixl_fmn_msg { 44typedef struct rmixl_fmn_msg {
44 uint64_t data[4]; 45 uint64_t data[4];
45} rmixl_fmn_msg_t; 46} rmixl_fmn_msg_t;
46 47
47typedef struct rmixl_fmn_rxmsg { 48typedef struct rmixl_fmn_rxmsg {
48 uint16_t rxsid; 49 uint16_t rxsid;
49 u_int code; 50 u_int code;
50 uint8_t size; 51 uint8_t size;
51 rmixl_fmn_msg_t msg; 52 rmixl_fmn_msg_t msg;
52} rmixl_fmn_rxmsg_t; 53} rmixl_fmn_rxmsg_t;
53 54
54 55
55/* 56/*
56 * compute FMN dest_id from MIPS cpuid 57 * compute FMN dest_id from MIPS cpuid
57 * - each Core FMN sation has 8 buckets 58 * - each Core FMN sation has 8 buckets
58 * - each Core has 4 threads 59 * - each Core has 4 threads
59 * - here we use 1 bucket per thread 60 * - here we use 1 bucket per thread
60 * (the first four buckets) 61 * (the first four buckets)
61 * - if we need { hi, lo } priority buckets per thread 62 * - if we need { hi, lo } priority buckets per thread
62 * need to adjust the RMIXL_FMN_DESTID macro 63 * need to adjust the RMIXL_FMN_DESTID macro
63 * and use the 'pri' parameter 64 * and use the 'pri' parameter
64 * - i.e. for now there is only one priority 65 * - i.e. for now there is only one priority
65 */ 66 */
66#define RMIXL_CPU_CORE(cpuid) ((uint32_t)__SHIFTOUT((cpuid), __BITS(7,3))) 67#define RMIXL_CPU_CORE(cpuid) ((uint32_t)__SHIFTOUT((cpuid), __BITS(7,3)))
67#define RMIXL_CPU_THREAD(cpuid) ((uint32_t)__SHIFTOUT((cpuid), __BITS(1,0))) 68#define RMIXL_CPU_THREAD(cpuid) ((uint32_t)__SHIFTOUT((cpuid), __BITS(1,0)))
68 69
69static inline uint64_t 70static inline uint64_t
70mips_dmfc2(const u_int regnum, const u_int sel) 71mips_dmfc2(const u_int regnum, const u_int sel)
71{ 72{
72 uint64_t __val; 73 uint64_t __val;
73 74
74 __asm volatile( 75 __asm volatile(
75 ".set push" "\n\t" 76 ".set push" "\n\t"
76 ".set mips64" "\n\t" 77 ".set mips64" "\n\t"
77 ".set noat" "\n\t" 78 ".set noat" "\n\t"
78 "dmfc2 %0,$%1,%2" "\n\t" 79 "dmfc2 %0,$%1,%2" "\n\t"
79 ".set pop" "\n\t" 80 ".set pop" "\n\t"
80 : "=r"(__val) : "n"(regnum), "n"(sel)); 81 : "=r"(__val) : "n"(regnum), "n"(sel));
81 82
82 return __val; 83 return __val;
83} 84}
84 85
85static inline void 86static inline void
86mips_dmtc2(u_int regnum, u_int sel, uint64_t val) 87mips_dmtc2(u_int regnum, u_int sel, uint64_t val)
87{ 88{
88 __asm volatile( 89 __asm volatile(
89 ".set push" "\n\t" 90 ".set push" "\n\t"
90 ".set mips64" "\n\t" 91 ".set mips64" "\n\t"
91 ".set noat" "\n\t" 92 ".set noat" "\n\t"
92 "dmtc2 %0,$%1,%2" "\n\t" 93 "dmtc2 %0,$%1,%2" "\n\t"
93 ".set pop" "\n\t" 94 ".set pop" "\n\t"
94 :: "r"(val), "n"(regnum), "n"(sel)); 95 :: "r"(val), "n"(regnum), "n"(sel));
95} 96}
96 97
97static inline uint64_t 98static inline uint64_t
98mips_mfc2(const u_int regnum, const u_int sel) 99mips_mfc2(const u_int regnum, const u_int sel)
99{ 100{
100 uint32_t __val; 101 uint32_t __val;
101 102
102 __asm volatile( 103 __asm volatile(
103 ".set push" "\n\t" 104 ".set push" "\n\t"
104 ".set mips32" "\n\t" 105 ".set mips32" "\n\t"
105 "mfc2 %0,$%1,%2" "\n\t" 106 "mfc2 %0,$%1,%2" "\n\t"
106 ".set pop" "\n\t" 107 ".set pop" "\n\t"
107 : "=r"(__val) : "n"(regnum), "n"(sel)); 108 : "=r"(__val) : "n"(regnum), "n"(sel));
108 return __val; 109 return __val;
109} 110}
110 111
111static inline void 112static inline void
112mips_mtc2(u_int regnum, u_int sel, uint32_t val) 113mips_mtc2(u_int regnum, u_int sel, uint32_t val)
113{ 114{
114 __asm volatile( 115 __asm volatile(
115 ".set push" "\n\t" 116 ".set push" "\n\t"
116 ".set mips32" "\n\t" 117 ".set mips32" "\n\t"
117 ".set noat" "\n\t" 118 ".set noat" "\n\t"
118 "mtc2 %0,$%1,%2" "\n\t" 119 "mtc2 %0,$%1,%2" "\n\t"
119 ".set pop" "\n\t" 120 ".set pop" "\n\t"
120 :: "r"(val), "n"(regnum), "n"(sel)); 121 :: "r"(val), "n"(regnum), "n"(sel));
121} 122}
122 123
123#define COP2_PRINT_8(regno, sel) \ 124#define COP2_PRINT_8(regno, sel) \
124do { \ 125do { \
125 printf("%s: COP2(%d,%d) = %#"PRIx64"\n", \ 126 printf("%s: COP2(%d,%d) = %#"PRIx64"\n", \
126 __func__, regno, sel, mips_dmfc2(regno, sel)); \ 127 __func__, regno, sel, mips_dmfc2(regno, sel)); \
127} while (0) 128} while (0)
128 129
129#define COP2_PRINT_4(regno, sel) \ 130#define COP2_PRINT_4(regno, sel) \
130do { \ 131do { \
131 printf("%s: COP2(%d,%d) = %#"PRIx32"\n", \ 132 printf("%s: COP2(%d,%d) = %#"PRIx32"\n", \
132 __func__, regno, sel, mips_mfc2(regno, sel)); \ 133 __func__, regno, sel, mips_mfc2(regno, sel)); \
133} while (0) 134} while (0)
134 135
135 136
136/* 137/*
137 * encode 'dest' for msgsnd op 'rt' 138 * encode 'dest' for msgsnd op 'rt'
138 */ 139 */
139#define RMIXL_MSGSND_DESC(size, code, dest_id) \ 140#define RMIXL_MSGSND_DESC(size, code, dest_id) \
140 (__SHIFTOUT((dest_id), __BITS(7,0)) \ 141 (__SHIFTOUT((dest_id), __BITS(7,0)) \
141 |__SHIFTOUT((code), __BITS(15,8)) \ 142 |__SHIFTOUT((code), __BITS(15,8)) \
142 |__SHIFTOUT((size)-1, __BITS(17,16))) 143 |__SHIFTOUT((size)-1, __BITS(17,16)))
143#define RMIXLP_MSGSND_DESC(size, code, dest_id, dest_vc) \ 144#define RMIXLP_MSGSND_DESC(size, code, dest_id, dest_vc) \
144 (__SHIFTOUT((dest_id), __BITS(11,0)) \ 145 (__SHIFTOUT((dest_id), __BITS(11,0)) \
145 |__SHIFTOUT((size)-1, __BITS(17,16)) \ 146 |__SHIFTOUT((size)-1, __BITS(17,16)) \
146 |__SHIFTOUT((dest_vc), __BITS(20,19)) \ 147 |__SHIFTOUT((dest_vc), __BITS(20,19)) \
147 |__SHIFTOUT((code), __BITS(31,24))) 148 |__SHIFTOUT((code), __BITS(31,24)))
148 149
149static inline void 150static inline void
150rmixl_msgsnd(uint32_t desc) 151rmixl_msgsnd(uint32_t desc)
151{ 152{
152 __asm__ volatile ( 153 __asm__ volatile (
153 ".set push" "\n\t" 154 ".set push" "\n\t"
154 ".set noreorder" "\n\t" 155 ".set noreorder" "\n\t"
155 ".set arch=xlr" "\n\t" 156 ".set arch=xlr" "\n\t"
156 "sync" "\n\t" 157 "sync" "\n\t"
157 "msgsnd %0" "\n\t" 158 "msgsnd %0" "\n\t"
158 ".set pop" "\n\t" 159 ".set pop" "\n\t"
159 :: "r"(desc)); 160 :: "r"(desc));
160} 161}
161 162
162static inline uint32_t 163static inline uint32_t
163rmixlp_msgsnd(uint32_t desc) 164rmixlp_msgsnd(uint32_t desc)
164{ 165{
165 uint32_t rv; 166 uint32_t rv;
166 167
167 __asm__ volatile ( 168 __asm__ volatile (
168 ".set push" "\n\t" 169 ".set push" "\n\t"
169 ".set noreorder" "\n\t" 170 ".set noreorder" "\n\t"
170 ".set arch=xlp" "\n\t" 171 ".set arch=xlp" "\n\t"
171 "sync" "\n\t" 172 "sync" "\n\t"
172 "msgsnds %[desc],%[rv]" "\n\t" 173 "msgsnds %[desc],%[rv]" "\n\t"
173 ".set pop" "\n\t" 174 ".set pop" "\n\t"
174 : [rv] "=r" (rv) 175 : [rv] "=r" (rv)
175 : [desc] "r" (desc)); 176 : [desc] "r" (desc));
176 177
177 return rv; 178 return rv;
178} 179}
179 180
180static inline void 181static inline void
181rmixl_msgld(uint32_t bucket) 182rmixl_msgld(uint32_t bucket)
182{ 183{
183 __asm__ volatile ( 184 __asm__ volatile (
184 ".set push" "\n\t" 185 ".set push" "\n\t"
185 ".set noreorder" "\n\t" 186 ".set noreorder" "\n\t"
186 ".set arch=xlr" "\n\t" 187 ".set arch=xlr" "\n\t"
187 "msgld %0" "\n\t" 188 "msgld %0" "\n\t"
188 ".set pop" "\n\t" 189 ".set pop" "\n\t"
189 :: "r"(bucket)); 190 :: "r"(bucket));
190} 191}
191 192
192static inline uint32_t 193static inline uint32_t
193rmixlp_msgld(uint32_t rxq) 194rmixlp_msgld(uint32_t rxq)
194{ 195{
195 uint32_t rv; 196 uint32_t rv;
196 197
197 __asm__ volatile ( 198 __asm__ volatile (
198 ".set push" "\n\t" 199 ".set push" "\n\t"
199 ".set noreorder" "\n\t" 200 ".set noreorder" "\n\t"
200 ".set arch=xlp" "\n\t" 201 ".set arch=xlp" "\n\t"
201 "msglds %[rxq],%[rv]" "\n\t" 202 "msglds %[rxq],%[rv]" "\n\t"
202 ".set pop" "\n\t" 203 ".set pop" "\n\t"
203 : [rv] "=r"(rv) 204 : [rv] "=r"(rv)
204 : [rxq] "r"(rxq)); 205 : [rxq] "r"(rxq));
205 206
206 return rv; 207 return rv;
207} 208}
208 209
209/* 210/*
210 * the seemingly-spurious add is recommended by RMI 211 * the seemingly-spurious add is recommended by RMI
211 * see XLS PRM (rev. 3.21) 5.3.9 212 * see XLS PRM (rev. 3.21) 5.3.9
212 */ 213 */
213static inline void 214static inline void
214rmixl_msgwait(u_int mask) 215rmixl_msgwait(u_int mask)
215{ 216{
216 __asm__ volatile ( 217 __asm__ volatile (
217 ".set push" "\n\t" 218 ".set push" "\n\t"
218 ".set noreorder" "\n\t" 219 ".set noreorder" "\n\t"
219 ".set arch=xlr" "\n\t" 220 ".set arch=xlr" "\n\t"
220 "daddu %0,%0,0" "\n\t" 221 "daddu %0,%0,0" "\n\t"
221 "msgwait %0" "\n\t" 222 "msgwait %0" "\n\t"
222 ".set pop" "\n\t" 223 ".set pop" "\n\t"
223 :: "r"(mask)); 224 :: "r"(mask));
224} 225}
225 226
226static inline uint32_t 227static inline uint32_t
227rmixl_cp2_enable(void) 228rmixl_cp2_enable(void)
228{ 229{
229 uint32_t rv; 230 uint32_t rv;
230 uint32_t sr; 231 uint32_t sr;
231 232
232 KASSERT(curcpu()->ci_cpl == IPL_HIGH); 233 KASSERT(curcpu()->ci_cpl == IPL_HIGH);
233 __asm volatile( 234 __asm volatile(
234 ".set push" "\n\t" 235 ".set push" "\n\t"
235 ".set noreorder" "\n\t" 236 ".set noreorder" "\n\t"
236 ".set noat" "\n\t" 237 ".set noat" "\n\t"
237 "mfc0 %[sr],$%[c0_status]" "\n\t" 238 "mfc0 %[sr],$%[c0_status]" "\n\t"
238 "and %[rv],%[sr],%[mask]" "\n\t" 239 "and %[rv],%[sr],%[mask]" "\n\t"
239 "or %[sr],%[mask]" "\n\t" 240 "or %[sr],%[mask]" "\n\t"
240 "mtc0 %[sr],$%[c0_status]" "\n\t" 241 "mtc0 %[sr],$%[c0_status]" "\n\t"
241 ".set pop" "\n\t" 242 ".set pop" "\n\t"
242 : [rv] "=r" (rv), 243 : [rv] "=r" (rv),
243 [sr] "=r" (sr) 244 [sr] "=r" (sr)
244 : [c0_status] "n" (MIPS_COP_0_STATUS), 245 : [c0_status] "n" (MIPS_COP_0_STATUS),
245 [mask] "r" (MIPS_SR_COP_2_BIT)); 246 [mask] "r" (MIPS_SR_COP_2_BIT));
246 247
247 return rv; 248 return rv;
248} 249}
249 250
250static inline void 251static inline void
251rmixl_cp2_restore(uint32_t ocu) 252rmixl_cp2_restore(uint32_t ocu)
252{ 253{
253 uint32_t cu2; 254 uint32_t cu2;
254 255
255 KASSERT(curcpu()->ci_cpl == IPL_HIGH); 256 KASSERT(curcpu()->ci_cpl == IPL_HIGH);
256 __asm volatile( 257 __asm volatile(
257 ".set push" "\n\t" 258 ".set push" "\n\t"
258 ".set noreorder" "\n\t" 259 ".set noreorder" "\n\t"
259 ".set noat" "\n\t" 260 ".set noat" "\n\t"
260 "mfc0 %[sr],$%[c0_status]" "\n\t" 261 "mfc0 %[sr],$%[c0_status]" "\n\t"
261 "and %[sr],%[mask]" "\n\t" 262 "and %[sr],%[mask]" "\n\t"
262 "or %[sr],%[ocu]" "\n\t" 263 "or %[sr],%[ocu]" "\n\t"
263 "mtc0 %[sr],$%[c0_status]" "\n\t" 264 "mtc0 %[sr],$%[c0_status]" "\n\t"
264 ".set pop" "\n\t" 265 ".set pop" "\n\t"
265 : [sr] "=r"(cu2) 266 : [sr] "=r"(cu2)
266 : [c0_status] "n" (MIPS_COP_0_STATUS), 267 : [c0_status] "n" (MIPS_COP_0_STATUS),
267 [mask] "r" (~MIPS_SR_COP_2_BIT), 268 [mask] "r" (~MIPS_SR_COP_2_BIT),
268 [ocu] "r" (ocu)); 269 [ocu] "r" (ocu));
269} 270}
270 271
271#ifdef MIPS64_XLP 272#ifdef MIPS64_XLP
272/* 273/*
273 * logical station IDs for RMI XLP 274 * logical station IDs for RMI XLP
274 */ 275 */
275#define RMIXLP_FMN_STID_RESERVED 0 276#define RMIXLP_FMN_STID_RESERVED 0
276#define RMIXLP_FMN_STID_CPU 1  277#define RMIXLP_FMN_STID_CPU 1
277#define RMIXLP_FMN_STID_POPQ 2 278#define RMIXLP_FMN_STID_POPQ 2
278#define RMIXLP_FMN_STID_PCIE0 3 279#define RMIXLP_FMN_STID_PCIE0 3
279#define RMIXLP_FMN_STID_PCIE1 4 280#define RMIXLP_FMN_STID_PCIE1 4
280#define RMIXLP_FMN_STID_PCIE2 5 281#define RMIXLP_FMN_STID_PCIE2 5
281#define RMIXLP_FMN_STID_PCIE3 6 282#define RMIXLP_FMN_STID_PCIE3 6
282#define RMIXLP_FMN_STID_DMA 7 283#define RMIXLP_FMN_STID_DMA 7
283#define RMIXLP_FMN_STID_PKE 8 284#define RMIXLP_FMN_STID_PKE 8
284#define RMIXLP_FMN_STID_SAE 9 285#define RMIXLP_FMN_STID_SAE 9
285#define RMIXLP_FMN_STID_CDE 10 286#define RMIXLP_FMN_STID_CDE 10
286#define RMIXLP_FMN_STID_POE 11 287#define RMIXLP_FMN_STID_POE 11
287#define RMIXLP_FMN_STID_NAE 12 // NAE Egress 288#define RMIXLP_FMN_STID_NAE 12 // NAE Egress
288#define RMIXLP_FMN_STID_RXE 13 289#define RMIXLP_FMN_STID_RXE 13
289#define RMIXLP_FMN_STID_SRIO 14 290#define RMIXLP_FMN_STID_SRIO 14
290#define RMIXLP_FMN_STID_FMN 15 291#define RMIXLP_FMN_STID_FMN 15
291#define RMIXLP_FMN_STID_NAE_FREEIN 16 292#define RMIXLP_FMN_STID_NAE_FREEIN 16
292#define RMIXLP_FMN_NSTID 17 293#define RMIXLP_FMN_NSTID 17
293#else 294#else
294#define RMIXLP_FMN_NSTID 0 295#define RMIXLP_FMN_NSTID 0
295#endif 296#endif
296 297
297#ifdef MIPS64_XLS 298#ifdef MIPS64_XLS
298/* 299/*
299 * logical station IDs for RMI XLR 300 * logical station IDs for RMI XLR
300 * see Table 13.2 "Addressable Buckets" in the XLR PRM 301 * see Table 13.2 "Addressable Buckets" in the XLR PRM
301 */ 302 */
302#define RMIXLR_FMN_STID_RESERVED 0 303#define RMIXLR_FMN_STID_RESERVED 0
303#define RMIXLR_FMN_STID_CORE0 1 304#define RMIXLR_FMN_STID_CORE0 1
304#define RMIXLR_FMN_STID_CORE1 2 305#define RMIXLR_FMN_STID_CORE1 2
305#define RMIXLR_FMN_STID_CORE2 3 306#define RMIXLR_FMN_STID_CORE2 3
306#define RMIXLR_FMN_STID_CORE3 4 307#define RMIXLR_FMN_STID_CORE3 4
307#define RMIXLR_FMN_STID_CORE4 5 308#define RMIXLR_FMN_STID_CORE4 5
308#define RMIXLR_FMN_STID_CORE5 6 309#define RMIXLR_FMN_STID_CORE5 6
309#define RMIXLR_FMN_STID_CORE6 7 310#define RMIXLR_FMN_STID_CORE6 7
310#define RMIXLR_FMN_STID_CORE7 8 311#define RMIXLR_FMN_STID_CORE7 8
311#define RMIXLR_FMN_STID_TXRX_0 9 312#define RMIXLR_FMN_STID_TXRX_0 9
312#define RMIXLR_FMN_STID_TXRX_1 10 313#define RMIXLR_FMN_STID_TXRX_1 10
313#define RMIXLR_FMN_STID_RGMII 11 314#define RMIXLR_FMN_STID_RGMII 11
314#define RMIXLR_FMN_STID_DMA 12 315#define RMIXLR_FMN_STID_DMA 12
315#define RMIXLR_FMN_STID_FREE_0 13 316#define RMIXLR_FMN_STID_FREE_0 13
316#define RMIXLR_FMN_STID_FREE_1 14 317#define RMIXLR_FMN_STID_FREE_1 14
317#define RMIXLR_FMN_STID_SAE 15 318#define RMIXLR_FMN_STID_SAE 15
318#define RMIXLR_FMN_NSTID (RMIXLR_FMN_STID_SAE+1) 319#define RMIXLR_FMN_NSTID (RMIXLR_FMN_STID_SAE+1)
319#else 320#else
320#define RMIXLR_FMN_NSTID 0 321#define RMIXLR_FMN_NSTID 0
321#endif 322#endif
322 323
323#ifdef MIPS64_XLR 324#ifdef MIPS64_XLR
324/* 325/*
325 * logical station IDs for RMI XLS 326 * logical station IDs for RMI XLS
326 * see Table 12.1 "Stations and Addressable Buckets ..." in the XLS PRM 327 * see Table 12.1 "Stations and Addressable Buckets ..." in the XLS PRM
327 */ 328 */
328#define RMIXLS_FMN_STID_RESERVED 0 329#define RMIXLS_FMN_STID_RESERVED 0
329#define RMIXLS_FMN_STID_CORE0 1 330#define RMIXLS_FMN_STID_CORE0 1
330#define RMIXLS_FMN_STID_CORE1 2 331#define RMIXLS_FMN_STID_CORE1 2
331#define RMIXLS_FMN_STID_CORE2 3 332#define RMIXLS_FMN_STID_CORE2 3
332#define RMIXLS_FMN_STID_CORE3 4 333#define RMIXLS_FMN_STID_CORE3 4
333#define RMIXLS_FMN_STID_GMAC_Q0 5 334#define RMIXLS_FMN_STID_GMAC_Q0 5
334#define RMIXLS_FMN_STID_GMAC_Q1 6 335#define RMIXLS_FMN_STID_GMAC_Q1 6
335#define RMIXLS_FMN_STID_DMA 7 336#define RMIXLS_FMN_STID_DMA 7
336#define RMIXLS_FMN_STID_CDE 8 337#define RMIXLS_FMN_STID_CDE 8
337#define RMIXLS_FMN_STID_PCIE 9 338#define RMIXLS_FMN_STID_PCIE 9
338#define RMIXLS_FMN_STID_SAE 10 339#define RMIXLS_FMN_STID_SAE 10
339#define RMIXLS_FMN_NSTID (RMIXLS_FMN_STID_SAE+1) 340#define RMIXLS_FMN_NSTID (RMIXLS_FMN_STID_SAE+1)
340#else 341#else
341#define RMIXLS_FMN_NSTID 0 342#define RMIXLS_FMN_NSTID 0
342#endif 343#endif
343 344
344#define RMIXL_FMN_NSTID \ 345#define RMIXL_FMN_NSTID \
345 MAX(MAX(RMIXLR_FMN_NSTID, RMIXLS_FMN_NSTID), RMIXLP_FMN_NSTID) 346 MAX(MAX(RMIXLR_FMN_NSTID, RMIXLS_FMN_NSTID), RMIXLP_FMN_NSTID)
346 347
347typedef int (*rmixl_fmn_intr_handler_t)(void *, rmixl_fmn_rxmsg_t *); 348typedef int (*rmixl_fmn_intr_handler_t)(void *, rmixl_fmn_rxmsg_t *);
348 349
 350void rmixl_fmn_cpu_attach(struct cpu_info *ci);
349void rmixl_fmn_init(void); 351void rmixl_fmn_init(void);
350void rmixl_fmn_init_thread(void); 352void rmixl_fmn_init_thread(void);
351void * rmixl_fmn_intr_establish(size_t, rmixl_fmn_intr_handler_t, void *); 353void * rmixl_fmn_intr_establish(size_t, rmixl_fmn_intr_handler_t, void *);
352void rmixl_fmn_intr_disestablish(void *); 354void rmixl_fmn_intr_disestablish(void *);
353void rmixl_fmn_intr_poll(u_int, rmixl_fmn_rxmsg_t *); 355void rmixl_fmn_intr_poll(u_int, rmixl_fmn_rxmsg_t *);
 356
 357size_t rmixl_fmn_qid_to_stid(size_t);
 358const char *
 359 rmixl_fmn_stid_name(size_t);
 360
354/* 361/*
355 * true == succes, false = failure 362 * true == succes, false = failure
356 */ 363 */
357bool rmixl_fmn_msg_send(u_int, u_int, u_int, u_int, const rmixl_fmn_msg_t *); 364bool rmixl_fmn_msg_send(u_int, u_int, u_int, u_int, const rmixl_fmn_msg_t *);
358bool rmixl_fmn_msg_recv(u_int, rmixl_fmn_rxmsg_t *); 365bool rmixl_fmn_msg_recv(u_int, rmixl_fmn_rxmsg_t *);
359 366
360#endif /* _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ */ 367#endif /* _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ */