coreboot-v3/include/uart8250.h
<<
>>
Prefs
   1#ifndef UART8250_H
   2#define UART8250_H
   3
   4/* Base Address */
   5#if defined(CONFIG_CONSOLE_SERIAL_COM1)
   6#define TTYSx_BASE 0x3f8
   7#elif defined(CONFIG_CONSOLE_SERIAL_COM2)
   8#define TTYSx_BASE 0x2f8
   9#else
  10#define TTYSx_BASE 0x3f8
  11#warning no serial port set
  12#endif
  13
  14#if defined(CONFIG_CONSOLE_SERIAL_115200)
  15#define TTYSx_BAUD 115200
  16#elif defined(CONFIG_CONSOLE_SERIAL_57600)
  17#define TTYSx_BAUD 57600
  18#elif defined(CONFIG_CONSOLE_SERIAL_38400)
  19#define TTYSx_BAUD 38400
  20#elif defined(CONFIG_CONSOLE_SERIAL_19200)
  21#define TTYSx_BAUD 19200
  22#elif defined(CONFIG_CONSOLE_SERIAL_9600)
  23#define TTYSx_BAUD 9600
  24#else                           // default
  25#define TTYSx_BAUD 115200
  26#warning no serial speed set
  27#endif
  28
  29#if ((115200%TTYSx_BAUD) != 0)
  30#error Bad ttyS0 baud rate
  31#endif
  32
  33#define TTYSx_DIV       (115200/TTYSx_BAUD)
  34
  35/* Line Control Settings */
  36#ifndef TTYSx_LCS
  37/* Set 8bit, 1 stop bit, no parity */
  38#define TTYSx_LCS       0x3
  39#endif
  40
  41#define UART_LCS        TTYSx_LCS
  42
  43unsigned char uart8250_rx_byte(unsigned base_port);
  44int uart8250_can_rx_byte(unsigned base_port);
  45void uart8250_tx_byte(unsigned base_port, unsigned char data);
  46void uart8250_init(unsigned base_port, unsigned divisor, unsigned lcs);
  47
  48#endif /* UART8250_H */
  49
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.