18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci	Mantis PCI bridge driver
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci	Copyright (C) Manu Abraham (abraham.manu@gmail.com)
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci*/
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __MANTIS_UART_H
108c2ecf20Sopenharmony_ci#define __MANTIS_UART_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define MANTIS_UART_CTL			0xe0
138c2ecf20Sopenharmony_ci#define MANTIS_UART_RXINT		(1 << 4)
148c2ecf20Sopenharmony_ci#define MANTIS_UART_RXFLUSH		(1 << 2)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define MANTIS_UART_RXD			0xe8
178c2ecf20Sopenharmony_ci#define MANTIS_UART_BAUD		0xec
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define MANTIS_UART_STAT		0xf0
208c2ecf20Sopenharmony_ci#define MANTIS_UART_RXFIFO_DATA		(1 << 7)
218c2ecf20Sopenharmony_ci#define MANTIS_UART_RXFIFO_EMPTY	(1 << 6)
228c2ecf20Sopenharmony_ci#define MANTIS_UART_RXFIFO_FULL		(1 << 3)
238c2ecf20Sopenharmony_ci#define MANTIS_UART_FRAME_ERR		(1 << 2)
248c2ecf20Sopenharmony_ci#define MANTIS_UART_PARITY_ERR		(1 << 1)
258c2ecf20Sopenharmony_ci#define MANTIS_UART_RXTHRESH_INT	(1 << 0)
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cienum mantis_baud {
288c2ecf20Sopenharmony_ci	MANTIS_BAUD_9600	= 0,
298c2ecf20Sopenharmony_ci	MANTIS_BAUD_19200,
308c2ecf20Sopenharmony_ci	MANTIS_BAUD_38400,
318c2ecf20Sopenharmony_ci	MANTIS_BAUD_57600,
328c2ecf20Sopenharmony_ci	MANTIS_BAUD_115200
338c2ecf20Sopenharmony_ci};
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_cienum mantis_parity {
368c2ecf20Sopenharmony_ci	MANTIS_PARITY_NONE	= 0,
378c2ecf20Sopenharmony_ci	MANTIS_PARITY_EVEN,
388c2ecf20Sopenharmony_ci	MANTIS_PARITY_ODD,
398c2ecf20Sopenharmony_ci};
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistruct mantis_pci;
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciextern int mantis_uart_init(struct mantis_pci *mantis);
448c2ecf20Sopenharmony_ciextern void mantis_uart_exit(struct mantis_pci *mantis);
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#endif /* __MANTIS_UART_H */
47