1 /*
2  * xen/include/asm-arm/pl011-uart.h
3  *
4  * Common constant definition between early printk and the UART driver
5  * for the pl011 UART
6  *
7  * Tim Deegan <tim@xen.org>
8  * Copyright (c) 2011 Citrix Systems.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  */
20 
21 #ifndef __ASM_ARM_PL011_H
22 #define __ASM_ARM_PL011_H
23 
24 /* PL011 register addresses */
25 #define DR     (0x00)
26 #define RSR    (0x04)
27 #define FR     (0x18)
28 #define ILPR   (0x20)
29 #define IBRD   (0x24)
30 #define FBRD   (0x28)
31 #define LCR_H  (0x2c)
32 #define CR     (0x30)
33 #define IFLS   (0x34)
34 #define IMSC   (0x38)
35 #define RIS    (0x3c)
36 #define MIS    (0x40)
37 #define ICR    (0x44)
38 #define DMACR  (0x48)
39 
40 /* CR bits */
41 #define CTSEN  (1<<15) /* automatic CTS hardware flow control */
42 #define RTSEN  (1<<14) /* automatic RTS hardware flow control */
43 #define RTS    (1<<11) /* RTS signal */
44 #define DTR    (1<<10) /* DTR signal */
45 #define RXE    (1<<9) /* Receive enable */
46 #define TXE    (1<<8) /* Transmit enable */
47 #define UARTEN (1<<0) /* UART enable */
48 
49 /* FR bits */
50 #define TXFE   (1<<7) /* TX FIFO empty */
51 #define RXFE   (1<<4) /* RX FIFO empty */
52 #define TXFF   (1<<5) /* TX FIFO full */
53 #define RXFF   (1<<6) /* RX FIFO full */
54 #define BUSY   (1<<3) /* Transmit is not complete */
55 
56 /* LCR_H bits */
57 #define SPS    (1<<7) /* Stick parity select */
58 #define FEN    (1<<4) /* FIFO enable */
59 #define STP2   (1<<3) /* Two stop bits select */
60 #define EPS    (1<<2) /* Even parity select */
61 #define PEN    (1<<1) /* Parity enable */
62 #define BRK    (1<<0) /* Send break */
63 
64 /* Interrupt bits (IMSC, MIS, ICR) */
65 #define OEI   (1<<10) /* Overrun Error interrupt mask */
66 #define BEI   (1<<9)  /* Break Error interrupt mask */
67 #define PEI   (1<<8)  /* Parity Error interrupt mask */
68 #define FEI   (1<<7)  /* Framing Error interrupt mask */
69 #define RTI   (1<<6)  /* Receive Timeout interrupt mask */
70 #define TXI   (1<<5)  /* Transmit interrupt mask */
71 #define RXI   (1<<4)  /* Receive interrupt mask */
72 #define DSRMI (1<<3)  /* nUARTDSR Modem interrupt mask */
73 #define DCDMI (1<<2)  /* nUARTDCD Modem interrupt mask */
74 #define CTSMI (1<<1)  /* nUARTCTS Modem interrupt mask */
75 #define RIMI  (1<<0)  /* nUARTRI Modem interrupt mask */
76 #define ALLI  OEI|BEI|PEI|FEI|RTI|TXI|RXI|DSRMI|DCDMI|CTSMI|RIMI
77 
78 #endif /* __ASM_ARM_PL011_H */
79 
80 /*
81  * Local variables:
82  * mode: C
83  * c-file-style: "BSD"
84  * c-basic-offset: 4
85  * indent-tabs-mode: nil
86  * End:
87  */
88