Home | History | Annotate | Line # | Download | only in sbus
dbrireg.h revision 1.4.18.1
      1  1.4.18.1     rmind /*	$NetBSD: dbrireg.h,v 1.4.18.1 2007/03/12 05:57:06 rmind Exp $	*/
      2       1.1  macallan 
      3       1.1  macallan /*
      4       1.2  macallan  * Copyright (C) 1997 Rudolf Koenig (rfkoenig (at) immd4.informatik.uni-erlangen.de)
      5       1.2  macallan  * Copyright (c) 1998, 1999 Brent Baccala (baccala (at) freesoft.org)
      6       1.2  macallan  * Copyright (c) 2001, 2002 Jared D. McNeill <jmcneill (at) netbsd.org>
      7       1.2  macallan  * Copyright (c) 2005 Michael Lorenz <macallan (at) netbsd.org>
      8       1.1  macallan  * All rights reserved.
      9       1.1  macallan  *
     10       1.2  macallan  * This driver is losely based on a Linux driver written by Rudolf Koenig and
     11       1.2  macallan  * Brent Baccala who kindly gave their permission to use their code in a
     12       1.2  macallan  * BSD-licensed driver.
     13       1.2  macallan  *
     14       1.1  macallan  * Redistribution and use in source and binary forms, with or without
     15       1.1  macallan  * modification, are permitted provided that the following conditions
     16       1.1  macallan  * are met:
     17       1.1  macallan  * 1. Redistributions of source code must retain the above copyright
     18       1.1  macallan  *    notice, this list of conditions and the following disclaimer.
     19       1.1  macallan  * 2. Redistributions in binary form must reproduce the above copyright
     20       1.1  macallan  *    notice, this list of conditions and the following disclaimer in the
     21       1.1  macallan  *    documentation and/or other materials provided with the distribution.
     22       1.1  macallan  * 3. All advertising materials mentioning features or use of this software
     23       1.1  macallan  *    must display the following acknowledgement:
     24       1.2  macallan  *	This product includes software developed by Rudolf Koenig, Brent
     25       1.2  macallan  *      Baccala, Jared D. McNeill.
     26       1.1  macallan  * 4. Neither the name of the author nor the names of any contributors may
     27       1.1  macallan  *    be used to endorse or promote products derived from this software
     28       1.1  macallan  *    without specific prior written permission.
     29       1.1  macallan  *
     30       1.1  macallan  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     31       1.1  macallan  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     32       1.1  macallan  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     33       1.1  macallan  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     34       1.1  macallan  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     35       1.1  macallan  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     36       1.1  macallan  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     37       1.1  macallan  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     38       1.1  macallan  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     39       1.1  macallan  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     40       1.1  macallan  * SUCH DAMAGE.
     41       1.1  macallan  *
     42       1.1  macallan  */
     43       1.1  macallan 
     44       1.4  macallan #ifndef DBRI_REG_H
     45       1.4  macallan #define DBRI_REG_H
     46       1.4  macallan 
     47       1.1  macallan #define DBRI_REG0		0x00L	/* status and control */
     48       1.1  macallan #define	  DBRI_COMMAND_VALID	(1<<15)
     49       1.1  macallan #define   DBRI_BURST_4		(1<<14)	/* allow 4-word sbus bursts */
     50       1.1  macallan #define   DBRI_BURST_16		(1<<13)	/* allow 16-word sbus bursts */
     51       1.1  macallan #define   DBRI_BURST_8		(1<<12)	/* allow 8-word sbus bursts */
     52       1.1  macallan #define	  DBRI_CHI_ACTIVATE	(1<<4)	/* allow activation of CHI interface */
     53       1.1  macallan #define	  DBRI_DISABLE_MASTER	(1<<2)	/* disable master mode */
     54       1.1  macallan #define   DBRI_SOFT_RESET	(1<<0)	/* soft reset */
     55       1.1  macallan #define	DBRI_REG1		0x04UL	/* mode and interrupt */
     56       1.1  macallan #define	  DBRI_MRR		(1<<4)	/* multiple error ack on sbus */
     57       1.1  macallan #define	  DBRI_MLE		(1<<3)	/* multiple late error on sbus */
     58       1.1  macallan #define	  DBRI_LBG		(1<<2)	/* lost bus grant on sbus */
     59       1.1  macallan #define	  DBRI_MBE		(1<<1)	/* burst error on sbus */
     60       1.1  macallan #define DBRI_REG2		0x08UL	/* parallel I/O */
     61       1.1  macallan #define	  DBRI_PIO2_ENABLE	(1<<6)	/* enable pin 2 */
     62       1.1  macallan #define	  DBRI_PIO_ENABLE_ALL	(0xf0)	/* enable all the pins */
     63       1.1  macallan #define	  DBRI_PIO3		(1<<3)	/* pin 3: 1: data mode, 0: ctrl mode */
     64       1.1  macallan #define	  DBRI_PIO2		(1<<2)	/* pin 2: 1: onboard PDN */	/* XXX according to SPARCbook manual this is RESET */
     65       1.1  macallan #define	  DBRI_PIO1		(1<<1)	/* pin 1: 0: reset */ 	/* XXX according to SPARCbook manual  this is PDN */
     66       1.1  macallan #define	  DBRI_PIO0		(1<<0)	/* pin 0: 1: speakerbox PDN */
     67       1.1  macallan #define DBRI_REG8		0x20UL	/* command queue pointer */
     68       1.1  macallan #define	  DBRI_COMMAND_WAIT	0x0
     69       1.1  macallan #define	  DBRI_COMMAND_PAUSE	0x1
     70       1.1  macallan #define	  DBRI_COMMAND_IIQ	0x3
     71       1.1  macallan #define	  DBRI_COMMAND_SDP	0x5
     72       1.1  macallan #define	  DBRI_COMMAND_CDP	0x6
     73       1.1  macallan #define	  DBRI_COMMAND_DTS	0x7
     74       1.1  macallan #define	  DBRI_COMMAND_SSP	0x8
     75       1.1  macallan #define	  DBRI_COMMAND_CHI	0x9
     76       1.1  macallan #define	  DBRI_COMMAND_CDM	0xe	/* CHI data mode */
     77       1.1  macallan 
     78       1.1  macallan /* interrupts */
     79       1.1  macallan #define DBRI_INTR_BRDY		1	/* buffer ready for processing */
     80  1.4.18.1     rmind #define DBRI_INTR_CMDI		6	/* command has been read */
     81       1.1  macallan #define DBRI_INTR_XCMP		8	/* transmission of frame complete */
     82       1.1  macallan #define DBRI_INTR_SBRI		9	/* BRI status change info */
     83       1.1  macallan #define DBRI_INTR_FXDT		10	/* fixed data change */
     84       1.1  macallan #define DBRI_INTR_UNDR		15	/* DMA underrun */
     85       1.1  macallan 
     86       1.1  macallan #define	DBRI_INTR_CMD		38
     87       1.1  macallan 
     88       1.1  macallan /* setup data pipe */
     89       1.1  macallan /* IRM */
     90       1.1  macallan #define	DBRI_SDP_2SAME		(1<<18)	/* report 2nd time in a row recv val */
     91       1.1  macallan #define	DBRI_SDP_CHANGE		(2<<18)	/* report any changes */
     92       1.1  macallan #define	DBRI_SDP_EVERY		(3<<18) /* report any changes */
     93       1.1  macallan /* pipe data mode */
     94       1.1  macallan #define	DBRI_SDP_FIXED		(6<<13)	/* short only */
     95       1.1  macallan #define	DBRI_SDP_TO_SER		(1<<12)	/* direction */
     96       1.1  macallan #define DBRI_SDP_FROM_SER	(0<<12)	/* direction */
     97       1.1  macallan #define DBRI_SDP_CLEAR		(1<<7)	/* clear */
     98       1.1  macallan #define DBRI_SDP_VALID_POINTER	(1<<10)	/* pointer valid */
     99       1.1  macallan #define DBRI_SDP_MEM		(0<<13)	/* to/from memory */
    100       1.1  macallan #define DBRI_SDP_MSB		(1<<11)	/* bit order */
    101       1.1  macallan #define DBRI_SDP_LSB		(0<<11)	/* bit order */
    102       1.1  macallan 
    103       1.1  macallan /* define time slot */
    104       1.1  macallan #define	DBRI_DTS_VI		(1<<17)	/* valid input time-slot descriptor */
    105       1.1  macallan #define	DBRI_DTS_VO		(1<<16)	/* valid output time-slot descriptor */
    106       1.1  macallan #define	DBRI_DTS_INS		(1<<15)	/* insert time-slot */
    107       1.1  macallan #define	DBRI_DTS_DEL		(0<<15)	/* delete time-slot */
    108       1.1  macallan #define	DBRI_DTS_PRVIN(v)	((v)<<10)	/* previous in-pipe */
    109       1.1  macallan #define	DBRI_DTS_PRVOUT(v)	((v)<<5)	/* previous out-pipe */
    110       1.1  macallan 
    111       1.1  macallan /* time slot defines */
    112       1.1  macallan #define	DBRI_TS_ANCHOR		(7<<10)	/* starting short pipes */
    113       1.1  macallan #define	DBRI_TS_NEXT(v)		((v)<<0) /* pipe #: 0-15 long, 16-21 short */
    114       1.1  macallan #define	DBRI_TS_LEN(v)		((v)<<24) /* # of bits in this timeslot */
    115       1.1  macallan #define	DBRI_TS_CYCLE(v)	((v)<<14) /* bit count at start of cycle */
    116       1.1  macallan 
    117       1.1  macallan /* concentration highway interface (CHI) modes */
    118       1.1  macallan #define	DBRI_CHI_CHICM(v)	((v)<<16)	/* clock mode */
    119       1.1  macallan #define	DBRI_CHI_BPF(v)		((v)<<0)	/* bits per frame */
    120       1.1  macallan #define	DBRI_CHI_FD		(1<<11)	/* frame drive */
    121       1.1  macallan 
    122       1.1  macallan /* CHI data mode */
    123       1.1  macallan #define	DBRI_CDM_XCE		(1<<2)	/* transmit on rising edge of CHICK */
    124       1.1  macallan #define	DBRI_CDM_XEN		(1<<1)	/* transmit highway enable */
    125       1.1  macallan #define	DBRI_CDM_REN		(1<<0)	/* receive highway enable */
    126       1.1  macallan 
    127       1.1  macallan /* transmit descriptor defines */
    128       1.1  macallan #define	DBRI_TD_CNT(v)		((v)<<16) /* # valid bytes in buffer */
    129       1.1  macallan #define	DBRI_TD_STATUS(v)	((v)&0xff) /* transmit status */
    130       1.1  macallan #define	DBRI_TD_EOF		(1<<31)	/* end of frame */
    131       1.1  macallan #define	DBRI_TD_FINAL		(1<<15)	/* final interrupt */
    132       1.1  macallan #define	DBRI_TD_IDLE		(1<<13)	/* transmit idle characters */
    133       1.1  macallan #define	DBRI_TD_TBC		(1<<0)	/* transmit buffer complete */
    134       1.4  macallan 
    135       1.4  macallan #endif /* DBRI_REG_H */
    136