Home | History | Annotate | Line # | Download | only in samsung
sscom_reg.h revision 1.2.34.1
      1  1.2.34.1  pgoyette /* $NetBSD: sscom_reg.h,v 1.2.34.1 2018/07/28 04:37:29 pgoyette Exp $ */
      2       1.1      matt 
      3       1.1      matt /*
      4       1.1      matt  * Copyright (c) 2002, 2003 Fujitsu Component Limited
      5       1.1      matt  * Copyright (c) 2002, 2003 Genetec Corporation
      6       1.1      matt  * All rights reserved.
      7       1.1      matt  *
      8       1.1      matt  * Redistribution and use in source and binary forms, with or without
      9       1.1      matt  * modification, are permitted provided that the following conditions
     10       1.1      matt  * are met:
     11       1.1      matt  * 1. Redistributions of source code must retain the above copyright
     12       1.1      matt  *    notice, this list of conditions and the following disclaimer.
     13       1.1      matt  * 2. Redistributions in binary form must reproduce the above copyright
     14       1.1      matt  *    notice, this list of conditions and the following disclaimer in the
     15       1.1      matt  *    documentation and/or other materials provided with the distribution.
     16       1.1      matt  * 3. Neither the name of The Fujitsu Component Limited nor the name of
     17       1.1      matt  *    Genetec corporation may not be used to endorse or promote products
     18       1.1      matt  *    derived from this software without specific prior written permission.
     19       1.1      matt  *
     20       1.1      matt  * THIS SOFTWARE IS PROVIDED BY FUJITSU COMPONENT LIMITED AND GENETEC
     21       1.1      matt  * CORPORATION ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
     22       1.1      matt  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     23       1.1      matt  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     24       1.1      matt  * DISCLAIMED.  IN NO EVENT SHALL FUJITSU COMPONENT LIMITED OR GENETEC
     25       1.1      matt  * CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26       1.1      matt  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27       1.1      matt  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
     28       1.1      matt  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     29       1.1      matt  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     30       1.1      matt  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     31       1.1      matt  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32       1.1      matt  * SUCH DAMAGE.
     33       1.1      matt  */
     34       1.1      matt 
     35       1.1      matt 
     36       1.1      matt /*
     37       1.1      matt  * Register definitions for the Exynos[45] chipsets UARTs
     38       1.1      matt  */
     39       1.1      matt #ifndef _ARM_SAMSUNG_SSCOM_REG_H_
     40       1.1      matt #define	_ARM_SAMSUNG_SSCOM_REG_H_
     41       1.1      matt 
     42       1.1      matt 
     43       1.1      matt #define	SSCOM_ULCON 0x00 /* UART line control */
     44       1.1      matt #define	 ULCON_IR  		__BIT(6)
     45       1.1      matt #define	 ULCON_PARITY		__BITS(5,3)
     46       1.1      matt #define	 ULCON_PARITY_NONE	__SHIFTIN(0, ULCON_PARITY)
     47       1.1      matt #define	 ULCON_PARITY_ODD	__SHIFTIN(4, ULCON_PARITY)
     48       1.1      matt #define	 ULCON_PARITY_EVEN	__SHIFTIN(5, ULCON_PARITY)
     49       1.1      matt #define	 ULCON_PARITY_ONE	__SHIFTIN(6, ULCON_PARITY)
     50       1.1      matt #define	 ULCON_PARITY_ZERO	__SHIFTIN(7, ULCON_PARITY)
     51       1.1      matt #define	 ULCON_STOP		__BIT(2)
     52  1.2.34.1  pgoyette #define  ULCON_LENGTH		__BITS(1,0)
     53       1.1      matt #define	 ULCON_LENGTH_5		0
     54       1.1      matt #define	 ULCON_LENGTH_6		1
     55       1.1      matt #define	 ULCON_LENGTH_7		2
     56       1.1      matt #define	 ULCON_LENGTH_8		3
     57       1.1      matt #define	SSCOM_UCON		0x04	/* UART control */
     58       1.1      matt #define  UCON_TXDMA_BRST	__BITS(22,20)
     59       1.1      matt #define  UCON_TXDMA_BRST_1	__SHIFTIN(0, UCON_TXDMA)
     60       1.1      matt #define  UCON_TXDMA_BRST_4	__SHIFTIN(1, UCON_TXDMA)
     61       1.1      matt #define  UCON_TXDMA_BRST_8	__SHIFTIN(2, UCON_TXDMA)
     62       1.1      matt #define  UCON_TXDMA_BRST_16	__SHIFTIN(3, UCON_TXDMA)
     63       1.1      matt #define  UCON_RXDMA_BRST	__BITS(18,16)
     64       1.1      matt #define  UCON_RXDMA_BRST_1	__SHIFTIN(0, UCON_RXDMA)
     65       1.1      matt #define  UCON_RXDMA_BRST_4	__SHIFTIN(1, UCON_RXDMA)
     66       1.1      matt #define  UCON_RXDMA_BRST_8	__SHIFTIN(2, UCON_RXDMA)
     67       1.1      matt #define  UCON_RXDMA_BRST_16	__SHIFTIN(3, UCON_RXDMA)
     68       1.1      matt #define  UCON_RXTO		__BITS(15,12)
     69       1.1      matt #define  UCON_RXTO_FIFO_EMPTY   __BIT(11)
     70       1.1      matt #define  UCON_RXTO_DMA_FSM_STOP __BIT(10)
     71       1.1      matt #define	 UCON_TXINT_TYPE	__BIT(9)	/* Tx interrupt. 0=pulse,1=level */
     72       1.1      matt #define	 UCON_TXINT_TYPE_LEVEL  UCON_TXINT_TYPE	/* 4412 mandatory */
     73       1.1      matt #define	 UCON_TXINT_TYPE_PULSE  0
     74       1.1      matt #define	 UCON_RXINT_TYPE	__BIT(8)	/* Rx interrupt */
     75       1.1      matt #define	 UCON_RXINT_TYPE_LEVEL  UCON_RXINT_TYPE	/* 4412 mandatory */
     76       1.1      matt #define	 UCON_RXINT_TYPE_PULSE  __SHIFTIN(0,UCON_RXINT_TYPE)
     77       1.1      matt #define	 UCON_TOINT		__BIT(7)	/* Rx timeout interrupt */
     78       1.1      matt #define	 UCON_ERRINT		__BIT(6)	/* receive error interrupt */
     79       1.1      matt #define	 UCON_LOOP		__BIT(5)	/* loopback */
     80       1.1      matt #define	 UCON_SBREAK		__BIT(4)	/* send break */
     81       1.1      matt #define  UCON_TXMODE		__BITS(3,2)
     82       1.1      matt #define	 UCON_TXMODE_DISABLE	__SHIFTIN(0, UCON_TXMODE)
     83       1.1      matt #define	 UCON_TXMODE_INT	__SHIFTIN(1, UCON_TXMODE)
     84       1.1      matt #define	 UCON_TXMODE_DMA	__SHIFTIN(2, UCON_TXMODE)
     85       1.1      matt #define	 UCON_TXMODE_MASK	__SHIFTIN(3, UCON_TXMODE)
     86       1.1      matt #define	 UCON_RXMODE		__BITS(1,0)
     87       1.1      matt #define	 UCON_RXMODE_DISABLE	__SHIFTIN(1, UCON_RXMODE)
     88       1.1      matt #define	 UCON_RXMODE_INT	__SHIFTIN(1, UCON_RXMODE)
     89       1.1      matt #define	 UCON_RXMODE_DMA	__SHIFTIN(2, UCON_RXMODE)
     90       1.1      matt #define	 UCON_RXMODE_MASK	__SHIFTIN(3, UCON_RXMODE)
     91       1.1      matt #define	SSCOM_UFCON		0x08	/* FIFO control */
     92       1.1      matt #define  UFCON_TXTRIGGER	__BITS(10,8)
     93       1.1      matt #define  UFCON_RXTRIGGER	__BITS(6,4)
     94       1.1      matt #define	 UFCON_TXFIFO_RESET	__BIT(2)
     95       1.1      matt #define	 UFCON_RXFIFO_RESET	__BIT(1)
     96       1.1      matt #define	 UFCON_FIFO_ENABLE	__BIT(0)
     97       1.1      matt #define	SSCOM_UMCON		0x0c	/* MODEM control */
     98       1.1      matt #define  UMCON_RTSTRIGGER	__BITS(7,5)
     99       1.1      matt #define  UMCON_AFC		__BIT(4)
    100       1.1      matt #define  UMCON_MODEMINT_ENABLE	__BIT(3)
    101       1.1      matt #define	 UMCON_RTS		__BIT(0)	/* Request to send */
    102       1.1      matt #define	SSCOM_UTRSTAT		0x10	/* Status register */
    103       1.1      matt #define  UTRSTAT_RXFIFOCNT	__BITS(23,16)
    104       1.1      matt #define  UTRSTAT_TXDMA_FSM	__BITS(15,12)
    105       1.1      matt #define  UTRSTAT_RXDMA_FSM	__BITS(11,8)
    106       1.1      matt #define  UTRSTAT_RXTIMEOUT	__BIT(3)
    107       1.1      matt #define	 UTRSTAT_TXSHIFTER_EMPTY __BIT(2)
    108       1.1      matt #define	 UTRSTAT_TXEMPTY	__BIT(1) /* TX fifo or buffer empty */
    109       1.1      matt #define	 UTRSTAT_RXREADY	__BIT(0) /* RX fifo or buffer is not empty */
    110       1.1      matt #define	SSCOM_UERSTAT		0x14	/* Error status register */
    111       1.1      matt #define	 UERSTAT_BREAK		__BIT(3) /* Break signal */
    112       1.1      matt #define	 UERSTAT_FRAME		__BIT(2) /* Frame error */
    113       1.1      matt #define	 UERSTAT_PARITY		__BIT(1) /* Parity error */
    114       1.1      matt #define	 UERSTAT_OVERRUN	__BIT(0) /* Overrun */
    115       1.1      matt #define	 UERSTAT_ALL_ERRORS (UERSTAT_OVERRUN|UERSTAT_BREAK|UERSTAT_FRAME|UERSTAT_PARITY)
    116       1.1      matt #define	SSCOM_UFSTAT		0x18	/* Fifo status register */
    117       1.1      matt #define	 UFSTAT_TXFULL		__BIT(24) /* Tx fifo full */
    118       1.1      matt #define	 UFSTAT_TXCOUNT	  	__BITS(23,16)	/* TX FIFO count */
    119       1.1      matt #define  UFSTAT_RXERROR		__BIT(9)
    120       1.1      matt #define	 UFSTAT_RXFULL		__BIT(8) /* Rx fifo full */
    121       1.1      matt #define	 UFSTAT_RXCOUNT		__BITS(7,0)	/* RX FIFO count */
    122       1.1      matt #define	SSCOM_UMSTAT		0x1c	/* Modem status register */
    123       1.1      matt #define  UMSTAT_DCTS		__BIT(4)
    124       1.1      matt #define	 UMSTAT_CTS		__BIT(0) /* Clear to send */
    125       1.1      matt #if _BYTE_ORDER == _LITTLE_ENDIAN
    126       1.1      matt #define	SSCOM_UTXH		0x20	/* Transmit data register */
    127       1.1      matt #define	SSCOM_URXH		0x24	/* Receive data register */
    128       1.1      matt #else
    129       1.1      matt #define	SSCOM_UTXH		0x23	/* Transmit data register */
    130       1.1      matt #define	SSCOM_URXH		0x27	/* Receive data register */
    131       1.1      matt #endif
    132       1.1      matt #define	SSCOM_UBRDIV		0x28	/* baud-rate divisor [15:0] */
    133       1.1      matt #define	SSCOM_UFRACVAL		0x2C	/* baud-rate fraction [3:0] */
    134       1.1      matt 
    135       1.1      matt /* Interrupt controller */
    136       1.1      matt #define SSCOM_UINTP		0x30	/* interrupt source */
    137       1.1      matt #define SSCOM_UINTSP		0x34	/* pending interrupts */
    138       1.1      matt #define SSCOM_UINTM		0x38	/* interrupt masking */
    139       1.1      matt #define   UINT_MODEM		__BIT(3)
    140       1.1      matt #define   UINT_TXD		__BIT(2)
    141       1.1      matt #define   UINT_ERROR		__BIT(1)
    142       1.1      matt #define   UINT_RXD		__BIT(0)
    143       1.1      matt 
    144       1.1      matt #define	SSCOM_SIZE  0x3C
    145       1.1      matt 
    146       1.1      matt #endif /* _ARM_SAMSUNG_SSCOM_REG_H_ */
    147       1.1      matt 
    148