1 /*
2  * xen/arch/arm/include/asm/imx-lpuart.h
3  *
4  * Common constant definition between early printk and the LPUART driver
5  *
6  * Peng Fan <peng.fan@nxp.com>
7  * Copyright 2022 NXP
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  */
19 
20 #ifndef __ASM_ARM_IMX_LPUART_H__
21 #define __ASM_ARM_IMX_LPUART_H__
22 
23 /* 32-bit register definition */
24 #define UARTBAUD          (0x10)
25 #define UARTSTAT          (0x14)
26 #define UARTCTRL          (0x18)
27 #define UARTDATA          (0x1C)
28 #define UARTMATCH         (0x20)
29 #define UARTMODIR         (0x24)
30 #define UARTFIFO          (0x28)
31 #define UARTWATER         (0x2c)
32 
33 #define UARTSTAT_TDRE     BIT(23, UL)
34 #define UARTSTAT_TC       BIT(22, UL)
35 #define UARTSTAT_RDRF     BIT(21, UL)
36 #define UARTSTAT_OR       BIT(19, UL)
37 
38 #define UARTBAUD_OSR_SHIFT    (24)
39 #define UARTBAUD_OSR_MASK     (0x1f)
40 #define UARTBAUD_SBR_MASK     (0x1fff)
41 #define UARTBAUD_BOTHEDGE     (0x00020000)
42 #define UARTBAUD_TDMAE        (0x00800000)
43 #define UARTBAUD_RDMAE        (0x00200000)
44 
45 #define UARTCTRL_TIE      BIT(23, UL)
46 #define UARTCTRL_TCIE     BIT(22, UL)
47 #define UARTCTRL_RIE      BIT(21, UL)
48 #define UARTCTRL_ILIE     BIT(20, UL)
49 #define UARTCTRL_TE       BIT(19, UL)
50 #define UARTCTRL_RE       BIT(18, UL)
51 #define UARTCTRL_M        BIT(4, UL)
52 
53 #define UARTWATER_RXCNT_OFF     24
54 
55 #endif /* __ASM_ARM_IMX_LPUART_H__ */
56 
57 /*
58  * Local variables:
59  * mode: C
60  * c-file-style: "BSD"
61  * c-basic-offset: 4
62  * indent-tabs-mode: nil
63  * End:
64  */
65