Home | History | Annotate | Line # | Download | only in dev
dmac_0448.h revision 1.1
      1 /*
      2  * Copyright (c) 1992, 1993
      3  *	The Regents of the University of California.  All rights reserved.
      4  *
      5  * This code is derived from software contributed to Berkeley by
      6  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
      7  *
      8  * Redistribution and use in source and binary forms, with or without
      9  * modification, are permitted provided that the following conditions
     10  * are met:
     11  * 1. Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  * 2. Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in the
     15  *    documentation and/or other materials provided with the distribution.
     16  * 3. All advertising materials mentioning features or use of this software
     17  *    must display the following acknowledgement:
     18  *	This product includes software developed by the University of
     19  *	California, Berkeley and its contributors.
     20  * 4. Neither the name of the University nor the names of its contributors
     21  *    may be used to endorse or promote products derived from this software
     22  *    without specific prior written permission.
     23  *
     24  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34  * SUCH DAMAGE.
     35  *
     36  * from: $Hdr: dmac_0448.h,v 4.300 91/06/09 06:21:36 root Rel41 $ SONY
     37  *
     38  *	@(#)dmac_0448.h	8.1 (Berkeley) 6/11/93
     39  */
     40 
     41 /*
     42  * Copyright (c) 1989- by SONY Corporation.
     43  */
     44 /*
     45  *	dmac_0448.h
     46  *		DMAC L7A0448
     47  */
     48 
     49 /*	dmac register base address	*/
     50 #define DMAC_BASE		0xbfe00000
     51 
     52 /*	register definition	*/
     53 #define DMAC_GSTAT		(DMAC_BASE + 0xf)
     54 #define DMAC_GSEL		(DMAC_BASE + 0xe)
     55 
     56 #define DMAC_CSTAT		(DMAC_BASE + 0x2)
     57 #define DMAC_CCTL		(DMAC_BASE + 0x3)
     58 #define DMAC_CTRCL		(DMAC_BASE + 0x4)
     59 #define DMAC_CTRCM		(DMAC_BASE + 0x5)
     60 #define DMAC_CTRCH		(DMAC_BASE + 0x6)
     61 #define DMAC_CTAG		(DMAC_BASE + 0x7)
     62 #define DMAC_CWID		(DMAC_BASE + 0x8)
     63 #define DMAC_COFSL		(DMAC_BASE + 0x9)
     64 #define DMAC_COFSH		(DMAC_BASE + 0xa)
     65 #define DMAC_CMAP		(DMAC_BASE + 0xc)
     66 #define DMAC_CMAPH		(DMAC_BASE + 0xc)
     67 #define DMAC_CMAPL		(DMAC_BASE + 0xd)
     68 
     69 #ifdef mips
     70 #define	VOLATILE	volatile
     71 #else
     72 #define	VOLATILE
     73 #endif
     74 
     75 #ifndef U_CHAR
     76 #define U_CHAR	unsigned VOLATILE char
     77 #endif
     78 
     79 #ifndef U_SHORT
     80 #define U_SHORT	unsigned VOLATILE short
     81 #endif
     82 
     83 #define dmac_gstat		*(U_CHAR *)DMAC_GSTAT
     84 #define dmac_gsel		*(U_CHAR *)DMAC_GSEL
     85 
     86 #define dmac_cstat		*(U_CHAR *)DMAC_CSTAT
     87 #define dmac_cctl		*(U_CHAR *)DMAC_CCTL
     88 #define dmac_ctrcl		*(U_CHAR *)DMAC_CTRCL
     89 #define dmac_ctrcm		*(U_CHAR *)DMAC_CTRCM
     90 #define dmac_ctrch		*(U_CHAR *)DMAC_CTRCH
     91 #define dmac_ctag		*(U_CHAR *)DMAC_CTAG
     92 #define dmac_cwid		*(U_CHAR *)DMAC_CWID
     93 #define dmac_cofsl		*(U_CHAR *)DMAC_COFSL
     94 #define dmac_cofsh		*(U_CHAR *)DMAC_COFSH
     95 #define dmac_cmap		*(U_SHORT *)DMAC_CMAP
     96 #define dmac_cmaph		*(U_CHAR *)DMAC_CMAPH
     97 #define dmac_cmapl		*(U_CHAR *)DMAC_CMAPL
     98 
     99 /*	status/control bit definition	*/
    100 #define	DM_TCZ			0x80
    101 #define	DM_A28			0x40
    102 #define	DM_AFIX			0x20
    103 #define	DM_APAD			0x10
    104 #define	DM_ZINTEN		0x8
    105 #define	DM_RST			0x4
    106 #define	DM_MODE			0x2
    107 #define DM_ENABLE		1
    108 
    109 /*	general status bit definition	*/
    110 #define CH_INT(x)		(u_char)(1 << (2 * x))
    111 #define CH0_INT			1
    112 #define CH1_INT			4
    113 #define CH2_INT			0x10
    114 #define CH3_INT			0x40
    115 
    116 #define CH_MRQ(x)		(u_char)(1 << (2 * x + 1))
    117 #define CH0_MRQ			2
    118 #define CH1_MRQ			8
    119 #define CH2_MRQ			0x20
    120 #define CH3_MRQ			0x80
    121 
    122 /*	channel definition	*/
    123 #define	CH_SCSI			0
    124 #define	CH_FDC			1
    125 #define	CH_AUDIO		2
    126 #define	CH_VIDEO		3
    127 
    128 /*	dma status		*/
    129 
    130 	struct	dm_stat {
    131 		unsigned int dm_gstat;
    132 		unsigned int dm_cstat;
    133 		unsigned int dm_cctl;
    134 		unsigned int dm_tcnt;
    135 		unsigned int dm_offset;
    136 		unsigned int dm_tag;
    137 		unsigned int dm_width;
    138 	} ;
    139 
    140 #define	DMAC_WAIT	nops(10)
    141 
    142 #define PINTEN		0xbfc80001
    143 # define	DMA_INTEN	0x10
    144 #define PINTSTAT	0xbfc80003
    145