aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/xtalk
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-mips/xtalk
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-mips/xtalk')
-rw-r--r--include/asm-mips/xtalk/xtalk.h52
-rw-r--r--include/asm-mips/xtalk/xwidget.h167
2 files changed, 219 insertions, 0 deletions
diff --git a/include/asm-mips/xtalk/xtalk.h b/include/asm-mips/xtalk/xtalk.h
new file mode 100644
index 000000000000..4a60f27c8817
--- /dev/null
+++ b/include/asm-mips/xtalk/xtalk.h
@@ -0,0 +1,52 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * xtalk.h -- platform-independent crosstalk interface, derived from
7 * IRIX <sys/PCI/bridge.h>, revision 1.38.
8 *
9 * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
10 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
11 */
12#ifndef _ASM_XTALK_XTALK_H
13#define _ASM_XTALK_XTALK_H
14
15#ifndef __ASSEMBLY__
16/*
17 * User-level device driver visible types
18 */
19typedef char xwidgetnum_t; /* xtalk widget number (0..15) */
20
21#define XWIDGET_NONE -1
22
23typedef int xwidget_part_num_t; /* xtalk widget part number */
24
25#define XWIDGET_PART_NUM_NONE -1
26
27typedef int xwidget_rev_num_t; /* xtalk widget revision number */
28
29#define XWIDGET_REV_NUM_NONE -1
30
31typedef int xwidget_mfg_num_t; /* xtalk widget manufacturing ID */
32
33#define XWIDGET_MFG_NUM_NONE -1
34
35typedef struct xtalk_piomap_s *xtalk_piomap_t;
36
37/* It is often convenient to fold the XIO target port
38 * number into the XIO address.
39 */
40#define XIO_NOWHERE (0xFFFFFFFFFFFFFFFFull)
41#define XIO_ADDR_BITS (0x0000FFFFFFFFFFFFull)
42#define XIO_PORT_BITS (0xF000000000000000ull)
43#define XIO_PORT_SHIFT (60)
44
45#define XIO_PACKED(x) (((x)&XIO_PORT_BITS) != 0)
46#define XIO_ADDR(x) ((x)&XIO_ADDR_BITS)
47#define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
48#define XIO_PACK(p,o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))
49
50#endif /* !__ASSEMBLY__ */
51
52#endif /* _ASM_XTALK_XTALK_H */
diff --git a/include/asm-mips/xtalk/xwidget.h b/include/asm-mips/xtalk/xwidget.h
new file mode 100644
index 000000000000..b4a13d7405ee
--- /dev/null
+++ b/include/asm-mips/xtalk/xwidget.h
@@ -0,0 +1,167 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * xwidget.h - generic crosstalk widget header file, derived from IRIX
7 * <sys/xtalk/xtalkwidget.h>, revision 1.32.
8 *
9 * Copyright (C) 1996, 1999 Silcon Graphics, Inc.
10 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
11 */
12#ifndef _ASM_XTALK_XWIDGET_H
13#define _ASM_XTALK_XWIDGET_H
14
15#include <linux/types.h>
16#include <asm/xtalk/xtalk.h>
17
18#define WIDGET_ID 0x04
19#define WIDGET_STATUS 0x0c
20#define WIDGET_ERR_UPPER_ADDR 0x14
21#define WIDGET_ERR_LOWER_ADDR 0x1c
22#define WIDGET_CONTROL 0x24
23#define WIDGET_REQ_TIMEOUT 0x2c
24#define WIDGET_INTDEST_UPPER_ADDR 0x34
25#define WIDGET_INTDEST_LOWER_ADDR 0x3c
26#define WIDGET_ERR_CMD_WORD 0x44
27#define WIDGET_LLP_CFG 0x4c
28#define WIDGET_TFLUSH 0x54
29
30/* WIDGET_ID */
31#define WIDGET_REV_NUM 0xf0000000
32#define WIDGET_PART_NUM 0x0ffff000
33#define WIDGET_MFG_NUM 0x00000ffe
34#define WIDGET_REV_NUM_SHFT 28
35#define WIDGET_PART_NUM_SHFT 12
36#define WIDGET_MFG_NUM_SHFT 1
37
38#define XWIDGET_PART_NUM(widgetid) (((widgetid) & WIDGET_PART_NUM) >> WIDGET_PART_NUM_SHFT)
39#define XWIDGET_REV_NUM(widgetid) (((widgetid) & WIDGET_REV_NUM) >> WIDGET_REV_NUM_SHFT)
40#define XWIDGET_MFG_NUM(widgetid) (((widgetid) & WIDGET_MFG_NUM) >> WIDGET_MFG_NUM_SHFT)
41
42/* WIDGET_STATUS */
43#define WIDGET_LLP_REC_CNT 0xff000000
44#define WIDGET_LLP_TX_CNT 0x00ff0000
45#define WIDGET_PENDING 0x0000001f
46
47/* WIDGET_ERR_UPPER_ADDR */
48#define WIDGET_ERR_UPPER_ADDR_ONLY 0x0000ffff
49
50/* WIDGET_CONTROL */
51#define WIDGET_F_BAD_PKT 0x00010000
52#define WIDGET_LLP_XBAR_CRD 0x0000f000
53#define WIDGET_LLP_XBAR_CRD_SHFT 12
54#define WIDGET_CLR_RLLP_CNT 0x00000800
55#define WIDGET_CLR_TLLP_CNT 0x00000400
56#define WIDGET_SYS_END 0x00000200
57#define WIDGET_MAX_TRANS 0x000001f0
58#define WIDGET_WIDGET_ID 0x0000000f
59
60/* WIDGET_INTDEST_UPPER_ADDR */
61#define WIDGET_INT_VECTOR 0xff000000
62#define WIDGET_INT_VECTOR_SHFT 24
63#define WIDGET_TARGET_ID 0x000f0000
64#define WIDGET_TARGET_ID_SHFT 16
65#define WIDGET_UPP_ADDR 0x0000ffff
66
67/* WIDGET_ERR_CMD_WORD */
68#define WIDGET_DIDN 0xf0000000
69#define WIDGET_SIDN 0x0f000000
70#define WIDGET_PACTYP 0x00f00000
71#define WIDGET_TNUM 0x000f8000
72#define WIDGET_COHERENT 0x00004000
73#define WIDGET_DS 0x00003000
74#define WIDGET_GBR 0x00000800
75#define WIDGET_VBPM 0x00000400
76#define WIDGET_ERROR 0x00000200
77#define WIDGET_BARRIER 0x00000100
78
79/* WIDGET_LLP_CFG */
80#define WIDGET_LLP_MAXRETRY 0x03ff0000
81#define WIDGET_LLP_MAXRETRY_SHFT 16
82#define WIDGET_LLP_NULLTIMEOUT 0x0000fc00
83#define WIDGET_LLP_NULLTIMEOUT_SHFT 10
84#define WIDGET_LLP_MAXBURST 0x000003ff
85#define WIDGET_LLP_MAXBURST_SHFT 0
86
87/*
88 * according to the crosstalk spec, only 32-bits access to the widget
89 * configuration registers is allowed. some widgets may allow 64-bits
90 * access but software should not depend on it. registers beyond the
91 * widget target flush register are widget dependent thus will not be
92 * defined here
93 */
94#ifndef __ASSEMBLY__
95typedef u32 widgetreg_t;
96
97/* widget configuration registers */
98typedef volatile struct widget_cfg {
99 widgetreg_t w_pad_0; /* 0x00 */
100 widgetreg_t w_id; /* 0x04 */
101 widgetreg_t w_pad_1; /* 0x08 */
102 widgetreg_t w_status; /* 0x0c */
103 widgetreg_t w_pad_2; /* 0x10 */
104 widgetreg_t w_err_upper_addr; /* 0x14 */
105 widgetreg_t w_pad_3; /* 0x18 */
106 widgetreg_t w_err_lower_addr; /* 0x1c */
107 widgetreg_t w_pad_4; /* 0x20 */
108 widgetreg_t w_control; /* 0x24 */
109 widgetreg_t w_pad_5; /* 0x28 */
110 widgetreg_t w_req_timeout; /* 0x2c */
111 widgetreg_t w_pad_6; /* 0x30 */
112 widgetreg_t w_intdest_upper_addr; /* 0x34 */
113 widgetreg_t w_pad_7; /* 0x38 */
114 widgetreg_t w_intdest_lower_addr; /* 0x3c */
115 widgetreg_t w_pad_8; /* 0x40 */
116 widgetreg_t w_err_cmd_word; /* 0x44 */
117 widgetreg_t w_pad_9; /* 0x48 */
118 widgetreg_t w_llp_cfg; /* 0x4c */
119 widgetreg_t w_pad_10; /* 0x50 */
120 widgetreg_t w_tflush; /* 0x54 */
121} widget_cfg_t;
122
123typedef struct {
124 unsigned didn:4;
125 unsigned sidn:4;
126 unsigned pactyp:4;
127 unsigned tnum:5;
128 unsigned ct:1;
129 unsigned ds:2;
130 unsigned gbr:1;
131 unsigned vbpm:1;
132 unsigned error:1;
133 unsigned bo:1;
134 unsigned other:8;
135} w_err_cmd_word_f;
136
137typedef union {
138 widgetreg_t r;
139 w_err_cmd_word_f f;
140} w_err_cmd_word_u;
141
142typedef struct xwidget_info_s *xwidget_info_t;
143
144/*
145 * Crosstalk Widget Hardware Identification, as defined in the Crosstalk spec.
146 */
147typedef struct xwidget_hwid_s {
148 xwidget_part_num_t part_num;
149 xwidget_rev_num_t rev_num;
150 xwidget_mfg_num_t mfg_num;
151} *xwidget_hwid_t;
152
153
154/*
155 * Returns 1 if a driver that handles devices described by hwid1 is able
156 * to manage a device with hardwareid hwid2. NOTE: We don't check rev
157 * numbers at all.
158 */
159#define XWIDGET_HARDWARE_ID_MATCH(hwid1, hwid2) \
160 (((hwid1)->part_num == (hwid2)->part_num) && \
161 (((hwid1)->mfg_num == XWIDGET_MFG_NUM_NONE) || \
162 ((hwid2)->mfg_num == XWIDGET_MFG_NUM_NONE) || \
163 ((hwid1)->mfg_num == (hwid2)->mfg_num)))
164
165#endif /* !__ASSEMBLY__ */
166
167#endif /* _ASM_XTALK_XWIDGET_H */