aboutsummaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-ks8695/regs-uart.h
blob: a27cb20502a36e20aeb28601848197bda0c1a3ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * linux/include/asm-arm/arch-ks8695/regs-uart.h
 *
 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
 * Copyright (C) 2006 Simtec Electronics
 *
 * KS8695 - UART register and bit definitions.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef KS8695_UART_H
#define KS8695_UART_H

#define KS8695_UART_OFFSET	(0xF0000 + 0xE000)
#define KS8695_UART_VA		(KS8695_IO_VA + KS8695_UART_OFFSET)
#define KS8695_UART_PA		(KS8695_IO_PA + KS8695_UART_OFFSET)


/*
 * UART registers
 */
#define KS8695_URRB	(0x00)		/* Receive Buffer Register */
#define KS8695_URTH	(0x04)		/* Transmit Holding Register */
#define KS8695_URFC	(0x08)		/* FIFO Control Register */
#define KS8695_URLC	(0x0C)		/* Line Control Register */
#define KS8695_URMC	(0x10)		/* Modem Control Register */
#define KS8695_URLS	(0x14)		/* Line Status Register */
#define KS8695_URMS	(0x18)		/* Modem Status Register */
#define KS8695_URBD	(0x1C)		/* Baud Rate Divisor Register */
#define KS8695_USR	(0x20)		/* Status Register */


/* FIFO Control Register */
#define URFC_URFRT	(3 << 6)	/* Receive FIFO Trigger Level */
#define		URFC_URFRT_1	(0 << 6)
#define		URFC_URFRT_4	(1 << 6)
#define		URFC_URFRT_8	(2 << 6)
#define		URFC_URFRT_14	(3 << 6)
#define URFC_URTFR	(1 << 2)	/* Transmit FIFO Reset */
#define URFC_URRFR	(1 << 1)	/* Receive FIFO Reset */
#define URFC_URFE	(1 << 0)	/* FIFO Enable */

/* Line Control Register */
#define URLC_URSBC	(1 << 6)	/* Set Break Condition */
#define URLC_PARITY	(7 << 3)	/* Parity */
#define		URPE_NONE	(0 << 3)
#define		URPE_ODD	(1 << 3)
#define		URPE_EVEN	(3 << 3)
#define		URPE_MARK	(5 << 3)
#define		URPE_SPACE	(7 << 3)
#define URLC_URSB	(1 << 2)	/* Stop Bits */
#define URLC_URCL	(3 << 0)	/* Character Length */
#define		URCL_5		(0 << 0)
#define		URCL_6		(1 << 0)
#define		URCL_7		(2 << 0)
#define		URCL_8		(3 << 0)

/* Modem Control Register */
#define URMC_URLB	(1 << 4)	/* Loop-back mode */
#define URMC_UROUT2	(1 << 3)	/* OUT2 signal */
#define URMC_UROUT1	(1 << 2)	/* OUT1 signal */
#define URMC_URRTS	(1 << 1)	/* Request to Send */
#define URMC_URDTR	(1 << 0)	/* Data Terminal Ready */

/* Line Status Register */
#define URLS_URRFE	(1 << 7)	/* Receive FIFO Error */
#define URLS_URTE	(1 << 6)	/* Transmit Empty */
#define URLS_URTHRE	(1 << 5)	/* Transmit Holding Register Empty */
#define URLS_URBI	(1 << 4)	/* Break Interrupt */
#define URLS_URFE	(1 << 3)	/* Framing Error */
#define URLS_URPE	(1 << 2)	/* Parity Error */
#define URLS_URROE	(1 << 1)	/* Receive Overrun Error */
#define URLS_URDR	(1 << 0)	/* Receive Data Ready */

/* Modem Status Register */
#define URMS_URDCD	(1 << 7)	/* Data Carrier Detect */
#define URMS_URRI	(1 << 6)	/* Ring Indicator */
#define URMS_URDSR	(1 << 5)	/* Data Set Ready */
#define URMS_URCTS	(1 << 4)	/* Clear to Send */
#define URMS_URDDCD	(1 << 3)	/* Delta Data Carrier Detect */
#define URMS_URTERI	(1 << 2)	/* Trailing Edge Ring Indicator */
#define URMS_URDDST	(1 << 1)	/* Delta Data Set Ready */
#define URMS_URDCTS	(1 << 0)	/* Delta Clear to Send */

/* Status Register */
#define USR_UTI		(1 << 0)	/* Timeout Indication */


#endif