~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/asm-ia64/sn/xtalk/xtalk.h

Version: ~ [ linux-5.1-rc1 ] ~ [ linux-5.0.2 ] ~ [ linux-4.20.16 ] ~ [ linux-4.19.29 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.106 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.163 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.176 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.136 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* $Id$
  2  *
  3  * This file is subject to the terms and conditions of the GNU General Public
  4  * License.  See the file "COPYING" in the main directory of this archive
  5  * for more details.
  6  *
  7  * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  8  */
  9 #ifndef _ASM_SN_XTALK_XTALK_H
 10 #define _ASM_SN_XTALK_XTALK_H
 11 #include <linux/config.h>
 12 
 13 #include "asm/sn/sgi.h"
 14 
 15 
 16 /*
 17  * xtalk.h -- platform-independent crosstalk interface
 18  */
 19 /*
 20  * User-level device driver visible types
 21  */
 22 typedef int            xwidgetnum_t;    /* xtalk widget number  (0..15) */
 23 
 24 #define XWIDGET_NONE            (-1)
 25 
 26 typedef int xwidget_part_num_t; /* xtalk widget part number */
 27 
 28 #define XWIDGET_PART_NUM_NONE   (-1)
 29 
 30 typedef int             xwidget_rev_num_t;      /* xtalk widget revision number */
 31 
 32 #define XWIDGET_REV_NUM_NONE    (-1)
 33 
 34 typedef int xwidget_mfg_num_t;  /* xtalk widget manufacturing ID */
 35 
 36 #define XWIDGET_MFG_NUM_NONE    (-1)
 37 
 38 typedef struct xtalk_piomap_s *xtalk_piomap_t;
 39 
 40 /* It is often convenient to fold the XIO target port
 41  * number into the XIO address.
 42  */
 43 #define XIO_NOWHERE     (0xFFFFFFFFFFFFFFFFull)
 44 #define XIO_ADDR_BITS   (0x0000FFFFFFFFFFFFull)
 45 #define XIO_PORT_BITS   (0xF000000000000000ull)
 46 #define XIO_PORT_SHIFT  (60)
 47 
 48 #define XIO_PACKED(x)   (((x)&XIO_PORT_BITS) != 0)
 49 #define XIO_ADDR(x)     ((x)&XIO_ADDR_BITS)
 50 #define XIO_PORT(x)     ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
 51 #define XIO_PACK(p,o)   ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))
 52 
 53 
 54 /*
 55  * Kernel/driver only definitions
 56  */
 57 #if __KERNEL__
 58 
 59 #include <asm/types.h>
 60 #include <asm/sn/types.h>
 61 #include <asm/sn/alenlist.h>
 62 #include <asm/sn/ioerror.h>
 63 #include <asm/sn/driver.h>
 64 #include <asm/sn/dmamap.h>
 65 
 66 struct xwidget_hwid_s;
 67 
 68 /*
 69  *    Acceptable flag bits for xtalk service calls
 70  *
 71  * XTALK_FIXED: require that mappings be established
 72  *      using fixed sharable resources; address
 73  *      translation results will be permanently
 74  *      available. (PIOMAP_FIXED and DMAMAP_FIXED are
 75  *      the same numeric value and are acceptable).
 76  * XTALK_NOSLEEP: if any part of the operation would
 77  *      sleep waiting for resoruces, return an error
 78  *      instead. (PIOMAP_NOSLEEP and DMAMAP_NOSLEEP are
 79  *      the same numeric value and are acceptable).
 80  * XTALK_INPLACE: when operating on alenlist structures,
 81  *      reuse the source alenlist rather than creating a
 82  *      new one. (PIOMAP_INPLACE and DMAMAP_INPLACE are
 83  *      the same numeric value and are acceptable).
 84  */
 85 #define XTALK_FIXED             DMAMAP_FIXED
 86 #define XTALK_NOSLEEP           DMAMAP_NOSLEEP
 87 #define XTALK_INPLACE           DMAMAP_INPLACE
 88 
 89 /* PIO MANAGEMENT */
 90 typedef xtalk_piomap_t
 91 xtalk_piomap_alloc_f    (vertex_hdl_t dev,      /* set up mapping for this device */
 92                          device_desc_t dev_desc,        /* device descriptor */
 93                          iopaddr_t xtalk_addr,  /* map for this xtalk_addr range */
 94                          size_t byte_count,
 95                          size_t byte_count_max,         /* maximum size of a mapping */
 96                          unsigned flags);       /* defined in sys/pio.h */
 97 typedef void
 98 xtalk_piomap_free_f     (xtalk_piomap_t xtalk_piomap);
 99 
100 typedef caddr_t
101 xtalk_piomap_addr_f     (xtalk_piomap_t xtalk_piomap,   /* mapping resources */
102                          iopaddr_t xtalk_addr,  /* map for this xtalk address */
103                          size_t byte_count);    /* map this many bytes */
104 
105 typedef void
106 xtalk_piomap_done_f     (xtalk_piomap_t xtalk_piomap);
107 
108 typedef caddr_t
109 xtalk_piotrans_addr_f   (vertex_hdl_t dev,      /* translate for this device */
110                          device_desc_t dev_desc,        /* device descriptor */
111                          iopaddr_t xtalk_addr,  /* Crosstalk address */
112                          size_t byte_count,     /* map this many bytes */
113                          unsigned flags);       /* (currently unused) */
114 
115 extern caddr_t
116 xtalk_pio_addr          (vertex_hdl_t dev,      /* translate for this device */
117                          device_desc_t dev_desc,        /* device descriptor */
118                          iopaddr_t xtalk_addr,  /* Crosstalk address */
119                          size_t byte_count,     /* map this many bytes */
120                          xtalk_piomap_t *xtalk_piomapp, /* RETURNS mapping resources */
121                          unsigned flags);       /* (currently unused) */
122 
123 /* DMA MANAGEMENT */
124 
125 typedef struct xtalk_dmamap_s *xtalk_dmamap_t;
126 
127 typedef xtalk_dmamap_t
128 xtalk_dmamap_alloc_f    (vertex_hdl_t dev,      /* set up mappings for this device */
129                          device_desc_t dev_desc,        /* device descriptor */
130                          size_t byte_count_max,         /* max size of a mapping */
131                          unsigned flags);       /* defined in dma.h */
132 
133 typedef void
134 xtalk_dmamap_free_f     (xtalk_dmamap_t dmamap);
135 
136 typedef iopaddr_t
137 xtalk_dmamap_addr_f     (xtalk_dmamap_t dmamap,         /* use these mapping resources */
138                          paddr_t paddr,         /* map for this address */
139                          size_t byte_count);    /* map this many bytes */
140 
141 typedef alenlist_t
142 xtalk_dmamap_list_f     (xtalk_dmamap_t dmamap,         /* use these mapping resources */
143                          alenlist_t alenlist,   /* map this address/length list */
144                          unsigned flags);
145 
146 typedef void
147 xtalk_dmamap_done_f     (xtalk_dmamap_t dmamap);
148 
149 typedef iopaddr_t
150 xtalk_dmatrans_addr_f   (vertex_hdl_t dev,      /* translate for this device */
151                          device_desc_t dev_desc,        /* device descriptor */
152                          paddr_t paddr,         /* system physical address */
153                          size_t byte_count,     /* length */
154                          unsigned flags);
155 
156 typedef alenlist_t
157 xtalk_dmatrans_list_f   (vertex_hdl_t dev,      /* translate for this device */
158                          device_desc_t dev_desc,        /* device descriptor */
159                          alenlist_t palenlist,  /* system address/length list */
160                          unsigned flags);
161 
162 typedef void
163 xtalk_dmamap_drain_f    (xtalk_dmamap_t map);   /* drain this map's channel */
164 
165 typedef void
166 xtalk_dmaaddr_drain_f   (vertex_hdl_t vhdl,     /* drain channel from this device */
167                          paddr_t addr,          /* to this physical address */
168                          size_t bytes);         /* for this many bytes */
169 
170 typedef void
171 xtalk_dmalist_drain_f   (vertex_hdl_t vhdl,     /* drain channel from this device */
172                          alenlist_t list);      /* for this set of physical blocks */
173 
174 
175 /* INTERRUPT MANAGEMENT */
176 
177 /*
178  * A xtalk interrupt resource handle.  When resources are allocated
179  * in order to satisfy a xtalk_intr_alloc request, a xtalk_intr handle
180  * is returned.  xtalk_intr_connect associates a software handler with
181 
182  * these system resources.
183  */
184 typedef struct xtalk_intr_s *xtalk_intr_t;
185 
186 
187 /*
188  * When a crosstalk device connects an interrupt, it passes in a function
189  * that knows how to set its xtalk interrupt register appropriately.  The
190  * low-level interrupt code may invoke this function later in order to
191  * migrate an interrupt transparently to the device driver(s) that use this
192  * interrupt.
193  *
194  * The argument passed to this function contains enough information for a
195  * crosstalk device to (re-)target an interrupt.  A function of this type
196  * must be supplied by every crosstalk driver.
197  */
198 typedef int
199 xtalk_intr_setfunc_f    (xtalk_intr_t intr_hdl);        /* interrupt handle */
200 
201 typedef xtalk_intr_t
202 xtalk_intr_alloc_f      (vertex_hdl_t dev,      /* which crosstalk device */
203                          device_desc_t dev_desc,        /* device descriptor */
204                          vertex_hdl_t owner_dev);       /* owner of this intr */
205 
206 typedef void
207 xtalk_intr_free_f       (xtalk_intr_t intr_hdl);
208 
209 typedef int
210 xtalk_intr_connect_f    (xtalk_intr_t intr_hdl,         /* xtalk intr resource handle */
211                         intr_func_t intr_func,         /* xtalk intr handler */
212                         void *intr_arg, /* arg to intr handler */
213                         xtalk_intr_setfunc_f *setfunc,          /* func to set intr hw */
214                         void *setfunc_arg);     /* arg to setfunc */
215 
216 typedef void
217 xtalk_intr_disconnect_f (xtalk_intr_t intr_hdl);
218 
219 typedef vertex_hdl_t
220 xtalk_intr_cpu_get_f    (xtalk_intr_t intr_hdl);        /* xtalk intr resource handle */
221 
222 /* CONFIGURATION MANAGEMENT */
223 
224 typedef void
225 xtalk_provider_startup_f (vertex_hdl_t xtalk_provider);
226 
227 typedef void
228 xtalk_provider_shutdown_f (vertex_hdl_t xtalk_provider);
229 
230 typedef void
231 xtalk_widgetdev_enable_f (vertex_hdl_t, int);
232 
233 typedef void
234 xtalk_widgetdev_shutdown_f (vertex_hdl_t, int);
235 
236 typedef int
237 xtalk_dma_enabled_f (vertex_hdl_t);
238 
239 /* Error Management */
240 
241 typedef int
242 xtalk_error_devenable_f (vertex_hdl_t xconn_vhdl,
243                          int devnum,
244                          int error_code);
245 
246 /* Early Action Support */
247 typedef caddr_t
248 xtalk_early_piotrans_addr_f (xwidget_part_num_t part_num,
249                              xwidget_mfg_num_t mfg_num,
250                              int which,
251                              iopaddr_t xtalk_addr,
252                              size_t byte_count,
253                              unsigned flags);
254 
255 /*
256  * Adapters that provide a crosstalk interface adhere to this software interface.
257  */
258 typedef struct xtalk_provider_s {
259     /* PIO MANAGEMENT */
260     xtalk_piomap_alloc_f   *piomap_alloc;
261     xtalk_piomap_free_f    *piomap_free;
262     xtalk_piomap_addr_f    *piomap_addr;
263     xtalk_piomap_done_f    *piomap_done;
264     xtalk_piotrans_addr_f  *piotrans_addr;
265 
266     /* DMA MANAGEMENT */
267     xtalk_dmamap_alloc_f   *dmamap_alloc;
268     xtalk_dmamap_free_f    *dmamap_free;
269     xtalk_dmamap_addr_f    *dmamap_addr;
270     xtalk_dmamap_list_f    *dmamap_list;
271     xtalk_dmamap_done_f    *dmamap_done;
272     xtalk_dmatrans_addr_f  *dmatrans_addr;
273     xtalk_dmatrans_list_f  *dmatrans_list;
274     xtalk_dmamap_drain_f   *dmamap_drain;
275     xtalk_dmaaddr_drain_f  *dmaaddr_drain;
276     xtalk_dmalist_drain_f  *dmalist_drain;
277 
278     /* INTERRUPT MANAGEMENT */
279     xtalk_intr_alloc_f     *intr_alloc;
280     xtalk_intr_alloc_f     *intr_alloc_nothd;
281     xtalk_intr_free_f      *intr_free;
282     xtalk_intr_connect_f   *intr_connect;
283     xtalk_intr_disconnect_f *intr_disconnect;
284 
285     /* CONFIGURATION MANAGEMENT */
286     xtalk_provider_startup_f *provider_startup;
287     xtalk_provider_shutdown_f *provider_shutdown;
288 
289     /* Error Management     */
290     xtalk_error_devenable_f *error_devenable;
291 } xtalk_provider_t;
292 
293 /* Crosstalk devices use these standard Crosstalk provider interfaces */
294 extern xtalk_piomap_alloc_f xtalk_piomap_alloc;
295 extern xtalk_piomap_free_f xtalk_piomap_free;
296 extern xtalk_piomap_addr_f xtalk_piomap_addr;
297 extern xtalk_piomap_done_f xtalk_piomap_done;
298 extern xtalk_piotrans_addr_f xtalk_piotrans_addr;
299 extern xtalk_dmamap_alloc_f xtalk_dmamap_alloc;
300 extern xtalk_dmamap_free_f xtalk_dmamap_free;
301 extern xtalk_dmamap_addr_f xtalk_dmamap_addr;
302 extern xtalk_dmamap_list_f xtalk_dmamap_list;
303 extern xtalk_dmamap_done_f xtalk_dmamap_done;
304 extern xtalk_dmatrans_addr_f xtalk_dmatrans_addr;
305 extern xtalk_dmatrans_list_f xtalk_dmatrans_list;
306 extern xtalk_dmamap_drain_f xtalk_dmamap_drain;
307 extern xtalk_dmaaddr_drain_f xtalk_dmaaddr_drain;
308 extern xtalk_dmalist_drain_f xtalk_dmalist_drain;
309 extern xtalk_intr_alloc_f xtalk_intr_alloc;
310 extern xtalk_intr_alloc_f xtalk_intr_alloc_nothd;
311 extern xtalk_intr_free_f xtalk_intr_free;
312 extern xtalk_intr_connect_f xtalk_intr_connect;
313 extern xtalk_intr_disconnect_f xtalk_intr_disconnect;
314 extern xtalk_intr_cpu_get_f xtalk_intr_cpu_get;
315 extern xtalk_provider_startup_f xtalk_provider_startup;
316 extern xtalk_provider_shutdown_f xtalk_provider_shutdown;
317 extern xtalk_widgetdev_enable_f xtalk_widgetdev_enable;
318 extern xtalk_widgetdev_shutdown_f xtalk_widgetdev_shutdown;
319 extern xtalk_dma_enabled_f xtalk_dma_enabled;
320 extern xtalk_error_devenable_f xtalk_error_devenable;
321 extern xtalk_early_piotrans_addr_f xtalk_early_piotrans_addr;
322 
323 /* error management */
324 
325 extern int              xtalk_error_handler(vertex_hdl_t,
326                                             int,
327                                             ioerror_mode_t,
328                                             ioerror_t *);
329 
330 /*
331  * Generic crosstalk interface, for use with all crosstalk providers
332  * and all crosstalk devices.
333  */
334 typedef unchar xtalk_intr_vector_t;     /* crosstalk interrupt vector (0..255) */
335 
336 #define XTALK_INTR_VECTOR_NONE  (xtalk_intr_vector_t)0
337 
338 /* Generic crosstalk interrupt interfaces */
339 extern vertex_hdl_t     xtalk_intr_dev_get(xtalk_intr_t xtalk_intr);
340 extern xwidgetnum_t     xtalk_intr_target_get(xtalk_intr_t xtalk_intr);
341 extern xtalk_intr_vector_t xtalk_intr_vector_get(xtalk_intr_t xtalk_intr);
342 extern iopaddr_t        xtalk_intr_addr_get(xtalk_intr_t xtalk_intr);
343 extern vertex_hdl_t     xtalk_intr_cpu_get(xtalk_intr_t xtalk_intr);
344 extern void            *xtalk_intr_sfarg_get(xtalk_intr_t xtalk_intr);
345 
346 /* Generic crosstalk pio interfaces */
347 extern vertex_hdl_t     xtalk_pio_dev_get(xtalk_piomap_t xtalk_piomap);
348 extern xwidgetnum_t     xtalk_pio_target_get(xtalk_piomap_t xtalk_piomap);
349 extern iopaddr_t        xtalk_pio_xtalk_addr_get(xtalk_piomap_t xtalk_piomap);
350 extern size_t           xtalk_pio_mapsz_get(xtalk_piomap_t xtalk_piomap);
351 extern caddr_t          xtalk_pio_kvaddr_get(xtalk_piomap_t xtalk_piomap);
352 
353 /* Generic crosstalk dma interfaces */
354 extern vertex_hdl_t     xtalk_dma_dev_get(xtalk_dmamap_t xtalk_dmamap);
355 extern xwidgetnum_t     xtalk_dma_target_get(xtalk_dmamap_t xtalk_dmamap);
356 
357 /* Register/unregister Crosstalk providers and get implementation handle */
358 extern void             xtalk_set_early_piotrans_addr(xtalk_early_piotrans_addr_f *);
359 extern void             xtalk_provider_register(vertex_hdl_t provider, xtalk_provider_t *xtalk_fns);
360 extern void             xtalk_provider_unregister(vertex_hdl_t provider);
361 extern xtalk_provider_t *xtalk_provider_fns_get(vertex_hdl_t provider);
362 
363 /* Crosstalk Switch generic layer, for use by initialization code */
364 extern void             xswitch_census(vertex_hdl_t xswitchv);
365 extern void             xswitch_init_widgets(vertex_hdl_t xswitchv);
366 
367 /* early init interrupt management */
368 
369 typedef void
370 xwidget_intr_preset_f   (void *which_widget,
371                          int which_widget_intr,
372                          xwidgetnum_t targ,
373                          iopaddr_t addr,
374                          xtalk_intr_vector_t vect);
375 
376 typedef void
377 xtalk_intr_prealloc_f   (void *which_xtalk,
378                          xtalk_intr_vector_t xtalk_vector,
379                          xwidget_intr_preset_f *preset_func,
380                          void *which_widget,
381                          int which_widget_intr);
382 
383 typedef void
384 xtalk_intr_preconn_f    (void *which_xtalk,
385                          xtalk_intr_vector_t xtalk_vector,
386                          intr_func_t intr_func,
387                          intr_arg_t intr_arg);
388 
389 
390 #define XTALK_ADDR_TO_UPPER(xtalk_addr) (((iopaddr_t)(xtalk_addr) >> 32) & 0xffff)
391 #define XTALK_ADDR_TO_LOWER(xtalk_addr) ((iopaddr_t)(xtalk_addr) & 0xffffffff)
392 
393 typedef xtalk_intr_setfunc_f *xtalk_intr_setfunc_t;
394 
395 typedef void            xtalk_iter_f(vertex_hdl_t vhdl);
396 
397 extern void             xtalk_iterate(char *prefix, xtalk_iter_f *func);
398 
399 #endif                          /* __KERNEL__ */
400 #endif                          /* _ASM_SN_XTALK_XTALK_H */
401 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp