Home | History | Annotate | Line # | Download | only in include
scifreg.h revision 1.7
      1  1.7     uwe /* $NetBSD: scifreg.h,v 1.7 2006/02/13 23:26:31 uwe Exp $ */
      2  1.1  itojun 
      3  1.1  itojun /*-
      4  1.1  itojun  * Copyright (C) 1999 SAITOH Masanobu.  All rights reserved.
      5  1.1  itojun  *
      6  1.1  itojun  * Redistribution and use in source and binary forms, with or without
      7  1.1  itojun  * modification, are permitted provided that the following conditions
      8  1.1  itojun  * are met:
      9  1.1  itojun  * 1. Redistributions of source code must retain the above copyright
     10  1.1  itojun  *    notice, this list of conditions and the following disclaimer.
     11  1.1  itojun  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1  itojun  *    notice, this list of conditions and the following disclaimer in the
     13  1.1  itojun  *    documentation and/or other materials provided with the distribution.
     14  1.1  itojun  * 3. The name of the author may not be used to endorse or promote products
     15  1.1  itojun  *    derived from this software without specific prior written permission.
     16  1.1  itojun  *
     17  1.1  itojun  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18  1.1  itojun  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19  1.1  itojun  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20  1.1  itojun  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21  1.1  itojun  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22  1.1  itojun  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23  1.1  itojun  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24  1.1  itojun  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25  1.1  itojun  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     26  1.1  itojun  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  1.1  itojun  */
     28  1.1  itojun 
     29  1.1  itojun #ifndef _SH3_SCIFREG_H_
     30  1.3     uch #define	_SH3_SCIFREG_H_
     31  1.1  itojun 
     32  1.1  itojun /*
     33  1.1  itojun  * Serial Communication Interface (SCIF)
     34  1.1  itojun  */
     35  1.1  itojun 
     36  1.7     uwe #ifdef SH3
     37  1.1  itojun 
     38  1.1  itojun /* SH3 definitions */
     39  1.1  itojun 
     40  1.3     uch #define	SHREG_SCSMR2  (*(volatile unsigned char *)	0xa4000150)
     41  1.3     uch #define	SHREG_SCBRR2  (*(volatile unsigned char *)	0xa4000152)
     42  1.3     uch #define	SHREG_SCSCR2  (*(volatile unsigned char *)	0xa4000154)
     43  1.3     uch #define	SHREG_SCFTDR2 (*(volatile unsigned char *)	0xa4000156)
     44  1.3     uch #define	SHREG_SCSSR2  (*(volatile unsigned short *)	0xa4000158)
     45  1.3     uch #define	SHREG_SCFRDR2 (*(volatile unsigned char *)	0xa400015A)
     46  1.3     uch #define	SHREG_SCFCR2  (*(volatile unsigned char *)	0xa400015C)
     47  1.3     uch #define	SHREG_SCFDR2  (*(volatile unsigned short *)	0xa400015E)
     48  1.3     uch 
     49  1.7     uwe #else  /* !SH3 */
     50  1.7     uwe 
     51  1.7     uwe /* SH4 definitions */
     52  1.7     uwe 
     53  1.7     uwe #define	SHREG_SCSMR2  (*(volatile unsigned short *)	0xffe80000)
     54  1.7     uwe #define	SHREG_SCBRR2  (*(volatile unsigned char *)	0xffe80004)
     55  1.7     uwe #define	SHREG_SCSCR2  (*(volatile unsigned short *)	0xffe80008)
     56  1.7     uwe #define	SHREG_SCFTDR2 (*(volatile unsigned char *)	0xffe8000c)
     57  1.7     uwe #define	SHREG_SCFSR2  (*(volatile unsigned short *)	0xffe80010)
     58  1.7     uwe #define	SHREG_SCFRDR2 (*(volatile unsigned char *)	0xffe80014)
     59  1.7     uwe #define	SHREG_SCFCR2  (*(volatile unsigned short *)	0xffe80018)
     60  1.7     uwe #define	SHREG_SCFDR2  (*(volatile unsigned short *)	0xffe8001c)
     61  1.7     uwe 
     62  1.7     uwe #define	SHREG_SCSPTR2 (*(volatile unsigned short *)	0xffe80020)
     63  1.7     uwe #define	SHREG_SCLSR2  (*(volatile unsigned short *)	0xffe80024)
     64  1.7     uwe 
     65  1.7     uwe /* alias */
     66  1.7     uwe #define	SHREG_SCSFDR2	SHREG_SCFTDR2
     67  1.7     uwe #define	SHREG_SCSSR2	SHREG_SCFSR2
     68  1.7     uwe 
     69  1.7     uwe #define	SCSPTR2_RTSIO		0x0080
     70  1.7     uwe #define	SCSPTR2_RTSDT		0x0040
     71  1.7     uwe #define	SCSPTR2_CTSIO		0x0020
     72  1.7     uwe #define	SCSPTR2_CTSDT		0x0010
     73  1.7     uwe #define	SCSPTR2_SCKIO		0x0008
     74  1.7     uwe #define	SCSPTR2_SCKDT		0x0004
     75  1.7     uwe #define	SCSPTR2_SPB2IO		0x0002
     76  1.7     uwe #define	SCSPTR2_SPB2DT		0x0001
     77  1.7     uwe 
     78  1.7     uwe #define SCLSR2_ORER	0x0001	/* overrun error */
     79  1.7     uwe 
     80  1.7     uwe #endif /* !SH3 */
     81  1.7     uwe 
     82  1.7     uwe 
     83  1.7     uwe /* common definitions */
     84  1.7     uwe 
     85  1.3     uch #define	SCSCR2_TIE	0x80	/* Transmit Interrupt Enable */
     86  1.3     uch #define	SCSCR2_RIE	0x40	/* Recieve Interrupt Enable */
     87  1.3     uch #define	SCSCR2_TE	0x20	/* Transmit Enable */
     88  1.3     uch #define	SCSCR2_RE	0x10	/* Receive Enable */
     89  1.3     uch #define	SCSCR2_CKE1	0x02	/* ClocK Enable 1 */
     90  1.3     uch #define	SCSCR2_CKE0	0x01	/* ClocK Enable 0 */
     91  1.3     uch 
     92  1.3     uch #define	SCSSR2_ER	0x0080	/* ERror */
     93  1.3     uch #define	SCSSR2_TEND	0x0040	/* Transmit END */
     94  1.3     uch #define	SCSSR2_TDFE	0x0020	/* Transmit Data Fifo Empty */
     95  1.3     uch #define	SCSSR2_BRK	0x0010	/* BReaK detection */
     96  1.3     uch #define	SCSSR2_FER	0x0008	/* Framing ERror */
     97  1.3     uch #define	SCSSR2_PER	0x0004	/* Parity ERror */
     98  1.3     uch #define	SCSSR2_RDF	0x0002	/* Recieve fifo Data Full */
     99  1.3     uch #define	SCSSR2_DR	0x0001	/* Data Ready */
    100  1.3     uch 
    101  1.3     uch #define	SCFCR2_RTRG1	0x80	/* Receive TRiGger 1 */
    102  1.3     uch #define	SCFCR2_RTRG0	0x40	/* Receive TRiGger 0 */
    103  1.3     uch #define	SCFCR2_TTRG1	0x20	/* Transmit TRiGger 1 */
    104  1.3     uch #define	SCFCR2_TTRG0	0x10	/* Transmit TRiGger 0 */
    105  1.3     uch #define	SCFCR2_MCE	0x08	/* Modem Control Enable */
    106  1.3     uch #define	SCFCR2_TFRST	0x04	/* Transmit Fifo register ReSeT */
    107  1.3     uch #define	SCFCR2_RFRST	0x02	/* Receive Fifo register ReSeT */
    108  1.3     uch #define	SCFCR2_LOOP	0x01	/* LOOP back test */
    109  1.7     uwe 
    110  1.3     uch #define	FIFO_RCV_TRIGGER_1	0x00
    111  1.3     uch #define	FIFO_RCV_TRIGGER_4	0x40
    112  1.3     uch #define	FIFO_RCV_TRIGGER_8	0x80
    113  1.3     uch #define	FIFO_RCV_TRIGGER_14	0xc0
    114  1.3     uch #define	FIFO_XMT_TRIGGER_8	0x00
    115  1.3     uch #define	FIFO_XMT_TRIGGER_4	0x10
    116  1.3     uch #define	FIFO_XMT_TRIGGER_2	0x20
    117  1.3     uch #define	FIFO_XMT_TRIGGER_1	0x30
    118  1.1  itojun 
    119  1.3     uch #define	SCFDR2_TXCNT	0xff00	/* Tx CouNT */
    120  1.3     uch #define	SCFDR2_RECVCNT	0x00ff	/* Rx CouNT */
    121  1.3     uch #define	SCFDR2_TXF_FULL	0x1000	/* Tx FULL */
    122  1.3     uch #define	SCFDR2_RXF_EPTY	0x0000	/* Rx EMPTY */
    123  1.1  itojun 
    124  1.1  itojun #endif /* !_SH3_SCIFREG_ */
    125