summaryrefslogtreecommitdiff
path: root/uart.h
blob: b2c686dd4ca30cf8537287ea655f61d4eb246f36 (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
/*
 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
 *
 * This file is part of nios2sim-ng.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#ifndef _UART_H_
#define _UART_H_

#define UART_BASE		0x84842020
#define UART_SIZE		32
#define UART_REG_COUNT		(UART_SIZE / sizeof(uint32_t))

#define UART_RXDATA_REG		0
#define UART_TXDATA_REG		1
#define UART_STATUS_REG		2
#define UART_CONTROL_REG	3
#define UART_DIVISOR_REG	4
#define UART_EOP_REG		5

#define UART_STATUS_TRDY_MASK	0x40
#define UART_STATUS_RRDY_MASK	0x80

#define UART_CONTROL_TRDY_MASK	0x40
#define UART_CONTROL_RRDY_MASK	0x80

extern struct device uart_core;

#endif /* _UART_H_ */