/*
* Copyright (c) 1995 Charles D. Cranor
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* x y r e g . h
*
* this file contains the description of the Xylogics 450/451's hardware
* data structures.
*
* author: Chuck Cranor <chuck@netbsd>
*/
#define XYC_MAXDEV 2 /* max devices per controller */
#define XYC_CTLIOPB XYC_MAXDEV /* controller's iopb */
#define XYC_RESETUSEC 1000000 /* max time for xyc reset (same as xdc?) */
#define XYC_MAXIOPB (XYC_MAXDEV+1)
/* max number of iopbs that can be active */
#define XYC_MAXTIME 4*1000000 /* four seconds before we give up and reset */
#define XYC_MAXTRIES 4 /* max number of times to retry an operation */
#define XYC_INTERLEAVE 1 /* interleave (from disk label?) */
#define XYFM_BPS 0x200 /* must be 512! */
/*
* xyc device interface
* (lives in VME address space) [note: bytes are swapped!]
*/
/*
* Input/Output Parameter Block (iopb)
*
* all controller commands are done via iopb's. to start a command you
* must do this:
* [1] allocate space in DVMA space for the iopb
* [2] fill out all the fields of the iopb
* [3] if the controller isn't busy, start the iopb by loading the address
* and reloc in the xyc's registers and setting the "go" bit [done]
* [4] controller busy: set AREQ bit, and wait for AACK bit.
* add iopb to the chain, and clear AREQ to resume I/O
*
* when the controller is done with a command it may interrupt (if you
* ask it to) and it will set the XYC_IPND bit in the csr. clear
* the interrupt by writing one to this bit.
*
* the format of the iopb is described in section 2.4 of the manual.
* note that it is byte-swapped on the sun.
*/