Home | History | Annotate | Line # | Download | only in ieee1394
fwohcireg.h revision 1.6
      1 /*	$NetBSD: fwohcireg.h,v 1.6 2001/03/03 02:04:55 onoe Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Matt Thomas of 3am Software Foundry.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *        This product includes software developed by the NetBSD
     21  *        Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 #ifndef _DEV_IEEE1394_FWOHCIREG_H_
     40 #define _DEV_IEEE1394_FWOHCIREG_H_
     41 
     42 /* PCI/CardBus-Specific definitions
     43  */
     44 
     45 /* In the PCI Class Code Register ...
     46  */
     47 #define	PCI_INTERFACE_OHCI		0x10
     48 
     49 /* The OHCI Regisers are in PCI BAR0.
     50  */
     51 #define	PCI_OHCI_MAP_REGISTER		0x10
     52 
     53 /* HCI Control Register (in PCI config space)
     54  */
     55 #define	PCI_OHCI_CONTROL_REGISTER	0x40
     56 
     57 /* If the following bit, all OHCI register access
     58  * and DMA transactions are byte swapped.
     59  */
     60 #define	PCI_GLOBAL_SWAP_BE		0x00000001
     61 
     62 /* Bus Independent Definitions */
     63 
     64 #define	OHCI_CONFIG_SIZE		1024
     65 #define	OHCI_CONFIG_ALIGNMENT		1024
     66 
     67 /* OHCI Registers
     68  * OHCI Registers are divided into four spaces:
     69  *   1) 0x000 .. 0x17C = Control register space
     70  *   2) 0x180 .. 0x1FC = Asynchronous DMA context register space
     71  *			 (4 contexts)
     72  *   3) 0x200 .. 0x3FC = Isochronous Transmit DMA context register space
     73  *			 (32 contexts)
     74  *   4) 0x400 .. 0x7FC = Isochronous Receive DMA context register space
     75  *			 (32 contexts)
     76  */
     77 #define	OHCI_REG_Version			0x000
     78 #define	OHCI_REG_Guid_Rom			0x004
     79 #define	OHCI_REG_ATRetries			0x008
     80 #define	OHCI_REG_CsrReadData			0x00c
     81 #define	OHCI_REG_CsrCompareData			0x010
     82 #define	OHCI_REG_CsrControl			0x014
     83 #define	OHCI_REG_ConfigROMhdr			0x018
     84 #define	OHCI_REG_BusId				0x01c
     85 #define	OHCI_REG_BusOptions			0x020
     86 #define	OHCI_REG_GUIDHi				0x024
     87 #define	OHCI_REG_GUIDLo				0x028
     88 #define	OHCI_REG_reserved_02c			0x02c
     89 #define	OHCI_REG_reserved_030			0x030
     90 #define	OHCI_REG_ConfigROMmap			0x034
     91 #define	OHCI_REG_PostedWriteAddressLo		0x038
     92 #define	OHCI_REG_PostedWriteAddressHi		0x03c
     93 #define	OHCI_REG_VendorId			0x040
     94 #define	OHCI_REG_reserved_044			0x044
     95 #define	OHCI_REG_reserved_048			0x048
     96 #define	OHCI_REG_reserved_04c			0x04c
     97 #define	OHCI_REG_HCControlSet			0x050
     98 #define	OHCI_REG_HCControlClear			0x054
     99 #define	OHCI_REG_reserved_058			0x058
    100 #define	OHCI_REG_reserved_05c			0x05c
    101 #define	OHCI_REG_reserved_060			0x060
    102 #define	OHCI_REG_SelfIDBuffer			0x064
    103 #define	OHCI_REG_SelfIDCount			0x068
    104 #define	OHCI_REG_reserved_06c			0x06c
    105 #define	OHCI_REG_IRMultiChanMaskHiSet		0x070
    106 #define	OHCI_REG_IRMultiChanMaskHiClear		0x074
    107 #define	OHCI_REG_IRMultiChanMaskLoSet		0x078
    108 #define	OHCI_REG_IRMultiChanMaskLoClear		0x07c
    109 #define	OHCI_REG_IntEventSet			0x080
    110 #define	OHCI_REG_IntEventClear			0x084
    111 #define	OHCI_REG_IntMaskSet			0x088
    112 #define	OHCI_REG_IntMaskClear			0x08c
    113 #define	OHCI_REG_IsoXmitIntEventSet		0x090
    114 #define	OHCI_REG_IsoXmitIntEventClear		0x094
    115 #define	OHCI_REG_IsoXmitIntMaskSet		0x098
    116 #define	OHCI_REG_IsoXmitIntMaskClear		0x09c
    117 #define	OHCI_REG_IsoRecvIntEventSet		0x0a0
    118 #define	OHCI_REG_IsoRecvIntEventClear		0x0a4
    119 #define	OHCI_REG_IsoRecvIntMaskSet		0x0a8
    120 #define	OHCI_REG_IsoRecvIntMaskClear		0x0ac
    121 #define	OHCI_REG_InitialBandwidthAvailable	0x0b0
    122 #define	OHCI_REG_InitialChannelsAvailableHi	0x0b4
    123 #define	OHCI_REG_InitialChannelsAvailableLo	0x0b8
    124 #define	OHCI_REG_reserved_0bc			0x0bc
    125 #define	OHCI_REG_reserved_0c0			0x0c0
    126 #define	OHCI_REG_reserved_0c4			0x0c4
    127 #define	OHCI_REG_reserved_0c8			0x0c8
    128 #define	OHCI_REG_reserved_0cc			0x0cc
    129 #define	OHCI_REG_reserved_0d0			0x0d0
    130 #define	OHCI_REG_reserved_0d4			0x0d4
    131 #define	OHCI_REG_reserved_0d8			0x0d8
    132 #define	OHCI_REG_FairnessConctrol		0x0dc
    133 #define	OHCI_REG_LinkControlSet			0x0e0
    134 #define	OHCI_REG_LinkControlClear		0x0e4
    135 #define	OHCI_REG_NodeId				0x0e8
    136 #define	OHCI_REG_PhyControl			0x0ec
    137 #define	OHCI_REG_IsochronousCycleTimer		0x0f0
    138 #define	OHCI_REG_reserved_0f0			0x0f4
    139 #define	OHCI_REG_reserved_0f8			0x0f8
    140 #define	OHCI_REG_reserved_0fc			0x0fc
    141 #define	OHCI_REG_AsynchronousRequestFilterHiSet	0x100
    142 #define	OHCI_REG_AsynchronousRequestFilterHiClear	0x104
    143 #define	OHCI_REG_AsynchronousRequestFilterLoSet	0x108
    144 #define	OHCI_REG_AsynchronousRequestFilterLoClear	0x10c
    145 #define	OHCI_REG_PhysicalRequestFilterHiSet	0x110
    146 #define	OHCI_REG_PhysicalRequestFilterHiClear	0x114
    147 #define	OHCI_REG_PhysicalRequestFilterLoSet	0x118
    148 #define	OHCI_REG_PhysicalRequestFilterLoCLear	0x11c
    149 #define	OHCI_REG_PhysicalUpperBound		0x120
    150 #define	OHCI_REG_reserved_124			0x124
    151 #define	OHCI_REG_reserved_128			0x128
    152 #define	OHCI_REG_reserved_12c			0x12c
    153 #define	OHCI_REG_reserved_130			0x130
    154 #define	OHCI_REG_reserved_134			0x134
    155 #define	OHCI_REG_reserved_138			0x138
    156 #define	OHCI_REG_reserved_13c			0x13c
    157 #define	OHCI_REG_reserved_140			0x140
    158 #define	OHCI_REG_reserved_144			0x144
    159 #define	OHCI_REG_reserved_148			0x148
    160 #define	OHCI_REG_reserved_14c			0x14c
    161 #define	OHCI_REG_reserved_150			0x150
    162 #define	OHCI_REG_reserved_154			0x154
    163 #define	OHCI_REG_reserved_158			0x158
    164 #define	OHCI_REG_reserved_15c			0x15c
    165 #define	OHCI_REG_reserved_160			0x160
    166 #define	OHCI_REG_reserved_164			0x164
    167 #define	OHCI_REG_reserved_168			0x168
    168 #define	OHCI_REG_reserved_16c			0x16c
    169 #define	OHCI_REG_reserved_170			0x170
    170 #define	OHCI_REG_reserved_174			0x174
    171 #define	OHCI_REG_reserved_178			0x178
    172 #define	OHCI_REG_reserved_17c			0x17c
    173 
    174 
    175 #define	OHCI_REG_ASYNC_DMA_BASE			0x180
    176 #define	OHCI_CTX_ASYNC_TX_REQUEST		0
    177 #define	OHCI_CTX_ASYNC_TX_RESPONSE		1
    178 #define	OHCI_CTX_ASYNC_RX_REQUEST		2
    179 #define	OHCI_CTX_ASYNC_RX_RESPONSE		3
    180 #define	OHCI_SUBREG_ContextControlSet		0x000
    181 #define	OHCI_SUBREG_ContextControlClear		0x004
    182 #define	OHCI_SUBREG_reserved_008		0x008
    183 #define	OHCI_SUBREG_CommandPtr			0x00c
    184 #define	OHCI_SUBREG_ContextMatch		0x010
    185 #define	OHCI_SUBREG_reserved_014		0x014
    186 #define	OHCI_SUBREG_reserved_018		0x018
    187 #define	OHCI_SUBREG_reserved_01c		0x01c
    188 #define	OHCI_ASYNC_DMA_WRITE(sc, ctx, reg, val) \
    189 	OHCI_CSR_WRITE(sc, OHCI_REG_ASYNC_DMA_BASE + 32*(ctx) + (reg), val)
    190 #define	OHCI_ASYNC_DMA_READ(sc, ctx, reg) \
    191 	OHCI_CSR_READ(sc, OHCI_REG_ASYNC_DMA_BASE + 32*(ctx) + (reg))
    192 
    193 #define	OHCI_REG_SYNC_TX_DMA_BASE		0x200
    194 #define	OHCI_SYNC_TX_DMA_WRITE(sc, ctx, reg, val) \
    195 	OHCI_CSR_WRITE(sc, OHCI_REG_SYNC_TX_DMA_BASE + 16*(ctx) + (reg), val)
    196 #define	OHCI_SYNC_TX_DMA_READ(sc, ctx, reg) \
    197 	OHCI_CSR_READ(sc, OHCI_REG_SYNC_TX_DMA_BASE + 16*(ctx) + (reg))
    198 
    199 #define	OHCI_REG_SYNC_RX_DMA_BASE	0x400
    200 #define	OHCI_SYNC_RX_DMA_WRITE(sc, ctx, reg, val) \
    201 	OHCI_CSR_WRITE(sc, OHCI_REG_SYNC_RX_DMA_BASE + 32*(ctx) + (reg), val)
    202 #define	OHCI_SYNC_RX_DMA_READ(sc, ctx, reg) \
    203 	OHCI_CSR_READ(sc, OHCI_REG_SYNC_RX_DMA_BASE + 32*(ctx) + (reg))
    204 
    205 /* OHCI_REG_Version
    206  */
    207 #define	OHCI_Version_GUID_ROM		0x01000000
    208 #define	OHCI_Version_GET_Version(x)	((((x) >> 16) & 0xf) + (((x) >> 20) & 0xf) * 10)
    209 #define	OHCI_Version_GET_Revision(x)	((((x) >> 4) & 0xf) + ((x) & 0xf) * 10)
    210 
    211 /* OHCI_REG_Guid_Rom
    212  */
    213 #define	OHCI_Guid_AddrReset		0x80000000
    214 #define	OHCI_Guid_RdStart		0x02000000
    215 #define	OHCI_Guid_RdData_MASK		0x00ff0000
    216 #define	OHCI_Guid_RdData_BITPOS		16
    217 #define	OHCI_Guid_MiniROM_MASK		0x000000ff
    218 #define	OHCI_Guid_MiniROM_BITPOS	0
    219 
    220 /* OHCI_REG_GUIDxx
    221  */
    222 
    223 /* OHCI_REG_CsrControl
    224  */
    225 #define	OHCI_CsrControl_Done		0x80000000
    226 #define	OHCI_CsrControl_SelMASK		0x00000003
    227 #define	OHCI_CsrControl_BusManId		0
    228 #define	OHCI_CsrControl_BWAvail			1
    229 #define	OHCI_CsrControl_ChanAvailHi		2
    230 #define	OHCI_CsrControl_ChanAvailLo		3
    231 
    232 /* OHCI_REG_BusOptions
    233  */
    234 #define	OHCI_BusOptions_LinkSpd_MASK	0x00000007
    235 #define	OHCI_BusOptions_LinkSpd_BITPOS	0
    236 #define	OHCI_BusOptions_G_MASK		0x000000c0
    237 #define	OHCI_BusOptions_G_BITPOS	6
    238 #define	OHCI_BusOptions_MaxRec_MASK	0x0000f000
    239 #define	OHCI_BusOptions_MaxRec_BITPOS	12
    240 #define	OHCI_BusOptions_CycClkAcc_MASK	0x00ff0000
    241 #define	OHCI_BusOptions_CycClkAcc_BITPOS 16
    242 #define	OHCI_BusOptions_PMC		0x08000000
    243 #define	OHCI_BusOptions_BMC		0x10000000
    244 #define	OHCI_BusOptions_ISC		0x20000000
    245 #define	OHCI_BusOptions_CMC		0x40000000
    246 #define	OHCI_BusOptions_IRMC		0x80000000
    247 #define	OHCI_BusOptions_reserved	0x07000f38
    248 
    249 /* OHCI_REG_HCControl
    250  */
    251 
    252 #define	OHCI_HCControl_SoftReset	0x00010000
    253 #define	OHCI_HCControl_LinkEnable	0x00020000
    254 #define	OHCI_HCControl_PostedWriteEnable 0x00040000
    255 #define	OHCI_HCControl_LPS		0x00080000
    256 #define	OHCI_HCControl_APhyEnhanceEnable 0x00400000
    257 #define	OHCI_HCControl_ProgramPhyEnable	0x00800000
    258 #define	OHCI_HCControl_NoByteSwapData	0x40000000
    259 #define	OHCI_HCControl_BIBImageValid	0x80000000
    260 
    261 /* OHCI_REG_SelfID
    262  */
    263 #define	OHCI_SelfID_Error		0x80000000
    264 #define	OHCI_SelfID_Gen_MASK		0x00ff0000
    265 #define	OHCI_SelfID_Gen_BITPOS		16
    266 #define	OHCI_SelfID_Size_MASK		0x000007fc
    267 #define	OHCI_SelfID_Size_BITPOS		2
    268 
    269 /* OCHI_REG_Int{Event|Mask}*
    270  */
    271 #define	OHCI_Int_MasterEnable		0x80000000
    272 #define	OHCI_Int_VendorSpecific		0x40000000
    273 #define	OHCI_Int_SoftInterrupt		0x20000000
    274 #define	OHCI_Int_Ack_Tardy		0x08000000
    275 #define	OHCI_Int_PhyRegRcvd		0x04000000
    276 #define	OHCI_Int_CycleTooLong		0x02000000
    277 #define	OHCI_Int_UnrecoverableError	0x01000000
    278 #define	OHCI_Int_CycleInconsistent	0x00800000
    279 #define	OHCI_Int_CycleLost		0x00400000
    280 #define	OHCI_Int_Cycle64Seconds		0x00200000
    281 #define	OHCI_Int_CycleSynch		0x00100000
    282 #define	OHCI_Int_Phy			0x00080000
    283 #define	OHCI_Int_RegAccessFail		0x00040000
    284 #define	OHCI_Int_BusReset		0x00020000
    285 #define	OHCI_Int_SelfIDComplete		0x00010000
    286 #define	OHCI_Int_SelfIDCOmplete2	0x00008000
    287 #define	OHCI_Int_LockRespErr		0x00000200
    288 #define	OHCI_Int_PostedWriteErr		0x00000100
    289 #define	OHCI_Int_IsochRx		0x00000080
    290 #define	OHCI_Int_IsochTx		0x00000040
    291 #define	OHCI_Int_RSPkt			0x00000020
    292 #define	OHCI_Int_RQPkt			0x00000010
    293 #define	OHCI_Int_ARRS			0x00000008
    294 #define	OHCI_Int_ARRQ			0x00000004
    295 #define	OHCI_Int_RespTxComplete		0x00000002
    296 #define	OHCI_Int_ReqTxComplete		0x00000001
    297 
    298 /* OHCI_REG_LinkControl
    299  */
    300 #define	OHCI_LinkControl_CycleSource	0x00400000
    301 #define	OHCI_LinkControl_CycleMaster	0x00200000
    302 #define	OHCI_LinkControl_CycleTimerEnable 0x00100000
    303 #define	OHCI_LinkControl_RcvPhyPkt	0x00000400
    304 #define	OHCI_LinkControl_RcvSelfID	0x00000200
    305 #define	OHCI_LinkControl_Tag1SyncFilterLock 0x00000040
    306 
    307 /* OHCI_REG_NodeId
    308  */
    309 #define	OHCI_NodeId_IDValid		0x80000000
    310 #define	OHCI_NodeId_ROOT		0x40000000
    311 #define	OHCI_NodeId_CPS			0x08000000
    312 #define	OHCI_NodeId_BusNumber		0x0000ffc0
    313 #define	OHCI_NodeId_NodeNumber		0x0000003f
    314 
    315 /* OHCI_REG_PhyControl
    316  */
    317 #define	OHCI_PhyControl_RdDone		0x80000000
    318 #define	OHCI_PhyControl_RdAddr		0x0f000000
    319 #define	OHCI_PhyControl_RdAddr_BITPOS	24
    320 #define	OHCI_PhyControl_RdData		0x00ff0000
    321 #define	OHCI_PhyControl_RdData_BITPOS	16
    322 #define	OHCI_PhyControl_RdReg		0x00008000
    323 #define	OHCI_PhyControl_WrReg		0x00004000
    324 #define	OHCI_PhyControl_RegAddr		0x00000f00
    325 #define	OHCI_PhyControl_RegAddr_BITPOS	8
    326 #define	OHCI_PhyControl_WrData		0x000000ff
    327 #define	OHCI_PhyControl_WrData_BITPOS	0
    328 
    329 /*
    330  * Section 3.1.1: ContextControl register
    331  *
    332  *
    333  */
    334 #define	OHCI_CTXCTL_RUN			0x00008000
    335 #define	OHCI_CTXCTL_WAKE		0x00001000
    336 #define	OHCI_CTXCTL_DEAD		0x00000800
    337 #define	OHCI_CTXCTL_ACTIVE		0x00000400
    338 
    339 #define	OHCI_CTXCTL_SPD_BITLEN		3
    340 #define	OHCI_CTXCTL_SPD_BITPOS		5
    341 
    342 #define	OHCI_CTXCTL_SPD_100		0
    343 #define	OHCI_CTXCTL_SPD_200		1
    344 #define	OHCI_CTXCTL_SPD_400		2
    345 
    346 #define	OHCI_CTXCTL_EVENT_BITLEN	5
    347 #define	OHCI_CTXCTL_EVENT_BITPOS	0
    348 
    349 /* Events from 0 to 15 are generated by the OpenHCI controller.
    350  * Events from 16 to 31 are four-bit IEEE 1394 ack codes or'ed with bit 4 set.
    351  */
    352 #define	OHCI_CTXCTL_EVENT_NO_STATUS		0
    353 #define	OHCI_CTXCTL_EVENT_RESERVED1		1
    354 
    355 /* The received data length was greater than the buffer's data_length.
    356  */
    357 #define	OHCI_CTXCTL_EVENT_LONG_PACKET		2
    358 
    359 /* A subaction gap was detected before an ack arrived or the received
    360  * ack had a parity error.
    361  */
    362 #define	OHCI_CTXCTL_EVENT_MISSING_ACK		3
    363 
    364 /* Underrun on the corresponding FIFO. The packet was truncated.
    365  */
    366 #define	OHCI_CTXCTL_EVENT_UNDERRUN		4
    367 
    368 /* A receive FIFO overflowed during the reception of an isochronous packet.
    369  */
    370 #define	OHCI_CTXCTL_EVENT_OVERRUN		5
    371 
    372 /* An unrecoverable error occurred while the Host Controller was reading
    373  * a descriptor block.
    374  */
    375 #define	OHCI_CTXCTL_EVENT_DESCRIPTOR_READ	6
    376 
    377 /* An error occurred while the Host Controller was attempting to read
    378  * from host memory in the data stage of descriptor processing.
    379  */
    380 #define	OHCI_CTXCTL_EVENT_DATA_READ		7
    381 
    382 /* An error occurred while the Host Controller was attempting to write
    383  * to host memory either in the data stage of descriptor processing
    384  * (AR, IR), or when processing a single 16-bit host * memory write (IT).
    385  */
    386 #define	OHCI_CTXCTL_EVENT_DATA_WRITE		8
    387 
    388 /* Identifies a PHY packet in the receive buffer as being the synthesized
    389  * bus reset packet.  (See section 8.4.2.3).
    390  */
    391 #define	OHCI_CTXCTL_EVENT_BUS_RESET		9
    392 
    393 /* Indicates that the asynchronous transmit response packet expired and
    394  * was not transmitted, or that an IT DMA context experienced a skip
    395  * processing overflow (See section 9.3.3).
    396  */
    397 #define	OHCI_CTXCTL_EVENT_TIMEOUT		10
    398 
    399 /* A bad tCode is associated with this packet. The packet was flushed.
    400  */
    401 #define	OHCI_CTXCTL_EVENT_TCODE_ERR		11
    402 #define	OHCI_CTXCTL_EVENT_RESERVED12		12
    403 #define	OHCI_CTXCTL_EVENT_RESERVED13		13
    404 
    405 /* An error condition has occurred that cannot be represented
    406  * by any other event codes defined herein.
    407  */
    408 #define	OHCI_CTXCTL_EVENT_UNKNOWN		14
    409 
    410 /* Sent by the link side of the output FIFO when asynchronous
    411  * packets are being flushed due to a bus reset.
    412  */
    413 #define	OHCI_CTXCTL_EVENT_FLUSHED		15
    414 
    415 /* IEEE1394 derived ACK codes follow
    416  */
    417 #define	OHCI_CTXCTL_EVENT_RESERVED16		16
    418 
    419 /* For asynchronous request and response packets, this event
    420  * indicates the destination node has successfully accepted
    421  * the packet. If the packet was a request subaction, the
    422  * destination node has successfully completed the transaction
    423  * and no response subaction shall follow.  The event code for
    424  * transmitted PHY, isochronous, asynchronous stream and broadcast
    425  * packets, none of which yields a 1394 ack code, shall be set
    426  * by hardware to ack_complete unless an event occurs.
    427  */
    428 #define	OHCI_CTXCTL_EVENT_ACK_COMPLETE		17
    429 
    430 /* The destination node has successfully accepted the packet.
    431  * If the packet was a request subaction, a response subaction
    432  * should follow at a later time. This code is not returned for
    433  * a response subaction.
    434  */
    435 #define	OHCI_CTXCTL_EVENT_ACK_PENDING		18
    436 #define	OHCI_CTXCTL_EVENT_RESERVED19		19
    437 
    438 /* The packet could not be accepted after max ATRetries (see
    439  * section 5.4) attempts, and the last ack received was ack_busy_X.
    440  */
    441 #define	OHCI_CTXCTL_EVENT_ACK_BUSY_X		20
    442 
    443 /* The packet could not be accepted after max ATRetries (see
    444  * section 5.4) attempts, and the last ack received was ack_busy_A.
    445  */
    446 #define	OHCI_CTXCTL_EVENT_ACK_BUSY_A		21
    447 
    448 /* The packet could not be accepted after max AT Retries (see
    449  * section 5.4) attempts, and the last ack received was ack_busy_B.
    450  */
    451 #define	OHCI_CTXCTL_EVENT_ACK_BUSY_B		22
    452 #define	OHCI_CTXCTL_EVENT_RESERVED23		23
    453 #define	OHCI_CTXCTL_EVENT_RESERVED24		24
    454 #define	OHCI_CTXCTL_EVENT_RESERVED25		25
    455 #define	OHCI_CTXCTL_EVENT_RESERVED26		26
    456 
    457 /* The destination node could not accept the packet because
    458  * the link and higher layers are in a suspended state.
    459  */
    460 #define	OHCI_CTXCTL_EVENT_ACK_TARDY		27
    461 #define	OHCI_CTXCTL_EVENT_RESERVED28		28
    462 
    463 /* An AT context received an ack_data_error, or an IR context
    464  * in packet-per-buffer mode detected a data field CRC or
    465  * data_length error.
    466  */
    467 #define	OHCI_CTXCTL_EVENT_ACK_DATA_ERROR	29
    468 
    469 /* A field in the request packet header was set to an unsupported or
    470  * incorrect value, or an invalid transaction was attempted (e.g., a
    471  * write to a read-only address).
    472  */
    473 #define	OHCI_CTXCTL_EVENT_ACK_TYPE_ERROR	30
    474 #define	OHCI_CTXCTL_EVENT_RESERVED31		31
    475 
    476 /* Context Control for isochronous transmit context
    477  */
    478 #define	OHCI_CTXCTL_TX_CYCLE_MATCH_ENABLE	0x80000000
    479 #define	OHCI_CTXCTL_TX_CYCLE_MATCH_BITLEN	0x7fff0000
    480 #define	OHCI_CTXCTL_TX_CYCLE_MATCH_BITPOS	16
    481 
    482 #define OHCI_CTXCTL_RX_BUFFER_FILL		0x80000000
    483 #define	OHCI_CTXCTL_RX_ISOCH_HEADER		0x40000000
    484 #define	OHCI_CTXCTL_RX_CYCLE_MATCH_ENABLE	0x20000000
    485 #define	OHCI_CTXCTL_RX_MULTI_CHAN_MODE		0x10000000
    486 #define	OHCI_CTXCTL_RX_DUAL_BUFFER_MODE		0x08000000
    487 
    488 /* Context Match registers
    489  */
    490 #define	OHCI_CTXMATCH_TAG3			0x80000000
    491 #define	OHCI_CTXMATCH_TAG2			0x40000000
    492 #define	OHCI_CTXMATCH_TAG1			0x20000000
    493 #define	OHCI_CTXMATCH_TAG0			0x10000000
    494 #define	OHCI_CTXMATCH_CYCLE_MATCH_MASK		0x07fff000
    495 #define	OHCI_CTXMATCH_CYCLE_MATCH_BITPOS	12
    496 #define	OHCI_CTXMATCH_SYNC_MASK			0x00000f00
    497 #define	OHCI_CTXMATCH_SYNC_BITPOS		8
    498 #define	OHCI_CTXMATCH_TAG1_SYNC_FILTER		0x00000040
    499 #define	OHCI_CTXMATCH_CHANNEL_NUMBER_MASK	0x0000003f
    500 #define	OHCI_CTXMATCH_CHANNEL_NUMBER_BITPOS	0
    501 
    502 /*
    503  * Miscellaneous definitions.
    504  */
    505 
    506 #define	OHCI_TCODE_PHY				0xe
    507 
    508 #if BYTE_ORDER == BIG_ENDIAN
    509 struct fwohci_desc {
    510 	u_int16_t	fd_flags;
    511 	u_int16_t	fd_reqcount;
    512 	u_int32_t	fd_data;
    513 	u_int32_t	fd_branch;
    514 	u_int16_t	fd_status;
    515 	u_int16_t	fd_rescount;
    516 };
    517 #endif
    518 #if BYTE_ORDER == LITTLE_ENDIAN
    519 struct fwohci_desc {
    520 	u_int16_t	fd_reqcount;
    521 	u_int16_t	fd_flags;
    522 	u_int32_t	fd_data;
    523 	u_int32_t	fd_branch;
    524 	u_int16_t	fd_rescount;
    525 	u_int16_t	fd_status;
    526 };
    527 #endif
    528 #define	fd_timestamp	fd_rescount
    529 
    530 #define	OHCI_DESC_INPUT		0x2000
    531 #define	OHCI_DESC_LAST		0x1000
    532 #define	OHCI_DESC_STATUS	0x0800
    533 #define	OHCI_DESC_IMMED		0x0200
    534 #define	OHCI_DESC_PING		0x0080
    535 #define	OHCI_DESC_INTR_ALWAYS	0x0030
    536 #define	OHCI_DESC_INTR_ERR	0x0010
    537 #define	OHCI_DESC_BRANCH	0x000c
    538 #define	OHCI_DESC_WAIT		0x0003
    539 
    540 #define	OHCI_DESC_MAX		8
    541 
    542 #endif	/* _DEV_IEEE1394_FWOHCIREG_ */
    543