Home | History | Annotate | Line # | Download | only in dev
plcomreg.h revision 1.1.164.1
      1  1.1.164.1       mrg /*	$NetBSD: plcomreg.h,v 1.1.164.1 2012/04/29 23:04:39 mrg Exp $	*/
      2        1.1  rearnsha 
      3        1.1  rearnsha /*-
      4        1.1  rearnsha  * Copyright (c) 2001 ARM Ltd
      5        1.1  rearnsha  * All rights reserved.
      6        1.1  rearnsha  *
      7        1.1  rearnsha  * Redistribution and use in source and binary forms, with or without
      8        1.1  rearnsha  * modification, are permitted provided that the following conditions
      9        1.1  rearnsha  * are met:
     10        1.1  rearnsha  * 1. Redistributions of source code must retain the above copyright
     11        1.1  rearnsha  *    notice, this list of conditions and the following disclaimer.
     12        1.1  rearnsha  * 2. Redistributions in binary form must reproduce the above copyright
     13        1.1  rearnsha  *    notice, this list of conditions and the following disclaimer in the
     14        1.1  rearnsha  *    documentation and/or other materials provided with the distribution.
     15        1.1  rearnsha  * 3. The name of the company may not be used to endorse or promote
     16        1.1  rearnsha  *    products derived from this software without specific prior written
     17        1.1  rearnsha  *    permission.
     18        1.1  rearnsha  *
     19        1.1  rearnsha  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     20        1.1  rearnsha  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     21        1.1  rearnsha  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22        1.1  rearnsha  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     23        1.1  rearnsha  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     24        1.1  rearnsha  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     25        1.1  rearnsha  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26        1.1  rearnsha  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27        1.1  rearnsha  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28        1.1  rearnsha  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29        1.1  rearnsha  * SUCH DAMAGE.
     30        1.1  rearnsha */
     31        1.1  rearnsha 
     32        1.1  rearnsha 
     33        1.1  rearnsha #define	PLCOM_FREQ	1843200	/* 16-bit baud rate divisor */
     34        1.1  rearnsha #define	PLCOM_TOLERANCE	30	/* baud rate tolerance, in 0.1% units */
     35        1.1  rearnsha 
     36        1.1  rearnsha /* control register */
     37  1.1.164.1       mrg #define	CR_LBE		0x80	/* Loopback enable */
     38  1.1.164.1       mrg #define	CR_RTIE		0x40	/* Receive timeout interrupt enable */
     39  1.1.164.1       mrg #define	CR_TIE		0x20	/* Transmit interrupt enable */
     40  1.1.164.1       mrg #define	CR_RIE		0x10	/* Receive interrrupt enable */
     41  1.1.164.1       mrg #define	CR_MSIE		0x08	/* Modem status interrupt enable */
     42  1.1.164.1       mrg #define	CR_SIRLP	0x04	/* IrDA SIR Low power mode */
     43  1.1.164.1       mrg #define	CR_SIREN	0x02	/* SIR Enable */
     44  1.1.164.1       mrg #define	CR_UARTEN	0x01	/* Uart enable */
     45        1.1  rearnsha 
     46        1.1  rearnsha /* interrupt identification register */
     47        1.1  rearnsha #define	IIR_IMASK	0x0f
     48        1.1  rearnsha #define	IIR_RTIS	0x08
     49        1.1  rearnsha #define	IIR_TIS		0x04
     50        1.1  rearnsha #define	IIR_RIS		0x02
     51        1.1  rearnsha #define	IIR_MIS		0x01
     52        1.1  rearnsha 
     53        1.1  rearnsha /* line control register */
     54  1.1.164.1       mrg #define	LCR_WLEN	0x60	/* Mask of size bits */
     55        1.1  rearnsha #define	LCR_8BITS	0x60	/* 8 bits per serial word */
     56        1.1  rearnsha #define	LCR_7BITS	0x40	/* 7 bits */
     57        1.1  rearnsha #define	LCR_6BITS	0x20	/* 6 bits */
     58        1.1  rearnsha #define	LCR_5BITS	0x00	/* 5 bits */
     59  1.1.164.1       mrg #define	LCR_FEN		0x10	/* FIFO enable */
     60        1.1  rearnsha #define	LCR_STP2	0x08	/* 2 stop bits per serial word */
     61  1.1.164.1       mrg #define	LCR_EPS		0x04	/* Even parity select */
     62  1.1.164.1       mrg #define	LCR_PEN		0x02	/* Parity enable */
     63        1.1  rearnsha #define	LCR_PEVEN	(LCR_PEN | LCR_EPS)
     64        1.1  rearnsha #define	LCR_PODD	LCR_PEN
     65        1.1  rearnsha #define	LCR_PNONE	0x00	/* No parity */
     66        1.1  rearnsha #define	LCR_BRK		0x01	/* Break Control */
     67        1.1  rearnsha 
     68        1.1  rearnsha /* modem control register */
     69        1.1  rearnsha #define	MCR_RTS		0x02	/* Request To Send */
     70        1.1  rearnsha #define	MCR_DTR		0x01	/* Data Terminal Ready */
     71        1.1  rearnsha 
     72        1.1  rearnsha /* receive status register */
     73        1.1  rearnsha 
     74  1.1.164.1       mrg #define	RSR_OE		0x08	/* Overrun Error */
     75  1.1.164.1       mrg #define	RSR_BE		0x04	/* Break */
     76  1.1.164.1       mrg #define	RSR_PE		0x02	/* Parity Error */
     77  1.1.164.1       mrg #define	RSR_FE		0x01	/* Framing Error */
     78        1.1  rearnsha 
     79        1.1  rearnsha /* flag register */
     80        1.1  rearnsha #define	FR_TXFE		0x80	/* Transmit fifo empty */
     81        1.1  rearnsha #define	FR_RXFF		0x40	/* Recive fifo full */
     82        1.1  rearnsha #define	FR_TXFF		0x20	/* Transmit fifo full */
     83        1.1  rearnsha #define	FR_RXFE		0x10	/* Receive fifo empty */
     84        1.1  rearnsha #define	FR_BUSY		0x08	/* Uart Busy */
     85        1.1  rearnsha #define	FR_DCD		0x04	/* Data carrier detect */
     86        1.1  rearnsha #define	FR_DSR		0x02	/* Data set ready */
     87        1.1  rearnsha #define	FR_CTS		0x01	/* Clear to send */
     88        1.1  rearnsha 
     89        1.1  rearnsha /* modem status register */
     90        1.1  rearnsha /* All deltas are from the last read of the MSR. */
     91        1.1  rearnsha #define	MSR_DCD		FR_DCD
     92        1.1  rearnsha #define	MSR_DSR		FR_DSR
     93        1.1  rearnsha #define	MSR_CTS		FR_CTS
     94        1.1  rearnsha 
     95        1.1  rearnsha /* Register offsets */
     96  1.1.164.1       mrg #define	plcom_dr	0x00
     97  1.1.164.1       mrg #define	plcom_rsr	0x04
     98  1.1.164.1       mrg #define	plcom_ecr	0x04
     99  1.1.164.1       mrg #define	plcom_lcr	0x08
    100  1.1.164.1       mrg #define	plcom_dlbh	0x0c
    101  1.1.164.1       mrg #define	plcom_dlbl	0x10
    102  1.1.164.1       mrg #define	plcom_cr	0x14
    103  1.1.164.1       mrg #define	plcom_fr	0x18
    104  1.1.164.1       mrg #define	plcom_iir	0x1c
    105  1.1.164.1       mrg #define	plcom_icr	0x1c
    106  1.1.164.1       mrg #define	plcom_ilpr	0x20
    107        1.1  rearnsha 
    108        1.1  rearnsha /* IFPGA specific */
    109  1.1.164.1       mrg #define	PLCOM_UART_SIZE	0x24
    110