Blame view

include/serial.h 1.95 KB
281e00a3b   wdenk   * Code cleanup
1
2
  #ifndef __SERIAL_H__
  #define __SERIAL_H__
7b826c2f3   Mike Frysinger   serial: implement...
3
  #include <post.h>
281e00a3b   wdenk   * Code cleanup
4
  struct serial_device {
f6add132f   Mike Frysinger   net/miiphy/serial...
5
  	/* enough bytes to match alignment of following func pointer */
78322d63e   Marek Vasut   serial: Coding st...
6
  	char	name[16];
281e00a3b   wdenk   * Code cleanup
7

89143fb3b   Marek Vasut   serial: Rename .i...
8
9
  	int	(*start)(void);
  	int	(*stop)(void);
78322d63e   Marek Vasut   serial: Coding st...
10
11
12
13
14
  	void	(*setbrg)(void);
  	int	(*getc)(void);
  	int	(*tstc)(void);
  	void	(*putc)(const char c);
  	void	(*puts)(const char *s);
7b826c2f3   Mike Frysinger   serial: implement...
15
  #if CONFIG_POST & CONFIG_SYS_POST_UART
78322d63e   Marek Vasut   serial: Coding st...
16
  	void	(*loop)(int);
7b826c2f3   Mike Frysinger   serial: implement...
17
  #endif
78322d63e   Marek Vasut   serial: Coding st...
18
  	struct serial_device	*next;
281e00a3b   wdenk   * Code cleanup
19
  };
bfb7d7a3d   Marek Vasut   serial: Implement...
20
  void default_serial_puts(const char *s);
281e00a3b   wdenk   * Code cleanup
21
22
  extern struct serial_device serial_smc_device;
  extern struct serial_device serial_scc_device;
a6e6f7f4d   Gerlando Falauto   serial: cosmetic ...
23
  extern struct serial_device *default_serial_console(void);
3fb858891   Matthias Fuchs   ppc4xx: Remove su...
24
  #if	defined(CONFIG_405GP) || \
a6e6f7f4d   Gerlando Falauto   serial: cosmetic ...
25
26
27
28
29
  	defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
  	defined(CONFIG_405EX) || defined(CONFIG_440) || \
  	defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
  	defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
  	defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
6d6c0baeb   Tom Warren   Tegra30: Add gene...
30
  	defined(CONFIG_TEGRA) || defined(CONFIG_SYS_COREBOOT) || \
7636ebe1d   Michal Simek   serial: Support s...
31
  	defined(CONFIG_MICROBLAZE)
ff36fd859   wdenk   * Patch by Leif L...
32
33
  extern struct serial_device serial0_device;
  extern struct serial_device serial1_device;
abc0ed8da   Marek Vasut   serial: ns16550: ...
34
  #endif
0fd30252c   Wolfgang Denk   Make the serial d...
35
36
  extern struct serial_device eserial1_device;
  extern struct serial_device eserial2_device;
ff36fd859   wdenk   * Patch by Leif L...
37

635f330fc   Mike Frysinger   Blackfin: uart: a...
38
  extern void serial_register(struct serial_device *);
281e00a3b   wdenk   * Code cleanup
39
  extern void serial_initialize(void);
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
40
  extern void serial_stdio_init(void);
7813ca9b6   Gerlando Falauto   serial: constify ...
41
  extern int serial_assign(const char *name);
281e00a3b   wdenk   * Code cleanup
42
  extern void serial_reinit_all(void);
6299487ef   Tom Rix   USBTTY make some ...
43
  /* For usbtty */
2ec1abea4   Tom Rix   OMAP3 zoom2 Use u...
44
  #ifdef CONFIG_USB_TTY
6299487ef   Tom Rix   USBTTY make some ...
45
46
47
48
  extern int usbtty_getc(void);
  extern void usbtty_putc(const char c);
  extern void usbtty_puts(const char *str);
  extern int usbtty_tstc(void);
2ec1abea4   Tom Rix   OMAP3 zoom2 Use u...
49
50
51
52
53
54
55
56
57
  #else
  
  /* stubs */
  #define usbtty_getc() 0
  #define usbtty_putc(a)
  #define usbtty_puts(a)
  #define usbtty_tstc() 0
  
  #endif /* CONFIG_USB_TTY */
036036d79   Marek Vasut   serial: Remove CO...
58
  #if defined(CONFIG_MPC512X)
8e234e33b   Anatolij Gustschin   mpc5121: add PSC ...
59
60
61
62
63
  extern struct stdio_dev *open_port(int num, int baudrate);
  extern int close_port(int num);
  extern int write_port(struct stdio_dev *port, char *buf);
  extern int read_port(struct stdio_dev *port, char *buf, int size);
  #endif
281e00a3b   wdenk   * Code cleanup
64
  #endif