Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
mpsc.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/sysrq.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/mv643xx.h>
#include <linux/platform_device.h>
#include <linux/gfp.h>
#include <asm/io.h>
#include <asm/irq.h>

Go to the source code of this file.

Data Structures

struct  mpsc_rx_desc
 
struct  mpsc_tx_desc
 
struct  mpsc_shared_regs
 
struct  mpsc_port_info
 

Macros

#define MPSC_NUM_CTLRS   2
 
#define MPSC_RXR_ENTRIES   32
 
#define MPSC_RXRE_SIZE   dma_get_cache_alignment()
 
#define MPSC_RXR_SIZE   (MPSC_RXR_ENTRIES * MPSC_RXRE_SIZE)
 
#define MPSC_RXBE_SIZE   dma_get_cache_alignment()
 
#define MPSC_RXB_SIZE   (MPSC_RXR_ENTRIES * MPSC_RXBE_SIZE)
 
#define MPSC_TXR_ENTRIES   32
 
#define MPSC_TXRE_SIZE   dma_get_cache_alignment()
 
#define MPSC_TXR_SIZE   (MPSC_TXR_ENTRIES * MPSC_TXRE_SIZE)
 
#define MPSC_TXBE_SIZE   dma_get_cache_alignment()
 
#define MPSC_TXB_SIZE   (MPSC_TXR_ENTRIES * MPSC_TXBE_SIZE)
 
#define MPSC_DMA_ALLOC_SIZE
 
#define MPSC_MMCRL   0x0000
 
#define MPSC_MMCRH   0x0004
 
#define MPSC_MPCR   0x0008
 
#define MPSC_CHR_1   0x000c
 
#define MPSC_CHR_2   0x0010
 
#define MPSC_CHR_3   0x0014
 
#define MPSC_CHR_4   0x0018
 
#define MPSC_CHR_5   0x001c
 
#define MPSC_CHR_6   0x0020
 
#define MPSC_CHR_7   0x0024
 
#define MPSC_CHR_8   0x0028
 
#define MPSC_CHR_9   0x002c
 
#define MPSC_CHR_10   0x0030
 
#define MPSC_CHR_11   0x0034
 
#define MPSC_MPCR_FRZ   (1 << 9)
 
#define MPSC_MPCR_CL_5   0
 
#define MPSC_MPCR_CL_6   1
 
#define MPSC_MPCR_CL_7   2
 
#define MPSC_MPCR_CL_8   3
 
#define MPSC_MPCR_SBL_1   0
 
#define MPSC_MPCR_SBL_2   1
 
#define MPSC_CHR_2_TEV   (1<<1)
 
#define MPSC_CHR_2_TA   (1<<7)
 
#define MPSC_CHR_2_TTCS   (1<<9)
 
#define MPSC_CHR_2_REV   (1<<17)
 
#define MPSC_CHR_2_RA   (1<<23)
 
#define MPSC_CHR_2_CRD   (1<<25)
 
#define MPSC_CHR_2_EH   (1<<31)
 
#define MPSC_CHR_2_PAR_ODD   0
 
#define MPSC_CHR_2_PAR_SPACE   1
 
#define MPSC_CHR_2_PAR_EVEN   2
 
#define MPSC_CHR_2_PAR_MARK   3
 
#define MPSC_MRR   0x0000
 
#define MPSC_RCRR   0x0004
 
#define MPSC_TCRR   0x0008
 
#define SDMA_SDC   0x0000
 
#define SDMA_SDCM   0x0008
 
#define SDMA_RX_DESC   0x0800
 
#define SDMA_RX_BUF_PTR   0x0808
 
#define SDMA_SCRDP   0x0810
 
#define SDMA_TX_DESC   0x0c00
 
#define SDMA_SCTDP   0x0c10
 
#define SDMA_SFTDP   0x0c14
 
#define SDMA_DESC_CMDSTAT_PE   (1<<0)
 
#define SDMA_DESC_CMDSTAT_CDL   (1<<1)
 
#define SDMA_DESC_CMDSTAT_FR   (1<<3)
 
#define SDMA_DESC_CMDSTAT_OR   (1<<6)
 
#define SDMA_DESC_CMDSTAT_BR   (1<<9)
 
#define SDMA_DESC_CMDSTAT_MI   (1<<10)
 
#define SDMA_DESC_CMDSTAT_A   (1<<11)
 
#define SDMA_DESC_CMDSTAT_AM   (1<<12)
 
#define SDMA_DESC_CMDSTAT_CT   (1<<13)
 
#define SDMA_DESC_CMDSTAT_C   (1<<14)
 
#define SDMA_DESC_CMDSTAT_ES   (1<<15)
 
#define SDMA_DESC_CMDSTAT_L   (1<<16)
 
#define SDMA_DESC_CMDSTAT_F   (1<<17)
 
#define SDMA_DESC_CMDSTAT_P   (1<<18)
 
#define SDMA_DESC_CMDSTAT_EI   (1<<23)
 
#define SDMA_DESC_CMDSTAT_O   (1<<31)
 
#define SDMA_DESC_DFLT
 
#define SDMA_SDC_RFT   (1<<0)
 
#define SDMA_SDC_SFM   (1<<1)
 
#define SDMA_SDC_BLMR   (1<<6)
 
#define SDMA_SDC_BLMT   (1<<7)
 
#define SDMA_SDC_POVR   (1<<8)
 
#define SDMA_SDC_RIFB   (1<<9)
 
#define SDMA_SDCM_ERD   (1<<7)
 
#define SDMA_SDCM_AR   (1<<15)
 
#define SDMA_SDCM_STD   (1<<16)
 
#define SDMA_SDCM_TXD   (1<<23)
 
#define SDMA_SDCM_AT   (1<<31)
 
#define SDMA_0_CAUSE_RXBUF   (1<<0)
 
#define SDMA_0_CAUSE_RXERR   (1<<1)
 
#define SDMA_0_CAUSE_TXBUF   (1<<2)
 
#define SDMA_0_CAUSE_TXEND   (1<<3)
 
#define SDMA_1_CAUSE_RXBUF   (1<<8)
 
#define SDMA_1_CAUSE_RXERR   (1<<9)
 
#define SDMA_1_CAUSE_TXBUF   (1<<10)
 
#define SDMA_1_CAUSE_TXEND   (1<<11)
 
#define SDMA_CAUSE_RX_MASK
 
#define SDMA_CAUSE_TX_MASK
 
#define SDMA_INTR_CAUSE   0x0000
 
#define SDMA_INTR_MASK   0x0080
 
#define BRG_BCR   0x0000
 
#define BRG_BTR   0x0004
 
#define MPSC_MAJOR   204
 
#define MPSC_MINOR_START   44
 
#define MPSC_DRIVER_NAME   "MPSC"
 
#define MPSC_DEV_NAME   "ttyMM"
 
#define MPSC_VERSION   "1.00"
 
#define MPSC_CONSOLE   NULL
 

Functions

struct mpsc_rx_desc __attribute ((packed))
 
int mpsc_platform_register_driver (void)
 
void mpsc_platform_unregister_driver (void)
 
struct mpsc_port_infompsc_device_probe (int index)
 
struct mpsc_port_infompsc_device_remove (int index)
 
 module_init (mpsc_drv_init)
 
 module_exit (mpsc_drv_exit)
 
 MODULE_AUTHOR ("Mark A. Greer <[email protected]>")
 
 MODULE_DESCRIPTION ("Generic Marvell MPSC serial/UART driver")
 
 MODULE_VERSION (MPSC_VERSION)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_CHARDEV_MAJOR (MPSC_MAJOR)
 
 MODULE_ALIAS ("platform:"MPSC_CTLR_NAME)
 

Variables

u16 bufsize
 
u16 bytecnt
 
u32 cmdstat
 
u32 link
 
u32 buf_ptr
 
u16 shadow
 
struct mpsc_shared_regs __attribute
 

Macro Definition Documentation

#define BRG_BCR   0x0000

Definition at line 304 of file mpsc.c.

#define BRG_BTR   0x0004

Definition at line 305 of file mpsc.c.

#define MPSC_CHR_1   0x000c

Definition at line 205 of file mpsc.c.

#define MPSC_CHR_10   0x0030

Definition at line 214 of file mpsc.c.

#define MPSC_CHR_11   0x0034

Definition at line 215 of file mpsc.c.

#define MPSC_CHR_2   0x0010

Definition at line 206 of file mpsc.c.

#define MPSC_CHR_2_CRD   (1<<25)

Definition at line 230 of file mpsc.c.

#define MPSC_CHR_2_EH   (1<<31)

Definition at line 231 of file mpsc.c.

#define MPSC_CHR_2_PAR_EVEN   2

Definition at line 234 of file mpsc.c.

#define MPSC_CHR_2_PAR_MARK   3

Definition at line 235 of file mpsc.c.

#define MPSC_CHR_2_PAR_ODD   0

Definition at line 232 of file mpsc.c.

#define MPSC_CHR_2_PAR_SPACE   1

Definition at line 233 of file mpsc.c.

#define MPSC_CHR_2_RA   (1<<23)

Definition at line 229 of file mpsc.c.

#define MPSC_CHR_2_REV   (1<<17)

Definition at line 228 of file mpsc.c.

#define MPSC_CHR_2_TA   (1<<7)

Definition at line 226 of file mpsc.c.

#define MPSC_CHR_2_TEV   (1<<1)

Definition at line 225 of file mpsc.c.

#define MPSC_CHR_2_TTCS   (1<<9)

Definition at line 227 of file mpsc.c.

#define MPSC_CHR_3   0x0014

Definition at line 207 of file mpsc.c.

#define MPSC_CHR_4   0x0018

Definition at line 208 of file mpsc.c.

#define MPSC_CHR_5   0x001c

Definition at line 209 of file mpsc.c.

#define MPSC_CHR_6   0x0020

Definition at line 210 of file mpsc.c.

#define MPSC_CHR_7   0x0024

Definition at line 211 of file mpsc.c.

#define MPSC_CHR_8   0x0028

Definition at line 212 of file mpsc.c.

#define MPSC_CHR_9   0x002c

Definition at line 213 of file mpsc.c.

#define MPSC_CONSOLE   NULL

Definition at line 1810 of file mpsc.c.

#define MPSC_DEV_NAME   "ttyMM"

Definition at line 314 of file mpsc.c.

#define MPSC_DMA_ALLOC_SIZE
Value:

Definition at line 97 of file mpsc.c.

#define MPSC_DRIVER_NAME   "MPSC"

Definition at line 313 of file mpsc.c.

#define MPSC_MAJOR   204

Definition at line 311 of file mpsc.c.

#define MPSC_MINOR_START   44

Definition at line 312 of file mpsc.c.

#define MPSC_MMCRH   0x0004

Definition at line 203 of file mpsc.c.

#define MPSC_MMCRL   0x0000

Definition at line 202 of file mpsc.c.

#define MPSC_MPCR   0x0008

Definition at line 204 of file mpsc.c.

#define MPSC_MPCR_CL_5   0

Definition at line 218 of file mpsc.c.

#define MPSC_MPCR_CL_6   1

Definition at line 219 of file mpsc.c.

#define MPSC_MPCR_CL_7   2

Definition at line 220 of file mpsc.c.

#define MPSC_MPCR_CL_8   3

Definition at line 221 of file mpsc.c.

#define MPSC_MPCR_FRZ   (1 << 9)

Definition at line 217 of file mpsc.c.

#define MPSC_MPCR_SBL_1   0

Definition at line 222 of file mpsc.c.

#define MPSC_MPCR_SBL_2   1

Definition at line 223 of file mpsc.c.

#define MPSC_MRR   0x0000

Definition at line 238 of file mpsc.c.

#define MPSC_NUM_CTLRS   2

Definition at line 78 of file mpsc.c.

#define MPSC_RCRR   0x0004

Definition at line 239 of file mpsc.c.

#define MPSC_RXB_SIZE   (MPSC_RXR_ENTRIES * MPSC_RXBE_SIZE)

Definition at line 89 of file mpsc.c.

#define MPSC_RXBE_SIZE   dma_get_cache_alignment()

Definition at line 88 of file mpsc.c.

#define MPSC_RXR_ENTRIES   32

Definition at line 85 of file mpsc.c.

#define MPSC_RXR_SIZE   (MPSC_RXR_ENTRIES * MPSC_RXRE_SIZE)

Definition at line 87 of file mpsc.c.

#define MPSC_RXRE_SIZE   dma_get_cache_alignment()

Definition at line 86 of file mpsc.c.

#define MPSC_TCRR   0x0008

Definition at line 240 of file mpsc.c.

#define MPSC_TXB_SIZE   (MPSC_TXR_ENTRIES * MPSC_TXBE_SIZE)

Definition at line 95 of file mpsc.c.

#define MPSC_TXBE_SIZE   dma_get_cache_alignment()

Definition at line 94 of file mpsc.c.

#define MPSC_TXR_ENTRIES   32

Definition at line 91 of file mpsc.c.

#define MPSC_TXR_SIZE   (MPSC_TXR_ENTRIES * MPSC_TXRE_SIZE)

Definition at line 93 of file mpsc.c.

#define MPSC_TXRE_SIZE   dma_get_cache_alignment()

Definition at line 92 of file mpsc.c.

#define MPSC_VERSION   "1.00"

Definition at line 315 of file mpsc.c.

#define SDMA_0_CAUSE_RXBUF   (1<<0)

Definition at line 285 of file mpsc.c.

#define SDMA_0_CAUSE_RXERR   (1<<1)

Definition at line 286 of file mpsc.c.

#define SDMA_0_CAUSE_TXBUF   (1<<2)

Definition at line 287 of file mpsc.c.

#define SDMA_0_CAUSE_TXEND   (1<<3)

Definition at line 288 of file mpsc.c.

#define SDMA_1_CAUSE_RXBUF   (1<<8)

Definition at line 289 of file mpsc.c.

#define SDMA_1_CAUSE_RXERR   (1<<9)

Definition at line 290 of file mpsc.c.

#define SDMA_1_CAUSE_TXBUF   (1<<10)

Definition at line 291 of file mpsc.c.

#define SDMA_1_CAUSE_TXEND   (1<<11)

Definition at line 292 of file mpsc.c.

#define SDMA_CAUSE_RX_MASK
#define SDMA_CAUSE_TX_MASK
#define SDMA_DESC_CMDSTAT_A   (1<<11)

Definition at line 258 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_AM   (1<<12)

Definition at line 259 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_BR   (1<<9)

Definition at line 256 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_C   (1<<14)

Definition at line 261 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_CDL   (1<<1)

Definition at line 253 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_CT   (1<<13)

Definition at line 260 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_EI   (1<<23)

Definition at line 266 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_ES   (1<<15)

Definition at line 262 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_F   (1<<17)

Definition at line 264 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_FR   (1<<3)

Definition at line 254 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_L   (1<<16)

Definition at line 263 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_MI   (1<<10)

Definition at line 257 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_O   (1<<31)

Definition at line 267 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_OR   (1<<6)

Definition at line 255 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_P   (1<<18)

Definition at line 265 of file mpsc.c.

#define SDMA_DESC_CMDSTAT_PE   (1<<0)

Definition at line 252 of file mpsc.c.

#define SDMA_DESC_DFLT
Value:

Definition at line 269 of file mpsc.c.

#define SDMA_INTR_CAUSE   0x0000

Definition at line 300 of file mpsc.c.

#define SDMA_INTR_MASK   0x0080

Definition at line 301 of file mpsc.c.

#define SDMA_RX_BUF_PTR   0x0808

Definition at line 246 of file mpsc.c.

#define SDMA_RX_DESC   0x0800

Definition at line 245 of file mpsc.c.

#define SDMA_SCRDP   0x0810

Definition at line 247 of file mpsc.c.

#define SDMA_SCTDP   0x0c10

Definition at line 249 of file mpsc.c.

#define SDMA_SDC   0x0000

Definition at line 243 of file mpsc.c.

#define SDMA_SDC_BLMR   (1<<6)

Definition at line 274 of file mpsc.c.

#define SDMA_SDC_BLMT   (1<<7)

Definition at line 275 of file mpsc.c.

#define SDMA_SDC_POVR   (1<<8)

Definition at line 276 of file mpsc.c.

#define SDMA_SDC_RFT   (1<<0)

Definition at line 272 of file mpsc.c.

#define SDMA_SDC_RIFB   (1<<9)

Definition at line 277 of file mpsc.c.

#define SDMA_SDC_SFM   (1<<1)

Definition at line 273 of file mpsc.c.

#define SDMA_SDCM   0x0008

Definition at line 244 of file mpsc.c.

#define SDMA_SDCM_AR   (1<<15)

Definition at line 280 of file mpsc.c.

#define SDMA_SDCM_AT   (1<<31)

Definition at line 283 of file mpsc.c.

#define SDMA_SDCM_ERD   (1<<7)

Definition at line 279 of file mpsc.c.

#define SDMA_SDCM_STD   (1<<16)

Definition at line 281 of file mpsc.c.

#define SDMA_SDCM_TXD   (1<<23)

Definition at line 282 of file mpsc.c.

#define SDMA_SFTDP   0x0c14

Definition at line 250 of file mpsc.c.

#define SDMA_TX_DESC   0x0c00

Definition at line 248 of file mpsc.c.

Function Documentation

struct mpsc_rx_desc __attribute ( (packed)  )
MODULE_ALIAS ( "platform:"  MPSC_CTLR_NAME)
MODULE_ALIAS_CHARDEV_MAJOR ( MPSC_MAJOR  )
MODULE_AUTHOR ( "Mark A. Greer <[email protected]>"  )
MODULE_DESCRIPTION ( "Generic Marvell MPSC serial/UART driver )
module_exit ( mpsc_drv_exit  )
module_init ( mpsc_drv_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( MPSC_VERSION  )
struct mpsc_port_info* mpsc_device_probe ( int  index)
read
struct mpsc_port_info* mpsc_device_remove ( int  index)
read
int mpsc_platform_register_driver ( void  )
void mpsc_platform_unregister_driver ( void  )

Variable Documentation

struct mpsc_shared_regs __attribute
u32 buf_ptr

Definition at line 112 of file mpsc.c.

u16 bufsize

Definition at line 108 of file mpsc.c.

u16 bytecnt

Definition at line 109 of file mpsc.c.

u32 cmdstat

Definition at line 110 of file mpsc.c.

Definition at line 111 of file mpsc.c.

u16 shadow

Definition at line 117 of file mpsc.c.