aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-v850/v850e_uart.h
blob: 5182fb4cc989fe2125868925d60fd6a12f4d1f58 (plain) (blame)
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
/*
 * include/asm-v850/v850e_uart.h -- common V850E on-chip UART driver
 *
 *  Copyright (C) 2001,02,03  NEC Electronics Corporation
 *  Copyright (C) 2001,02,03  Miles Bader <miles@gnu.org>
 *
 * 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.
 *
 * Written by Miles Bader <miles@gnu.org>
 */

/* There's not actually a single UART implementation used by V850E CPUs,
   but rather a series of implementations that are all `close' to one
   another.  This file corresponds to the single driver which handles all
   of them.  */

#ifndef __V850_V850E_UART_H__
#define __V850_V850E_UART_H__

#include <linux/termios.h>

#include <asm/v850e_utils.h>
#include <asm/types.h>
#include <asm/machdep.h>	/* Pick up chip-specific defs.  */


/* Include model-specific definitions.  */
#ifdef CONFIG_V850E_UART
# ifdef CONFIG_V850E_UARTB
#  include <asm-v850/v850e_uartb.h>
# else
#  include <asm-v850/v850e_uarta.h> /* original V850E UART */
# endif
#endif


/* Optional capabilities some hardware provides.  */

/* This UART doesn't implement RTS/CTS by default, but some platforms
   implement them externally, so check to see if <asm/machdep.h> defined
   anything.  */
#ifdef V850E_UART_CTS
#define v850e_uart_cts(n)		V850E_UART_CTS(n)
#else
#define v850e_uart_cts(n)		(1)
#endif

/* Do the same for RTS.  */
#ifdef V850E_UART_SET_RTS
#define v850e_uart_set_rts(n,v)		V850E_UART_SET_RTS(n,v)
#else
#define v850e_uart_set_rts(n,v)		((void)0)
#endif


/* This is the serial channel to use for the boot console (if desired).  */
#ifndef V850E_UART_CONSOLE_CHANNEL
# define V850E_UART_CONSOLE_CHANNEL 0
#endif


#ifndef __ASSEMBLY__

/* Setup a console using channel 0 of the builtin uart.  */
extern void v850e_uart_cons_init (unsigned chan);

/* Configure and turn on uart channel CHAN, using the termios `control
   modes' bits in CFLAGS, and a baud-rate of BAUD.  */
void v850e_uart_configure (unsigned chan, unsigned cflags, unsigned baud);

#endif /* !__ASSEMBLY__ */


#endif /* __V850_V850E_UART_H__ */