18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Embedded Alley Solutions, source@embeddedalley.com. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _LINUX_SERIAL_PNX8XXX_H 78c2ecf20Sopenharmony_ci#define _LINUX_SERIAL_PNX8XXX_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <linux/serial_core.h> 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define PNX8XXX_NR_PORTS 2 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistruct pnx8xxx_port { 148c2ecf20Sopenharmony_ci struct uart_port port; 158c2ecf20Sopenharmony_ci struct timer_list timer; 168c2ecf20Sopenharmony_ci unsigned int old_status; 178c2ecf20Sopenharmony_ci}; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci/* register offsets */ 208c2ecf20Sopenharmony_ci#define PNX8XXX_LCR 0 218c2ecf20Sopenharmony_ci#define PNX8XXX_MCR 0x004 228c2ecf20Sopenharmony_ci#define PNX8XXX_BAUD 0x008 238c2ecf20Sopenharmony_ci#define PNX8XXX_CFG 0x00c 248c2ecf20Sopenharmony_ci#define PNX8XXX_FIFO 0x028 258c2ecf20Sopenharmony_ci#define PNX8XXX_ISTAT 0xfe0 268c2ecf20Sopenharmony_ci#define PNX8XXX_IEN 0xfe4 278c2ecf20Sopenharmony_ci#define PNX8XXX_ICLR 0xfe8 288c2ecf20Sopenharmony_ci#define PNX8XXX_ISET 0xfec 298c2ecf20Sopenharmony_ci#define PNX8XXX_PD 0xff4 308c2ecf20Sopenharmony_ci#define PNX8XXX_MID 0xffc 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_TXBREAK (1<<30) 338c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_PAREVN 0x10000000 348c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_PAREN 0x08000000 358c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_2STOPB 0x04000000 368c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_8BIT 0x01000000 378c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_TX_RST 0x00040000 388c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_RX_RST 0x00020000 398c2ecf20Sopenharmony_ci#define PNX8XXX_UART_LCR_RX_NEXT 0x00010000 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#define PNX8XXX_UART_MCR_SCR 0xFF000000 428c2ecf20Sopenharmony_ci#define PNX8XXX_UART_MCR_DCD 0x00800000 438c2ecf20Sopenharmony_ci#define PNX8XXX_UART_MCR_CTS 0x00100000 448c2ecf20Sopenharmony_ci#define PNX8XXX_UART_MCR_LOOP 0x00000010 458c2ecf20Sopenharmony_ci#define PNX8XXX_UART_MCR_RTS 0x00000002 468c2ecf20Sopenharmony_ci#define PNX8XXX_UART_MCR_DTR 0x00000001 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_TX 0x00000080 498c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_EMPTY 0x00000040 508c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_RCVTO 0x00000020 518c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_RX 0x00000010 528c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_RXOVRN 0x00000008 538c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_FRERR 0x00000004 548c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_BREAK 0x00000002 558c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_PARITY 0x00000001 568c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_ALLRX 0x0000003F 578c2ecf20Sopenharmony_ci#define PNX8XXX_UART_INT_ALLTX 0x000000C0 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_TXFIFO 0x001F0000 608c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_TXFIFO_STA (0x1f<<16) 618c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_RXBRK 0x00008000 628c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_RXFE 0x00004000 638c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_RXPAR 0x00002000 648c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_RXFIFO 0x00001F00 658c2ecf20Sopenharmony_ci#define PNX8XXX_UART_FIFO_RBRTHR 0x000000FF 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#endif 68