Home | History | Annotate | Line # | Download | only in s3c2xx0
s3c2xx0reg.h revision 1.2
      1  1.2  bsh /* $NetBSD: s3c2xx0reg.h,v 1.2 2003/02/02 08:41:12 bsh Exp $ */
      2  1.1  bsh 
      3  1.1  bsh /*
      4  1.1  bsh  * Copyright (c) 2002 Fujitsu Component Limited
      5  1.1  bsh  * Copyright (c) 2002 Genetec Corporation
      6  1.1  bsh  * All rights reserved.
      7  1.1  bsh  *
      8  1.1  bsh  * Redistribution and use in source and binary forms, with or without
      9  1.1  bsh  * modification, are permitted provided that the following conditions
     10  1.1  bsh  * are met:
     11  1.1  bsh  * 1. Redistributions of source code must retain the above copyright
     12  1.1  bsh  *    notice, this list of conditions and the following disclaimer.
     13  1.1  bsh  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.1  bsh  *    notice, this list of conditions and the following disclaimer in the
     15  1.1  bsh  *    documentation and/or other materials provided with the distribution.
     16  1.1  bsh  * 3. Neither the name of The Fujitsu Component Limited nor the name of
     17  1.1  bsh  *    Genetec corporation may not be used to endorse or promote products
     18  1.1  bsh  *    derived from this software without specific prior written permission.
     19  1.1  bsh  *
     20  1.1  bsh  * THIS SOFTWARE IS PROVIDED BY FUJITSU COMPONENT LIMITED AND GENETEC
     21  1.1  bsh  * CORPORATION ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
     22  1.1  bsh  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     23  1.1  bsh  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     24  1.1  bsh  * DISCLAIMED.  IN NO EVENT SHALL FUJITSU COMPONENT LIMITED OR GENETEC
     25  1.1  bsh  * CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26  1.1  bsh  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27  1.1  bsh  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
     28  1.1  bsh  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     29  1.1  bsh  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     30  1.1  bsh  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     31  1.1  bsh  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  1.1  bsh  * SUCH DAMAGE.
     33  1.1  bsh  */
     34  1.1  bsh 
     35  1.1  bsh 
     36  1.1  bsh /*
     37  1.1  bsh  * Register definitions common to S3C2800 and S3C24[01]0
     38  1.1  bsh  */
     39  1.1  bsh #ifndef _ARM_S3C2XX0_S3C2XX0REG_H_
     40  1.1  bsh #define _ARM_S3C2XX0_S3C2XX0REG_H_
     41  1.1  bsh 
     42  1.1  bsh /* UART */
     43  1.1  bsh #define	SSCOM_ULCON	0x00	/* UART line control */
     44  1.1  bsh #define  ULCON_IR	(1<<7)	/* Infra-Red mode */
     45  1.1  bsh #define  ULCON_PARITY_SHIFT 4	/* parity mode */
     46  1.1  bsh #define  ULCON_PARITY_NONE  (0<<ULCON_PARITY_SHIFT)
     47  1.1  bsh #define  ULCON_PARITY_ODD   (4<<ULCON_PARITY_SHIFT)
     48  1.1  bsh #define  ULCON_PARITY_EVEN  (5<<ULCON_PARITY_SHIFT)
     49  1.1  bsh #define  ULCON_PARITY_ONE   (6<<ULCON_PARITY_SHIFT)
     50  1.1  bsh #define  ULCON_PARITY_ZERO  (7<<ULCON_PARITY_SHIFT)
     51  1.1  bsh #define  ULCON_STOP	(1<<2)
     52  1.1  bsh #define  ULCON_LENGTH_5 0
     53  1.1  bsh #define  ULCON_LENGTH_6 1
     54  1.1  bsh #define  ULCON_LENGTH_7 2
     55  1.1  bsh #define  ULCON_LENGTH_8 3
     56  1.1  bsh #define SSCOM_UCON	0x04	/* UART control */
     57  1.1  bsh #define  UCON_TXINT_TYPE	(1<<9)	/* Tx interrupt. 0=pulse,1=level */
     58  1.1  bsh #define	 UCON_TXINT_TYPE_LEVEL  UCON_TXINT_TYPE
     59  1.1  bsh #define	 UCON_TXINT_TYPE_PULSE  0
     60  1.1  bsh #define  UCON_RXINT_TYPE	(1<<8)	/* Rx interrupt */
     61  1.1  bsh #define	 UCON_RXINT_TYPE_LEVEL  UCON_RXINT_TYPE
     62  1.1  bsh #define	 UCON_RXINT_TYPE_PULSE  0
     63  1.1  bsh #define  UCON_TOINT	(1<<7)	/* Rx timeout interrupt */
     64  1.1  bsh #define  UCON_ERRINT	(1<<6)	/* receive error interrupt */
     65  1.1  bsh #define  UCON_LOOP	(1<<5)	/* loopback */
     66  1.1  bsh #define  UCON_SBREAK	(1<<4)	/* send break */
     67  1.1  bsh #define	 UCON_TXMODE_DISABLE (0<<2)
     68  1.1  bsh #define  UCON_TXMODE_INT     (1<<2)
     69  1.1  bsh #define  UCON_TXMODE_DMA     (2<<2)
     70  1.1  bsh #define  UCON_TXMODE_MASK    (3<<2)
     71  1.1  bsh #define	 UCON_RXMODE_DISABLE (0<<0)
     72  1.1  bsh #define  UCON_RXMODE_INT     (1<<0)
     73  1.1  bsh #define  UCON_RXMODE_DMA     (2<<0)
     74  1.1  bsh #define  UCON_RXMODE_MASK    (3<<0)
     75  1.1  bsh #define SSCOM_UFCON	0x08	/* FIFO control */
     76  1.1  bsh #define  UFCON_TXTRIGGER_0	(0<<6)
     77  1.1  bsh #define  UFCON_TXTRIGGER_4	(1<<6)
     78  1.1  bsh #define  UFCON_TXTRIGGER_8	(2<<6)
     79  1.1  bsh #define  UFCON_TXTRIGGER_16	(3<<6)
     80  1.2  bsh #define  UFCON_RXTRIGGER_4	(0<<4)
     81  1.2  bsh #define  UFCON_RXTRIGGER_8	(1<<4)
     82  1.2  bsh #define  UFCON_RXTRIGGER_12	(2<<4)
     83  1.1  bsh #define  UFCON_RXTRIGGER_16	(3<<4)
     84  1.1  bsh #define  UFCON_TXFIFO_RESET	(1<<2)
     85  1.1  bsh #define  UFCON_RXFIFO_RESET	(1<<1)
     86  1.1  bsh #define  UFCON_FIFO_ENABLE	(1<<0)
     87  1.1  bsh #define SSCOM_UMCON	0x0c	/* MODEM control */
     88  1.1  bsh /* #define UMCON_AFC  (1<<1) */
     89  1.1  bsh #define  UMCON_RTS	(1<<0)	/* Request to send */
     90  1.1  bsh #define SSCOM_UTRSTAT	0x10	/* Status register */
     91  1.1  bsh #define  UTRSTAT_TXSHIFTER_EMPTY   (1<<2)
     92  1.1  bsh #define  UTRSTAT_TXEMPTY           (1<<1) /* TX fifo or buffer empty */
     93  1.1  bsh #define  UTRSTAT_RXREADY	   (1<<0) /* RX fifo or buffer is not empty */
     94  1.1  bsh #define SSCOM_UERSTAT	0x14	/* Error status register */
     95  1.1  bsh #define  UERSTAT_BREAK	  (1<<3) /* Break signal */
     96  1.1  bsh #define  UERSTAT_FRAME	  (1<<2) /* Frame error */
     97  1.1  bsh #define  UERSTAT_PARITY	  (1<<1) /* Parity error */
     98  1.1  bsh #define  UERSTAT_OVERRUN  (1<<0) /* Overrun */
     99  1.1  bsh #define  UERSTAT_ALL_ERRORS (UERSTAT_OVERRUN|UERSTAT_BREAK|UERSTAT_FRAME|UERSTAT_PARITY)
    100  1.1  bsh #define SSCOM_UFSTAT	0x18	/* Fifo status register */
    101  1.1  bsh #define  UFSTAT_TXFULL	  (1<<9) /* Tx fifo full */
    102  1.1  bsh #define  UFSTAT_RXFULL	  (1<<8) /* Rx fifo full */
    103  1.1  bsh #define  UFSTAT_TXCOUNT_SHIFT 4		/* TX FIFO count */
    104  1.1  bsh #define  UFSTAT_TXCOUNT	  (0x0f<<UFSTAT_TXCOUNT_SHIFT)
    105  1.1  bsh #define  UFSTAT_RXCOUNT_SHIFT 0		/* RX FIFO count */
    106  1.1  bsh #define  UFSTAT_RXCOUNT	  (0x0f<<UFSTAT_RXCOUNT_SHIFT)
    107  1.1  bsh #define SSCOM_UMSTAT	0x1c	/* Modem status register */
    108  1.1  bsh #define  S3C2800_UMSTAT_DCTS	  (1<<1) /* Clear to send chage */
    109  1.1  bsh #define  S3C24X0_UMSTAT_DCTS	  (1<<2) /* Clear to send chage */
    110  1.1  bsh #define  UMSTAT_CTS	  (1<<0) /* Clear to send */
    111  1.1  bsh #if _BYTE_ORDER == _LITTLE_ENDIAN
    112  1.1  bsh #define SSCOM_UTXH	0x20	/* Transmit data register */
    113  1.1  bsh #define SSCOM_URXH	0x24	/* Receive data register */
    114  1.1  bsh #else
    115  1.1  bsh #define SSCOM_UTXH	0x23	/* Transmit data register */
    116  1.1  bsh #define SSCOM_URXH	0x27	/* Receive data register */
    117  1.1  bsh #endif
    118  1.1  bsh #define SSCOM_UBRDIV	0x28	/* baud-reate divisor */
    119  1.1  bsh #define SSCOM_SIZE  0x2c
    120  1.1  bsh 
    121  1.1  bsh /* Interrupt controller (Common to S3c2800/2400X/2410X) */
    122  1.1  bsh #define INTCTL_SRCPND	0x00	/* Interrupt request status */
    123  1.1  bsh #define INTCTL_INTMOD	0x04	/* Interrupt mode (FIQ/IRQ) */
    124  1.1  bsh #define INTCTL_INTMSK	0x08	/* Interrupt mask */
    125  1.1  bsh 
    126  1.1  bsh #endif /* _ARM_S3C2XX0_S3C2XX0REG_H_ */
    127