Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mxs-auart.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <linux/device.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/pinctrl/consumer.h>
#include <linux/of_device.h>
#include <asm/cacheflush.h>

Go to the source code of this file.

Data Structures

struct  mxs_auart_port
 

Macros

#define MXS_AUART_PORTS   5
 
#define AUART_CTRL0   0x00000000
 
#define AUART_CTRL0_SET   0x00000004
 
#define AUART_CTRL0_CLR   0x00000008
 
#define AUART_CTRL0_TOG   0x0000000c
 
#define AUART_CTRL1   0x00000010
 
#define AUART_CTRL1_SET   0x00000014
 
#define AUART_CTRL1_CLR   0x00000018
 
#define AUART_CTRL1_TOG   0x0000001c
 
#define AUART_CTRL2   0x00000020
 
#define AUART_CTRL2_SET   0x00000024
 
#define AUART_CTRL2_CLR   0x00000028
 
#define AUART_CTRL2_TOG   0x0000002c
 
#define AUART_LINECTRL   0x00000030
 
#define AUART_LINECTRL_SET   0x00000034
 
#define AUART_LINECTRL_CLR   0x00000038
 
#define AUART_LINECTRL_TOG   0x0000003c
 
#define AUART_LINECTRL2   0x00000040
 
#define AUART_LINECTRL2_SET   0x00000044
 
#define AUART_LINECTRL2_CLR   0x00000048
 
#define AUART_LINECTRL2_TOG   0x0000004c
 
#define AUART_INTR   0x00000050
 
#define AUART_INTR_SET   0x00000054
 
#define AUART_INTR_CLR   0x00000058
 
#define AUART_INTR_TOG   0x0000005c
 
#define AUART_DATA   0x00000060
 
#define AUART_STAT   0x00000070
 
#define AUART_DEBUG   0x00000080
 
#define AUART_VERSION   0x00000090
 
#define AUART_AUTOBAUD   0x000000a0
 
#define AUART_CTRL0_SFTRST   (1 << 31)
 
#define AUART_CTRL0_CLKGATE   (1 << 30)
 
#define AUART_CTRL2_CTSEN   (1 << 15)
 
#define AUART_CTRL2_RTSEN   (1 << 14)
 
#define AUART_CTRL2_RTS   (1 << 11)
 
#define AUART_CTRL2_RXE   (1 << 9)
 
#define AUART_CTRL2_TXE   (1 << 8)
 
#define AUART_CTRL2_UARTEN   (1 << 0)
 
#define AUART_LINECTRL_BAUD_DIVINT_SHIFT   16
 
#define AUART_LINECTRL_BAUD_DIVINT_MASK   0xffff0000
 
#define AUART_LINECTRL_BAUD_DIVINT(v)   (((v) & 0xffff) << 16)
 
#define AUART_LINECTRL_BAUD_DIVFRAC_SHIFT   8
 
#define AUART_LINECTRL_BAUD_DIVFRAC_MASK   0x00003f00
 
#define AUART_LINECTRL_BAUD_DIVFRAC(v)   (((v) & 0x3f) << 8)
 
#define AUART_LINECTRL_WLEN_MASK   0x00000060
 
#define AUART_LINECTRL_WLEN(v)   (((v) & 0x3) << 5)
 
#define AUART_LINECTRL_FEN   (1 << 4)
 
#define AUART_LINECTRL_STP2   (1 << 3)
 
#define AUART_LINECTRL_EPS   (1 << 2)
 
#define AUART_LINECTRL_PEN   (1 << 1)
 
#define AUART_LINECTRL_BRK   (1 << 0)
 
#define AUART_INTR_RTIEN   (1 << 22)
 
#define AUART_INTR_TXIEN   (1 << 21)
 
#define AUART_INTR_RXIEN   (1 << 20)
 
#define AUART_INTR_CTSMIEN   (1 << 17)
 
#define AUART_INTR_RTIS   (1 << 6)
 
#define AUART_INTR_TXIS   (1 << 5)
 
#define AUART_INTR_RXIS   (1 << 4)
 
#define AUART_INTR_CTSMIS   (1 << 1)
 
#define AUART_STAT_BUSY   (1 << 29)
 
#define AUART_STAT_CTS   (1 << 28)
 
#define AUART_STAT_TXFE   (1 << 27)
 
#define AUART_STAT_TXFF   (1 << 25)
 
#define AUART_STAT_RXFE   (1 << 24)
 
#define AUART_STAT_OERR   (1 << 19)
 
#define AUART_STAT_BERR   (1 << 18)
 
#define AUART_STAT_PERR   (1 << 17)
 
#define AUART_STAT_FERR   (1 << 16)
 
#define to_auart_port(u)   container_of(u, struct mxs_auart_port, port)
 

Functions

 MODULE_DEVICE_TABLE (of, mxs_auart_dt_ids)
 
 module_init (mxs_auart_init)
 
 module_exit (mxs_auart_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Freescale MXS application uart driver")
 
 MODULE_ALIAS ("platform:mxs-auart")
 

Macro Definition Documentation

#define AUART_AUTOBAUD   0x000000a0

Definition at line 70 of file mxs-auart.c.

#define AUART_CTRL0   0x00000000

Definition at line 42 of file mxs-auart.c.

#define AUART_CTRL0_CLKGATE   (1 << 30)

Definition at line 73 of file mxs-auart.c.

#define AUART_CTRL0_CLR   0x00000008

Definition at line 44 of file mxs-auart.c.

#define AUART_CTRL0_SET   0x00000004

Definition at line 43 of file mxs-auart.c.

#define AUART_CTRL0_SFTRST   (1 << 31)

Definition at line 72 of file mxs-auart.c.

#define AUART_CTRL0_TOG   0x0000000c

Definition at line 45 of file mxs-auart.c.

#define AUART_CTRL1   0x00000010

Definition at line 46 of file mxs-auart.c.

#define AUART_CTRL1_CLR   0x00000018

Definition at line 48 of file mxs-auart.c.

#define AUART_CTRL1_SET   0x00000014

Definition at line 47 of file mxs-auart.c.

#define AUART_CTRL1_TOG   0x0000001c

Definition at line 49 of file mxs-auart.c.

#define AUART_CTRL2   0x00000020

Definition at line 50 of file mxs-auart.c.

#define AUART_CTRL2_CLR   0x00000028

Definition at line 52 of file mxs-auart.c.

#define AUART_CTRL2_CTSEN   (1 << 15)

Definition at line 75 of file mxs-auart.c.

#define AUART_CTRL2_RTS   (1 << 11)

Definition at line 77 of file mxs-auart.c.

#define AUART_CTRL2_RTSEN   (1 << 14)

Definition at line 76 of file mxs-auart.c.

#define AUART_CTRL2_RXE   (1 << 9)

Definition at line 78 of file mxs-auart.c.

#define AUART_CTRL2_SET   0x00000024

Definition at line 51 of file mxs-auart.c.

#define AUART_CTRL2_TOG   0x0000002c

Definition at line 53 of file mxs-auart.c.

#define AUART_CTRL2_TXE   (1 << 8)

Definition at line 79 of file mxs-auart.c.

#define AUART_CTRL2_UARTEN   (1 << 0)

Definition at line 80 of file mxs-auart.c.

#define AUART_DATA   0x00000060

Definition at line 66 of file mxs-auart.c.

#define AUART_DEBUG   0x00000080

Definition at line 68 of file mxs-auart.c.

#define AUART_INTR   0x00000050

Definition at line 62 of file mxs-auart.c.

#define AUART_INTR_CLR   0x00000058

Definition at line 64 of file mxs-auart.c.

#define AUART_INTR_CTSMIEN   (1 << 17)

Definition at line 99 of file mxs-auart.c.

#define AUART_INTR_CTSMIS   (1 << 1)

Definition at line 103 of file mxs-auart.c.

#define AUART_INTR_RTIEN   (1 << 22)

Definition at line 96 of file mxs-auart.c.

#define AUART_INTR_RTIS   (1 << 6)

Definition at line 100 of file mxs-auart.c.

#define AUART_INTR_RXIEN   (1 << 20)

Definition at line 98 of file mxs-auart.c.

#define AUART_INTR_RXIS   (1 << 4)

Definition at line 102 of file mxs-auart.c.

#define AUART_INTR_SET   0x00000054

Definition at line 63 of file mxs-auart.c.

#define AUART_INTR_TOG   0x0000005c

Definition at line 65 of file mxs-auart.c.

#define AUART_INTR_TXIEN   (1 << 21)

Definition at line 97 of file mxs-auart.c.

#define AUART_INTR_TXIS   (1 << 5)

Definition at line 101 of file mxs-auart.c.

#define AUART_LINECTRL   0x00000030

Definition at line 54 of file mxs-auart.c.

#define AUART_LINECTRL2   0x00000040

Definition at line 58 of file mxs-auart.c.

#define AUART_LINECTRL2_CLR   0x00000048

Definition at line 60 of file mxs-auart.c.

#define AUART_LINECTRL2_SET   0x00000044

Definition at line 59 of file mxs-auart.c.

#define AUART_LINECTRL2_TOG   0x0000004c

Definition at line 61 of file mxs-auart.c.

#define AUART_LINECTRL_BAUD_DIVFRAC (   v)    (((v) & 0x3f) << 8)

Definition at line 87 of file mxs-auart.c.

#define AUART_LINECTRL_BAUD_DIVFRAC_MASK   0x00003f00

Definition at line 86 of file mxs-auart.c.

#define AUART_LINECTRL_BAUD_DIVFRAC_SHIFT   8

Definition at line 85 of file mxs-auart.c.

#define AUART_LINECTRL_BAUD_DIVINT (   v)    (((v) & 0xffff) << 16)

Definition at line 84 of file mxs-auart.c.

#define AUART_LINECTRL_BAUD_DIVINT_MASK   0xffff0000

Definition at line 83 of file mxs-auart.c.

#define AUART_LINECTRL_BAUD_DIVINT_SHIFT   16

Definition at line 82 of file mxs-auart.c.

#define AUART_LINECTRL_BRK   (1 << 0)

Definition at line 94 of file mxs-auart.c.

#define AUART_LINECTRL_CLR   0x00000038

Definition at line 56 of file mxs-auart.c.

#define AUART_LINECTRL_EPS   (1 << 2)

Definition at line 92 of file mxs-auart.c.

#define AUART_LINECTRL_FEN   (1 << 4)

Definition at line 90 of file mxs-auart.c.

#define AUART_LINECTRL_PEN   (1 << 1)

Definition at line 93 of file mxs-auart.c.

#define AUART_LINECTRL_SET   0x00000034

Definition at line 55 of file mxs-auart.c.

#define AUART_LINECTRL_STP2   (1 << 3)

Definition at line 91 of file mxs-auart.c.

#define AUART_LINECTRL_TOG   0x0000003c

Definition at line 57 of file mxs-auart.c.

#define AUART_LINECTRL_WLEN (   v)    (((v) & 0x3) << 5)

Definition at line 89 of file mxs-auart.c.

#define AUART_LINECTRL_WLEN_MASK   0x00000060

Definition at line 88 of file mxs-auart.c.

#define AUART_STAT   0x00000070

Definition at line 67 of file mxs-auart.c.

#define AUART_STAT_BERR   (1 << 18)

Definition at line 111 of file mxs-auart.c.

#define AUART_STAT_BUSY   (1 << 29)

Definition at line 105 of file mxs-auart.c.

#define AUART_STAT_CTS   (1 << 28)

Definition at line 106 of file mxs-auart.c.

#define AUART_STAT_FERR   (1 << 16)

Definition at line 113 of file mxs-auart.c.

#define AUART_STAT_OERR   (1 << 19)

Definition at line 110 of file mxs-auart.c.

#define AUART_STAT_PERR   (1 << 17)

Definition at line 112 of file mxs-auart.c.

#define AUART_STAT_RXFE   (1 << 24)

Definition at line 109 of file mxs-auart.c.

#define AUART_STAT_TXFE   (1 << 27)

Definition at line 107 of file mxs-auart.c.

#define AUART_STAT_TXFF   (1 << 25)

Definition at line 108 of file mxs-auart.c.

#define AUART_VERSION   0x00000090

Definition at line 69 of file mxs-auart.c.

#define MXS_AUART_PORTS   5

Definition at line 40 of file mxs-auart.c.

#define to_auart_port (   u)    container_of(u, struct mxs_auart_port, port)

Definition at line 131 of file mxs-auart.c.

Function Documentation

MODULE_ALIAS ( "platform:mxs-auart"  )
MODULE_DESCRIPTION ( "Freescale MXS application uart driver )
MODULE_DEVICE_TABLE ( of  ,
mxs_auart_dt_ids   
)
module_exit ( mxs_auart_exit  )
module_init ( mxs_auart_init  )
MODULE_LICENSE ( "GPL"  )