]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/serial.h
mmc: remove the unnecessary define and fix the wrong bit control
[people/ms/u-boot.git] / include / serial.h
CommitLineData
281e00a3
WD
1#ifndef __SERIAL_H__
2#define __SERIAL_H__
3
7b826c2f
MF
4#include <post.h>
5
281e00a3 6struct serial_device {
f6add132 7 /* enough bytes to match alignment of following func pointer */
78322d63 8 char name[16];
281e00a3 9
89143fb3
MV
10 int (*start)(void);
11 int (*stop)(void);
78322d63
MV
12 void (*setbrg)(void);
13 int (*getc)(void);
14 int (*tstc)(void);
15 void (*putc)(const char c);
16 void (*puts)(const char *s);
7b826c2f 17#if CONFIG_POST & CONFIG_SYS_POST_UART
78322d63 18 void (*loop)(int);
7b826c2f 19#endif
78322d63 20 struct serial_device *next;
281e00a3
WD
21};
22
bfb7d7a3
MV
23void default_serial_puts(const char *s);
24
281e00a3
WD
25extern struct serial_device serial_smc_device;
26extern struct serial_device serial_scc_device;
a6e6f7f4
GF
27extern struct serial_device *default_serial_console(void);
28
3fb85889 29#if defined(CONFIG_405GP) || \
a6e6f7f4
GF
30 defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
31 defined(CONFIG_405EX) || defined(CONFIG_440) || \
32 defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
33 defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
34 defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
6d6c0bae 35 defined(CONFIG_TEGRA) || defined(CONFIG_SYS_COREBOOT) || \
7636ebe1 36 defined(CONFIG_MICROBLAZE)
ff36fd85
WD
37extern struct serial_device serial0_device;
38extern struct serial_device serial1_device;
abc0ed8d
MV
39#endif
40
0fd30252
WD
41extern struct serial_device eserial1_device;
42extern struct serial_device eserial2_device;
ff36fd85 43
635f330f 44extern void serial_register(struct serial_device *);
281e00a3 45extern void serial_initialize(void);
52cb4d4f 46extern void serial_stdio_init(void);
7813ca9b 47extern int serial_assign(const char *name);
281e00a3
WD
48extern void serial_reinit_all(void);
49
6299487e 50/* For usbtty */
2ec1abea
TR
51#ifdef CONFIG_USB_TTY
52
6299487e
TR
53extern int usbtty_getc(void);
54extern void usbtty_putc(const char c);
55extern void usbtty_puts(const char *str);
56extern int usbtty_tstc(void);
57
2ec1abea
TR
58#else
59
60/* stubs */
61#define usbtty_getc() 0
62#define usbtty_putc(a)
63#define usbtty_puts(a)
64#define usbtty_tstc() 0
65
66#endif /* CONFIG_USB_TTY */
67
036036d7 68#if defined(CONFIG_MPC512X)
8e234e33
AG
69extern struct stdio_dev *open_port(int num, int baudrate);
70extern int close_port(int num);
71extern int write_port(struct stdio_dev *port, char *buf);
72extern int read_port(struct stdio_dev *port, char *buf, int size);
73#endif
74
281e00a3 75#endif