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