Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
crisv10.c File Reference
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/bitops.h>
#include <linux/seq_file.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/dma.h>
#include <arch/svinto.h>
#include <arch/system.h>
#include <linux/serial.h>
#include "crisv10.h"
#include <asm/fasttimer.h>
#include <arch/io_interface_mux.h>

Go to the source code of this file.

Data Structures

struct  control_pins
 

Macros

#define WAKEUP_CHARS   256
 
#define SERIAL_HANDLE_EARLY_ERRORS
 
#define SERIAL_DESCR_BUF_SIZE   256
 
#define SERIAL_PRESCALE_BASE   3125000 /* 3.125MHz */
 
#define DEF_BAUD_BASE   SERIAL_PRESCALE_BASE
 
#define MIN_FLUSH_TIME_USEC   250
 
#define TIMERD(x)
 
#define DINTR1(x)   /* irq on/off, errors */
 
#define DINTR2(x)   /* tx and rx */
 
#define DFLIP(x)
 
#define DFLOW(x)
 
#define DBAUD(x)
 
#define DLOG_INT_TRIG(x)
 
#define DEBUG_LOG(line, string, value)
 
#define CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS   5
 
#define DEF_BAUD   115200 /* 115.2 kbit/s */
 
#define STD_FLAGS   (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
 
#define DEF_RX   0x20 /* or SERIAL_CTRL_W >> 8 */
 
#define DEF_TX   0x80 /* or SERIAL_CTRL_B */
 
#define REG_DATA   0
 
#define REG_DATA_STATUS32   0 /* this is the 32 bit register R_SERIALx_READ */
 
#define REG_TR_DATA   0
 
#define REG_STATUS   1
 
#define REG_TR_CTRL   1
 
#define REG_REC_CTRL   2
 
#define REG_BAUD   3
 
#define REG_XOFF   4 /* this is a 32 bit register */
 
#define SER_RXD_MASK   IO_MASK(R_SERIAL0_STATUS, rxd)
 
#define SER_DATA_AVAIL_MASK   IO_MASK(R_SERIAL0_STATUS, data_avail)
 
#define SER_FRAMING_ERR_MASK   IO_MASK(R_SERIAL0_STATUS, framing_err)
 
#define SER_PAR_ERR_MASK   IO_MASK(R_SERIAL0_STATUS, par_err)
 
#define SER_OVERRUN_MASK   IO_MASK(R_SERIAL0_STATUS, overrun)
 
#define SER_ERROR_MASK   (SER_OVERRUN_MASK | SER_PAR_ERR_MASK | SER_FRAMING_ERR_MASK)
 
#define ERRCODE_SET_BREAK   (TTY_BREAK)
 
#define ERRCODE_INSERT   0x100
 
#define ERRCODE_INSERT_BREAK   (ERRCODE_INSERT | TTY_BREAK)
 
#define FORCE_EOP(info)   *R_SET_EOP = 1U << info->iseteop;
 
#define NR_PORTS   (sizeof(rs_table)/sizeof(struct e100_serial))
 
#define PROCSTAT(x)
 
#define E100_STRUCT_PORT(line, pinname)
 
#define E100_STRUCT_SHADOW(line, pinname)
 
#define E100_STRUCT_MASK(line, pinname)
 
#define DUMMY_DTR_MASK   1
 
#define DUMMY_RI_MASK   2
 
#define DUMMY_DSR_MASK   4
 
#define DUMMY_CD_MASK   8
 
#define CONTROL_PINS_PORT_NOT_USED(line)
 
#define dtr_port   port
 
#define dtr_shadow   shadow
 
#define ri_port   port
 
#define ri_shadow   shadow
 
#define dsr_port   port
 
#define dsr_shadow   shadow
 
#define cd_port   port
 
#define cd_shadow   shadow
 
#define E100_RTS_MASK   0x20
 
#define E100_CTS_MASK   0x40
 
#define E100_RTS_GET(info)   ((info)->rx_ctrl & E100_RTS_MASK)
 
#define E100_CTS_GET(info)   ((info)->ioport[REG_STATUS] & E100_CTS_MASK)
 
#define E100_DTR_GET(info)   ((*e100_modem_pins[(info)->line].dtr_shadow) & e100_modem_pins[(info)->line].dtr_mask)
 
#define E100_RI_GET(info)   ((*e100_modem_pins[(info)->line].ri_port) & e100_modem_pins[(info)->line].ri_mask)
 
#define E100_CD_GET(info)   ((*e100_modem_pins[(info)->line].cd_port) & e100_modem_pins[(info)->line].cd_mask)
 
#define E100_DSR_GET(info)   ((*e100_modem_pins[(info)->line].dsr_port) & e100_modem_pins[(info)->line].dsr_mask)
 
#define START_FLUSH_FAST_TIMER_TIME(info, string, usec)
 
#define START_FLUSH_FAST_TIMER(info, string)
 

Functions

unsigned long timer_data_to_ns (unsigned long timer_data)
 
void rs_hangup (struct tty_struct *tty)
 
 module_init (rs_init)
 

Variables

struct tty_driverserial_driver
 
unsigned long r_alt_ser_baudrate_shadow = 0
 

Macro Definition Documentation

#define cd_port   port

Definition at line 870 of file crisv10.c.

#define cd_shadow   shadow

Definition at line 871 of file crisv10.c.

#define CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS   5

Definition at line 154 of file crisv10.c.

#define CONTROL_PINS_PORT_NOT_USED (   line)
Value:
&dummy_ser[line], &dummy_ser[line], \

Definition at line 848 of file crisv10.c.

#define DBAUD (   x)

Definition at line 109 of file crisv10.c.

#define DEBUG_LOG (   line,
  string,
  value 
)

Definition at line 114 of file crisv10.c.

#define DEF_BAUD   115200 /* 115.2 kbit/s */

Definition at line 171 of file crisv10.c.

#define DEF_BAUD_BASE   SERIAL_PRESCALE_BASE

Definition at line 94 of file crisv10.c.

#define DEF_RX   0x20 /* or SERIAL_CTRL_W >> 8 */

Definition at line 173 of file crisv10.c.

#define DEF_TX   0x80 /* or SERIAL_CTRL_B */

Definition at line 175 of file crisv10.c.

#define DFLIP (   x)

Definition at line 106 of file crisv10.c.

#define DFLOW (   x)

Definition at line 108 of file crisv10.c.

#define DINTR1 (   x)    /* irq on/off, errors */

Definition at line 103 of file crisv10.c.

#define DINTR2 (   x)    /* tx and rx */

Definition at line 104 of file crisv10.c.

#define DLOG_INT_TRIG (   x)

Definition at line 110 of file crisv10.c.

#define dsr_port   port

Definition at line 868 of file crisv10.c.

#define dsr_shadow   shadow

Definition at line 869 of file crisv10.c.

#define dtr_port   port

Definition at line 864 of file crisv10.c.

#define dtr_shadow   shadow

Definition at line 865 of file crisv10.c.

#define DUMMY_CD_MASK   8

Definition at line 523 of file crisv10.c.

#define DUMMY_DSR_MASK   4

Definition at line 522 of file crisv10.c.

#define DUMMY_DTR_MASK   1

Definition at line 520 of file crisv10.c.

#define DUMMY_RI_MASK   2

Definition at line 521 of file crisv10.c.

#define E100_CD_GET (   info)    ((*e100_modem_pins[(info)->line].cd_port) & e100_modem_pins[(info)->line].cd_mask)

Definition at line 950 of file crisv10.c.

#define E100_CTS_GET (   info)    ((info)->ioport[REG_STATUS] & E100_CTS_MASK)

Definition at line 942 of file crisv10.c.

#define E100_CTS_MASK   0x40

Definition at line 930 of file crisv10.c.

#define E100_DSR_GET (   info)    ((*e100_modem_pins[(info)->line].dsr_port) & e100_modem_pins[(info)->line].dsr_mask)

Definition at line 953 of file crisv10.c.

#define E100_DTR_GET (   info)    ((*e100_modem_pins[(info)->line].dtr_shadow) & e100_modem_pins[(info)->line].dtr_mask)

Definition at line 946 of file crisv10.c.

#define E100_RI_GET (   info)    ((*e100_modem_pins[(info)->line].ri_port) & e100_modem_pins[(info)->line].ri_mask)

Definition at line 949 of file crisv10.c.

#define E100_RTS_GET (   info)    ((info)->rx_ctrl & E100_RTS_MASK)

Definition at line 940 of file crisv10.c.

#define E100_RTS_MASK   0x20

Definition at line 929 of file crisv10.c.

#define E100_STRUCT_MASK (   line,
  pinname 
)
Value:
((CONFIG_ETRAX_SER##line##_##pinname##_ON_PA_BIT >= 0)? \
(1<<CONFIG_ETRAX_SER##line##_##pinname##_ON_PA_BIT): ( \
(CONFIG_ETRAX_SER##line##_##pinname##_ON_PB_BIT >= 0)? \
(1<<CONFIG_ETRAX_SER##line##_##pinname##_ON_PB_BIT):DUMMY_##pinname##_MASK))

Definition at line 514 of file crisv10.c.

#define E100_STRUCT_PORT (   line,
  pinname 
)
Value:
((CONFIG_ETRAX_SER##line##_##pinname##_ON_PA_BIT >= 0)? \
(R_PORT_PA_DATA): ( \
(CONFIG_ETRAX_SER##line##_##pinname##_ON_PB_BIT >= 0)? \
(R_PORT_PB_DATA):&dummy_ser[line]))

Definition at line 503 of file crisv10.c.

#define E100_STRUCT_SHADOW (   line,
  pinname 
)
Value:
((CONFIG_ETRAX_SER##line##_##pinname##_ON_PA_BIT >= 0)? \
(CONFIG_ETRAX_SER##line##_##pinname##_ON_PB_BIT >= 0)? \
(&port_pb_data_shadow):&dummy_ser[line]))

Definition at line 509 of file crisv10.c.

#define ERRCODE_INSERT   0x100

Definition at line 199 of file crisv10.c.

#define ERRCODE_INSERT_BREAK   (ERRCODE_INSERT | TTY_BREAK)

Definition at line 200 of file crisv10.c.

#define ERRCODE_SET_BREAK   (TTY_BREAK)

Definition at line 198 of file crisv10.c.

#define FORCE_EOP (   info)    *R_SET_EOP = 1U << info->iseteop;

Definition at line 202 of file crisv10.c.

#define MIN_FLUSH_TIME_USEC   250

Definition at line 98 of file crisv10.c.

#define NR_PORTS   (sizeof(rs_table)/sizeof(struct e100_serial))

Definition at line 459 of file crisv10.c.

#define PROCSTAT (   x)

Definition at line 485 of file crisv10.c.

#define REG_BAUD   3

Definition at line 185 of file crisv10.c.

#define REG_DATA   0

Definition at line 179 of file crisv10.c.

#define REG_DATA_STATUS32   0 /* this is the 32 bit register R_SERIALx_READ */

Definition at line 180 of file crisv10.c.

#define REG_REC_CTRL   2

Definition at line 184 of file crisv10.c.

#define REG_STATUS   1

Definition at line 182 of file crisv10.c.

#define REG_TR_CTRL   1

Definition at line 183 of file crisv10.c.

#define REG_TR_DATA   0

Definition at line 181 of file crisv10.c.

#define REG_XOFF   4 /* this is a 32 bit register */

Definition at line 186 of file crisv10.c.

#define ri_port   port

Definition at line 866 of file crisv10.c.

#define ri_shadow   shadow

Definition at line 867 of file crisv10.c.

#define SER_DATA_AVAIL_MASK   IO_MASK(R_SERIAL0_STATUS, data_avail)

Definition at line 190 of file crisv10.c.

#define SER_ERROR_MASK   (SER_OVERRUN_MASK | SER_PAR_ERR_MASK | SER_FRAMING_ERR_MASK)

Definition at line 195 of file crisv10.c.

#define SER_FRAMING_ERR_MASK   IO_MASK(R_SERIAL0_STATUS, framing_err)

Definition at line 191 of file crisv10.c.

#define SER_OVERRUN_MASK   IO_MASK(R_SERIAL0_STATUS, overrun)

Definition at line 193 of file crisv10.c.

#define SER_PAR_ERR_MASK   IO_MASK(R_SERIAL0_STATUS, par_err)

Definition at line 192 of file crisv10.c.

#define SER_RXD_MASK   IO_MASK(R_SERIAL0_STATUS, rxd)

Definition at line 189 of file crisv10.c.

#define SERIAL_DESCR_BUF_SIZE   256

Definition at line 91 of file crisv10.c.

#define SERIAL_HANDLE_EARLY_ERRORS

Definition at line 88 of file crisv10.c.

#define SERIAL_PRESCALE_BASE   3125000 /* 3.125MHz */

Definition at line 93 of file crisv10.c.

#define START_FLUSH_FAST_TIMER (   info,
  string 
)

Definition at line 1708 of file crisv10.c.

#define START_FLUSH_FAST_TIMER_TIME (   info,
  string,
  usec 
)

Definition at line 1707 of file crisv10.c.

#define STD_FLAGS   (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)

Definition at line 172 of file crisv10.c.

#define TIMERD (   x)

Definition at line 101 of file crisv10.c.

#define WAKEUP_CHARS   256

Definition at line 74 of file crisv10.c.

Function Documentation

module_init ( rs_init  )
void rs_hangup ( struct tty_struct tty)

Definition at line 3946 of file crisv10.c.

unsigned long timer_data_to_ns ( unsigned long  timer_data)

Variable Documentation

unsigned long r_alt_ser_baudrate_shadow = 0

Definition at line 231 of file crisv10.c.

struct tty_driver* serial_driver

Definition at line 71 of file crisv10.c.