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_PCI_CVLINK_H
10 #define _ASM_SN_PCI_CVLINK_H
11 
12 #include <asm/sn/types.h>
13 #include <asm/sn/sgi.h>
14 #include <asm/sn/driver.h>
15 #include <asm/sn/iograph.h>
16 #include <asm/param.h>
17 #include <asm/sn/pio.h>
18 #include <asm/sn/xtalk/xwidget.h>
19 #include <asm/sn/sn_private.h>
20 #include <asm/sn/addrs.h>
21 #include <asm/sn/invent.h>
22 #include <asm/sn/hcl.h>
23 #include <asm/sn/hcl_util.h>
24 #include <asm/sn/intr.h>
25 #include <asm/sn/xtalk/xtalkaddrs.h>
26 #include <asm/sn/klconfig.h>
27 #include <asm/sn/io.h>
28 
29 #include <asm/sn/pci/pciio.h>
30 #include <asm/sn/pci/pcibr.h>
31 #include <asm/sn/pci/pcibr_private.h>
32 
33 #define MAX_PCI_XWIDGET 256
34 #define MAX_ATE_MAPS 1024
35 
36 #define SET_PCIA64(dev) \
37 	(((struct sn_device_sysdata *)((dev)->sysdata))->isa64) = 1
38 #define IS_PCIA64(dev)	(((dev)->dma_mask == 0xffffffffffffffffUL) || \
39 		(((struct sn_device_sysdata *)((dev)->sysdata))->isa64))
40 #define IS_PCI32G(dev)	((dev)->dma_mask >= 0xffffffff)
41 #define IS_PCI32L(dev)	((dev)->dma_mask < 0xffffffff)
42 
43 #define IS_PIC_DEVICE(dev) ((struct sn_device_sysdata *)dev->sysdata)->isPIC
44 
45 #define PCIDEV_VERTEX(pci_dev) \
46 	(((struct sn_device_sysdata *)((pci_dev)->sysdata))->vhdl)
47 
48 #define PCIBUS_VERTEX(pci_bus) \
49 	(((struct sn_widget_sysdata *)((pci_bus)->sysdata))->vhdl)
50 
51 struct sn_widget_sysdata {
52         vertex_hdl_t  vhdl;
53 };
54 
55 struct sn_device_sysdata {
56         vertex_hdl_t  vhdl;
57 	int		isa64;
58 	int		isPIC;
59 };
60 
61 struct sn_dma_maps_s{
62 	struct pcibr_dmamap_s dma_map;
63         dma_addr_t      dma_addr;
64 };
65 
66 struct ioports_to_tlbs_s {
67 	unsigned long	p:1,
68 			rv_1:1,
69 			ma:3,
70 			a:1,
71 			d:1,
72 			pl:2,
73 			ar:3,
74 			ppn:38,
75 			rv_2:2,
76 			ed:1,
77 			ig:11;
78 };
79 
80 #endif				/* _ASM_SN_PCI_CVLINK_H */
81