v850e_uart.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * include/asm-v850/v850e_uart.h -- common V850E on-chip UART driver
  3. *
  4. * Copyright (C) 2001,02,03 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. /* There's not actually a single UART implementation used by V850E CPUs,
  14. but rather a series of implementations that are all `close' to one
  15. another. This file corresponds to the single driver which handles all
  16. of them. */
  17. #ifndef __V850_V850E_UART_H__
  18. #define __V850_V850E_UART_H__
  19. #include <linux/config.h>
  20. #include <linux/termios.h>
  21. #include <asm/v850e_utils.h>
  22. #include <asm/types.h>
  23. #include <asm/machdep.h> /* Pick up chip-specific defs. */
  24. /* Include model-specific definitions. */
  25. #ifdef CONFIG_V850E_UART
  26. # ifdef CONFIG_V850E_UARTB
  27. # include <asm-v850/v850e_uartb.h>
  28. # else
  29. # include <asm-v850/v850e_uarta.h> /* original V850E UART */
  30. # endif
  31. #endif
  32. /* Optional capabilities some hardware provides. */
  33. /* This UART doesn't implement RTS/CTS by default, but some platforms
  34. implement them externally, so check to see if <asm/machdep.h> defined
  35. anything. */
  36. #ifdef V850E_UART_CTS
  37. #define v850e_uart_cts(n) V850E_UART_CTS(n)
  38. #else
  39. #define v850e_uart_cts(n) (1)
  40. #endif
  41. /* Do the same for RTS. */
  42. #ifdef V850E_UART_SET_RTS
  43. #define v850e_uart_set_rts(n,v) V850E_UART_SET_RTS(n,v)
  44. #else
  45. #define v850e_uart_set_rts(n,v) ((void)0)
  46. #endif
  47. /* This is the serial channel to use for the boot console (if desired). */
  48. #ifndef V850E_UART_CONSOLE_CHANNEL
  49. # define V850E_UART_CONSOLE_CHANNEL 0
  50. #endif
  51. #ifndef __ASSEMBLY__
  52. /* Setup a console using channel 0 of the builtin uart. */
  53. extern void v850e_uart_cons_init (unsigned chan);
  54. /* Configure and turn on uart channel CHAN, using the termios `control
  55. modes' bits in CFLAGS, and a baud-rate of BAUD. */
  56. void v850e_uart_configure (unsigned chan, unsigned cflags, unsigned baud);
  57. #endif /* !__ASSEMBLY__ */
  58. #endif /* __V850_V850E_UART_H__ */