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
{
10
u32
dr
;
11
u32
rsr_ecr
;
12
u8
rsvd1
[0x10];
13
u32
fr
;
14
u8
rsvd2
[0x4];
15
u32
ilpr
;
16
u32
ibrd
;
17
u32
fbrd
;
18
u32
lcr_h
;
19
u32
cr
;
20
u32
ifls
;
21
u32
imsc
;
22
u32
ris
;
23
u32
mis
;
24
u32
icr
;
25
u32
dmacr
;
26
u8
rsvd3
[0xf94];
27
u32
periphid0
;
28
u32
periphid1
;
29
u32
periphid2
;
30
u32
periphid3
;
31
u32
cellid0
;
32
u32
cellid1
;
33
u32
cellid2
;
34
u32
cellid3
;
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
check_member(pl011_uart, cellid3, 0xffc)
u32
uint32_t u32
Definition:
stdint.h:51
u8
uint8_t u8
Definition:
stdint.h:45
pl011_uart
Definition:
pl011.h:9
pl011_uart::imsc
u32 imsc
Definition:
pl011.h:21
pl011_uart::fbrd
u32 fbrd
Definition:
pl011.h:17
pl011_uart::periphid2
u32 periphid2
Definition:
pl011.h:29
pl011_uart::rsr_ecr
u32 rsr_ecr
Definition:
pl011.h:11
pl011_uart::cellid1
u32 cellid1
Definition:
pl011.h:32
pl011_uart::ilpr
u32 ilpr
Definition:
pl011.h:15
pl011_uart::cellid0
u32 cellid0
Definition:
pl011.h:31
pl011_uart::ibrd
u32 ibrd
Definition:
pl011.h:16
pl011_uart::icr
u32 icr
Definition:
pl011.h:24
pl011_uart::dr
u32 dr
Definition:
pl011.h:10
pl011_uart::fr
u32 fr
Definition:
pl011.h:13
pl011_uart::rsvd3
u8 rsvd3[0xf94]
Definition:
pl011.h:26
pl011_uart::rsvd2
u8 rsvd2[0x4]
Definition:
pl011.h:14
pl011_uart::rsvd1
u8 rsvd1[0x10]
Definition:
pl011.h:12
pl011_uart::ifls
u32 ifls
Definition:
pl011.h:20
pl011_uart::mis
u32 mis
Definition:
pl011.h:23
pl011_uart::ris
u32 ris
Definition:
pl011.h:22
pl011_uart::cr
u32 cr
Definition:
pl011.h:19
pl011_uart::lcr_h
u32 lcr_h
Definition:
pl011.h:18
pl011_uart::dmacr
u32 dmacr
Definition:
pl011.h:25
pl011_uart::periphid0
u32 periphid0
Definition:
pl011.h:27
pl011_uart::periphid1
u32 periphid1
Definition:
pl011.h:28
pl011_uart::cellid2
u32 cellid2
Definition:
pl011.h:33
pl011_uart::cellid3
u32 cellid3
Definition:
pl011.h:34
pl011_uart::periphid3
u32 periphid3
Definition:
pl011.h:30
src
drivers
uart
pl011.h
Generated by
1.9.1