]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/firewire/nosy.h
firewire: new driver: nosy - IEEE 1394 traffic sniffer
[karo-tx-linux.git] / drivers / firewire / nosy.h
1 /* Chip register definitions for PCILynx chipset.  Based on pcilynx.h
2  * from the Linux 1394 drivers, but modified a bit so the names here
3  * match the specification exactly (even though they have weird names,
4  * like xxx_OVER_FLOW, or arbitrary abbreviations like SNTRJ for "sent
5  * reject" etc.)
6  */
7
8 #define PCILYNX_MAX_REGISTER     0xfff
9 #define PCILYNX_MAX_MEMORY       0xffff
10
11 #define PCI_LATENCY_CACHELINE             0x0c
12
13 #define MISC_CONTROL                      0x40
14 #define MISC_CONTROL_SWRESET              (1<<0)
15
16 #define SERIAL_EEPROM_CONTROL             0x44
17
18 #define PCI_INT_STATUS                    0x48
19 #define PCI_INT_ENABLE                    0x4c               
20 /* status and enable have identical bit numbers */
21 #define PCI_INT_INT_PEND                  (1<<31)
22 #define PCI_INT_FRC_INT                   (1<<30)
23 #define PCI_INT_SLV_ADR_PERR              (1<<28)
24 #define PCI_INT_SLV_DAT_PERR              (1<<27)
25 #define PCI_INT_MST_DAT_PERR              (1<<26)
26 #define PCI_INT_MST_DEV_TO                (1<<25)
27 #define PCI_INT_INT_SLV_TO                (1<<23)
28 #define PCI_INT_AUX_TO                    (1<<18)
29 #define PCI_INT_AUX_INT                   (1<<17)
30 #define PCI_INT_P1394_INT                 (1<<16)
31 #define PCI_INT_DMA4_PCL                  (1<<9)
32 #define PCI_INT_DMA4_HLT                  (1<<8)
33 #define PCI_INT_DMA3_PCL                  (1<<7)
34 #define PCI_INT_DMA3_HLT                  (1<<6)
35 #define PCI_INT_DMA2_PCL                  (1<<5)
36 #define PCI_INT_DMA2_HLT                  (1<<4)
37 #define PCI_INT_DMA1_PCL                  (1<<3)
38 #define PCI_INT_DMA1_HLT                  (1<<2)
39 #define PCI_INT_DMA0_PCL                  (1<<1)
40 #define PCI_INT_DMA0_HLT                  (1<<0)
41 /* all DMA interrupts combined: */
42 #define PCI_INT_DMA_ALL                   0x3ff
43
44 #define PCI_INT_DMA_HLT(chan)             (1 << (chan * 2))
45 #define PCI_INT_DMA_PCL(chan)             (1 << (chan * 2 + 1))
46
47 #define LBUS_ADDR                         0xb4
48 #define LBUS_ADDR_SEL_RAM                 (0x0<<16)
49 #define LBUS_ADDR_SEL_ROM                 (0x1<<16)
50 #define LBUS_ADDR_SEL_AUX                 (0x2<<16)
51 #define LBUS_ADDR_SEL_ZV                  (0x3<<16)       
52
53 #define GPIO_CTRL_A                       0xb8
54 #define GPIO_CTRL_B                       0xbc
55 #define GPIO_DATA_BASE                    0xc0
56
57 #define DMA_BREG(base, chan)              (base + chan * 0x20)
58 #define DMA_SREG(base, chan)              (base + chan * 0x10)
59
60 #define PCL_NEXT_INVALID (1<<0)
61
62 /* transfer commands */
63 #define PCL_CMD_RCV            (0x1<<24)
64 #define PCL_CMD_RCV_AND_UPDATE (0xa<<24)
65 #define PCL_CMD_XMT            (0x2<<24)
66 #define PCL_CMD_UNFXMT         (0xc<<24)
67 #define PCL_CMD_PCI_TO_LBUS    (0x8<<24)
68 #define PCL_CMD_LBUS_TO_PCI    (0x9<<24)
69
70 /* aux commands */
71 #define PCL_CMD_NOP            (0x0<<24)
72 #define PCL_CMD_LOAD           (0x3<<24)
73 #define PCL_CMD_STOREQ         (0x4<<24)
74 #define PCL_CMD_STORED         (0xb<<24)
75 #define PCL_CMD_STORE0         (0x5<<24)
76 #define PCL_CMD_STORE1         (0x6<<24)
77 #define PCL_CMD_COMPARE        (0xe<<24)
78 #define PCL_CMD_SWAP_COMPARE   (0xf<<24)
79 #define PCL_CMD_ADD            (0xd<<24)
80 #define PCL_CMD_BRANCH         (0x7<<24)
81
82 /* BRANCH condition codes */
83 #define PCL_COND_DMARDY_SET    (0x1<<20)
84 #define PCL_COND_DMARDY_CLEAR  (0x2<<20)
85
86 #define PCL_GEN_INTR           (1<<19)
87 #define PCL_LAST_BUFF          (1<<18)
88 #define PCL_LAST_CMD           (PCL_LAST_BUFF)
89 #define PCL_WAITSTAT           (1<<17)
90 #define PCL_BIGENDIAN          (1<<16)
91 #define PCL_ISOMODE            (1<<12)
92
93 #define DMA0_PREV_PCL                     0x100               
94 #define DMA1_PREV_PCL                     0x120
95 #define DMA2_PREV_PCL                     0x140
96 #define DMA3_PREV_PCL                     0x160
97 #define DMA4_PREV_PCL                     0x180
98 #define DMA_PREV_PCL(chan)                (DMA_BREG(DMA0_PREV_PCL, chan))
99
100 #define DMA0_CURRENT_PCL                  0x104            
101 #define DMA1_CURRENT_PCL                  0x124
102 #define DMA2_CURRENT_PCL                  0x144
103 #define DMA3_CURRENT_PCL                  0x164
104 #define DMA4_CURRENT_PCL                  0x184
105 #define DMA_CURRENT_PCL(chan)             (DMA_BREG(DMA0_CURRENT_PCL, chan))
106
107 #define DMA0_CHAN_STAT                    0x10c
108 #define DMA1_CHAN_STAT                    0x12c
109 #define DMA2_CHAN_STAT                    0x14c
110 #define DMA3_CHAN_STAT                    0x16c
111 #define DMA4_CHAN_STAT                    0x18c
112 #define DMA_CHAN_STAT(chan)               (DMA_BREG(DMA0_CHAN_STAT, chan))
113 /* CHAN_STATUS registers share bits */
114 #define DMA_CHAN_STAT_SELFID              (1<<31)
115 #define DMA_CHAN_STAT_ISOPKT              (1<<30)
116 #define DMA_CHAN_STAT_PCIERR              (1<<29)
117 #define DMA_CHAN_STAT_PKTERR              (1<<28)
118 #define DMA_CHAN_STAT_PKTCMPL             (1<<27)
119 #define DMA_CHAN_STAT_SPECIALACK          (1<<14)
120
121
122 #define DMA0_CHAN_CTRL                    0x110              
123 #define DMA1_CHAN_CTRL                    0x130
124 #define DMA2_CHAN_CTRL                    0x150
125 #define DMA3_CHAN_CTRL                    0x170
126 #define DMA4_CHAN_CTRL                    0x190
127 #define DMA_CHAN_CTRL(chan)               (DMA_BREG(DMA0_CHAN_CTRL, chan))
128 /* CHAN_CTRL registers share bits */
129 #define DMA_CHAN_CTRL_ENABLE              (1<<31)      
130 #define DMA_CHAN_CTRL_BUSY                (1<<30)
131 #define DMA_CHAN_CTRL_LINK                (1<<29)
132
133 #define DMA0_READY                        0x114
134 #define DMA1_READY                        0x134
135 #define DMA2_READY                        0x154
136 #define DMA3_READY                        0x174
137 #define DMA4_READY                        0x194
138 #define DMA_READY(chan)                   (DMA_BREG(DMA0_READY, chan))
139
140 #define DMA_GLOBAL_REGISTER               0x908
141
142 #define FIFO_SIZES                        0xa00
143
144 #define FIFO_CONTROL                      0xa10
145 #define FIFO_CONTROL_GRF_FLUSH            (1<<4)
146 #define FIFO_CONTROL_ITF_FLUSH            (1<<3)
147 #define FIFO_CONTROL_ATF_FLUSH            (1<<2)
148
149 #define FIFO_XMIT_THRESHOLD               0xa14
150
151 #define DMA0_WORD0_CMP_VALUE              0xb00
152 #define DMA1_WORD0_CMP_VALUE              0xb10
153 #define DMA2_WORD0_CMP_VALUE              0xb20
154 #define DMA3_WORD0_CMP_VALUE              0xb30
155 #define DMA4_WORD0_CMP_VALUE              0xb40
156 #define DMA_WORD0_CMP_VALUE(chan)         (DMA_SREG(DMA0_WORD0_CMP_VALUE, chan))
157
158 #define DMA0_WORD0_CMP_ENABLE             0xb04
159 #define DMA1_WORD0_CMP_ENABLE             0xb14
160 #define DMA2_WORD0_CMP_ENABLE             0xb24
161 #define DMA3_WORD0_CMP_ENABLE             0xb34
162 #define DMA4_WORD0_CMP_ENABLE             0xb44
163 #define DMA_WORD0_CMP_ENABLE(chan)        (DMA_SREG(DMA0_WORD0_CMP_ENABLE,chan))
164
165 #define DMA0_WORD1_CMP_VALUE              0xb08
166 #define DMA1_WORD1_CMP_VALUE              0xb18
167 #define DMA2_WORD1_CMP_VALUE              0xb28
168 #define DMA3_WORD1_CMP_VALUE              0xb38
169 #define DMA4_WORD1_CMP_VALUE              0xb48
170 #define DMA_WORD1_CMP_VALUE(chan)         (DMA_SREG(DMA0_WORD1_CMP_VALUE, chan))
171
172 #define DMA0_WORD1_CMP_ENABLE             0xb0c
173 #define DMA1_WORD1_CMP_ENABLE             0xb1c
174 #define DMA2_WORD1_CMP_ENABLE             0xb2c
175 #define DMA3_WORD1_CMP_ENABLE             0xb3c
176 #define DMA4_WORD1_CMP_ENABLE             0xb4c
177 #define DMA_WORD1_CMP_ENABLE(chan)        (DMA_SREG(DMA0_WORD1_CMP_ENABLE,chan))
178 /* word 1 compare enable flags */
179 #define DMA_WORD1_CMP_MATCH_OTHERBUS      (1<<15)
180 #define DMA_WORD1_CMP_MATCH_BROADCAST     (1<<14)
181 #define DMA_WORD1_CMP_MATCH_BUS_BCAST     (1<<13)
182 #define DMA_WORD1_CMP_MATCH_LOCAL_NODE    (1<<12)
183 #define DMA_WORD1_CMP_MATCH_EXACT         (1<<11)
184 #define DMA_WORD1_CMP_ENABLE_SELF_ID      (1<<10)
185 #define DMA_WORD1_CMP_ENABLE_MASTER       (1<<8)
186
187 #define LINK_ID                           0xf00
188 #define LINK_ID_BUS(id)                   (id<<22)
189 #define LINK_ID_NODE(id)                  (id<<16)
190
191 #define LINK_CONTROL                      0xf04
192 #define LINK_CONTROL_BUSY                 (1<<29)
193 #define LINK_CONTROL_TX_ISO_EN            (1<<26)
194 #define LINK_CONTROL_RX_ISO_EN            (1<<25)
195 #define LINK_CONTROL_TX_ASYNC_EN          (1<<24)
196 #define LINK_CONTROL_RX_ASYNC_EN          (1<<23)
197 #define LINK_CONTROL_RESET_TX             (1<<21)
198 #define LINK_CONTROL_RESET_RX             (1<<20)
199 #define LINK_CONTROL_CYCMASTER            (1<<11)
200 #define LINK_CONTROL_CYCSOURCE            (1<<10)
201 #define LINK_CONTROL_CYCTIMEREN           (1<<9)
202 #define LINK_CONTROL_RCV_CMP_VALID        (1<<7)
203 #define LINK_CONTROL_SNOOP_ENABLE         (1<<6)
204
205 #define CYCLE_TIMER                       0xf08
206
207 #define LINK_PHY                          0xf0c
208 #define LINK_PHY_READ                     (1<<31)
209 #define LINK_PHY_WRITE                    (1<<30)
210 #define LINK_PHY_ADDR(addr)               (addr<<24)
211 #define LINK_PHY_WDATA(data)              (data<<16)
212 #define LINK_PHY_RADDR(addr)              (addr<<8)
213
214
215 #define LINK_INT_STATUS                   0xf14
216 #define LINK_INT_ENABLE                   0xf18
217 /* status and enable have identical bit numbers */
218 #define LINK_INT_LINK_INT                 (1<<31)
219 #define LINK_INT_PHY_TIME_OUT             (1<<30)
220 #define LINK_INT_PHY_REG_RCVD             (1<<29)
221 #define LINK_INT_PHY_BUSRESET             (1<<28)
222 #define LINK_INT_TX_RDY                   (1<<26)
223 #define LINK_INT_RX_DATA_RDY              (1<<25)
224 #define LINK_INT_IT_STUCK                 (1<<20)
225 #define LINK_INT_AT_STUCK                 (1<<19)
226 #define LINK_INT_SNTRJ                    (1<<17)
227 #define LINK_INT_HDR_ERR                  (1<<16)
228 #define LINK_INT_TC_ERR                   (1<<15)
229 #define LINK_INT_CYC_SEC                  (1<<11)
230 #define LINK_INT_CYC_STRT                 (1<<10)
231 #define LINK_INT_CYC_DONE                 (1<<9)
232 #define LINK_INT_CYC_PEND                 (1<<8)
233 #define LINK_INT_CYC_LOST                 (1<<7)
234 #define LINK_INT_CYC_ARB_FAILED           (1<<6)
235 #define LINK_INT_GRF_OVER_FLOW            (1<<5)
236 #define LINK_INT_ITF_UNDER_FLOW           (1<<4)
237 #define LINK_INT_ATF_UNDER_FLOW           (1<<3)
238 #define LINK_INT_IARB_FAILED              (1<<0)