coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pl011.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 
3 #ifndef __DRIVERS_UART_PL011_H
4 #define __DRIVERS_UART_PL011_H
5 
6 #include <types.h>
7 
8 /* PL011 r1p5 registers */
9 struct pl011_uart {
12  u8 rsvd1[0x10];
14  u8 rsvd2[0x4];
26  u8 rsvd3[0xf94];
35 };
36 check_member(pl011_uart, cellid3, 0xffc);
37 
38 /*************************************************************************/
39 /* Bit definitions from arm-trusted-firmware/include/drivers/arm/pl011.h */
40 /*************************************************************************/
41 /* Flag reg bits */
42 #define PL011_UARTFR_RI (1 << 8) /* Ring indicator */
43 #define PL011_UARTFR_TXFE (1 << 7) /* Transmit FIFO empty */
44 #define PL011_UARTFR_RXFF (1 << 6) /* Receive FIFO full */
45 #define PL011_UARTFR_TXFF (1 << 5) /* Transmit FIFO full */
46 #define PL011_UARTFR_RXFE (1 << 4) /* Receive FIFO empty */
47 #define PL011_UARTFR_BUSY (1 << 3) /* UART busy */
48 #define PL011_UARTFR_DCD (1 << 2) /* Data carrier detect */
49 #define PL011_UARTFR_DSR (1 << 1) /* Data set ready */
50 #define PL011_UARTFR_CTS (1 << 0) /* Clear to send */
51 
52 #define PL011_UARTFR_TXFF_BIT 5 /* Transmit FIFO full bit in
53  UARTFR register */
54 #define PL011_UARTFR_RXFE_BIT 4 /* Receive FIFO empty bit in
55  UARTFR register */
56 #define PL011_UARTFR_BUSY_BIT 3 /* UART busy bit in UARTFR
57  register */
58 
59 /* Control reg bits */
60 #define PL011_UARTCR_CTSEN (1 << 15) /* CTS hardware flow control
61  enable */
62 #define PL011_UARTCR_RTSEN (1 << 14) /* RTS hardware flow control
63  enable */
64 #define PL011_UARTCR_RTS (1 << 11) /* Request to send */
65 #define PL011_UARTCR_DTR (1 << 10) /* Data transmit ready. */
66 #define PL011_UARTCR_RXE (1 << 9) /* Receive enable */
67 #define PL011_UARTCR_TXE (1 << 8) /* Transmit enable */
68 #define PL011_UARTCR_LBE (1 << 7) /* Loopback enable */
69 #define PL011_UARTCR_UARTEN (1 << 0) /* UART Enable */
70 
71 /* FIFO Enabled / No Parity / 8 Data bit / One Stop Bit */
72 #define PL011_LINE_CONTROL (PL011_UARTLCR_H_FEN | PL011_UARTLCR_H_WLEN_8)
73 
74 /* Line Control Register Bits */
75 #define PL011_UARTLCR_H_SPS (1 << 7) /* Stick parity select */
76 #define PL011_UARTLCR_H_WLEN_8 (3 << 5)
77 #define PL011_UARTLCR_H_WLEN_7 (2 << 5)
78 #define PL011_UARTLCR_H_WLEN_6 (1 << 5)
79 #define PL011_UARTLCR_H_WLEN_5 (0 << 5)
80 #define PL011_UARTLCR_H_FEN (1 << 4) /* FIFOs Enable */
81 #define PL011_UARTLCR_H_STP2 (1 << 3) /* Two stop bits select */
82 #define PL011_UARTLCR_H_EPS (1 << 2) /* Even parity select */
83 #define PL011_UARTLCR_H_PEN (1 << 1) /* Parity Enable */
84 #define PL011_UARTLCR_H_BRK (1 << 0) /* Send break */
85 
86 #endif /* ! __DRIVERS_UART_PL011_H */
check_member(pl011_uart, cellid3, 0xffc)
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45
u32 imsc
Definition: pl011.h:21
u32 fbrd
Definition: pl011.h:17
u32 periphid2
Definition: pl011.h:29
u32 rsr_ecr
Definition: pl011.h:11
u32 cellid1
Definition: pl011.h:32
u32 ilpr
Definition: pl011.h:15
u32 cellid0
Definition: pl011.h:31
u32 ibrd
Definition: pl011.h:16
u32 icr
Definition: pl011.h:24
u32 dr
Definition: pl011.h:10
u32 fr
Definition: pl011.h:13
u8 rsvd3[0xf94]
Definition: pl011.h:26
u8 rsvd2[0x4]
Definition: pl011.h:14
u8 rsvd1[0x10]
Definition: pl011.h:12
u32 ifls
Definition: pl011.h:20
u32 mis
Definition: pl011.h:23
u32 ris
Definition: pl011.h:22
u32 cr
Definition: pl011.h:19
u32 lcr_h
Definition: pl011.h:18
u32 dmacr
Definition: pl011.h:25
u32 periphid0
Definition: pl011.h:27
u32 periphid1
Definition: pl011.h:28
u32 cellid2
Definition: pl011.h:33
u32 cellid3
Definition: pl011.h:34
u32 periphid3
Definition: pl011.h:30