summaryrefslogtreecommitdiff
path: root/jtag_uart.h
blob: 24317eb55ca3718e1089bbe3ea7c0abf547dc10c (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
/*
 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
 * Copyright (C) 2010 chysun2000@gmail.com
 *
 * 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 _JTAG_UART_H_
#define _JTAG_UART_H_

#include "device.h"

#define JTAG_UART_BASE		0x806810F0
#define JTAG_UART_SIZE		8
#define JTAG_UART_IRQ		IRQ_JTAG_UART
#define JTAG_UART_REG_COUNT	(JTAG_UART_SIZE / sizeof(uint32_t))
#define JTAG_UART_FIFO_SIZE	1

#define JTAG_UART_DATA_REG	0
#define JTAG_UART_CTRL_REG	1

#define JTAG_UART_DATA_DATA_MASK	0x000000FF
#define JTAG_UART_DATA_RVALID_MASK	0x00008000
#define JTAG_UART_DATA_RAVAIL_MASK	0xFFFF0000
#define JTAG_UART_DATA_RAVAIL_OFF	16

#define JTAG_UART_CTRL_RE_MASK		0x00000001
#define JTAG_UART_CTRL_WE_MASK		0x00000002
#define JTAG_UART_CTRL_RI_MASK		0x00000100
#define JTAG_UART_CTRL_RI_OFF		8
#define JTAG_UART_CTRL_WI_MASK		0x00000200
#define JTAG_UART_CTRL_AC_MASK		0x00000400
#define JTAG_UART_CTRL_WSPACE_MASK	0xFFFF0000
#define JTAG_UART_CTRL_WSPACE_OFF	16

extern struct device jtag_uart_core;

#endif /* _JTAG_UART_H_ */