linux/drivers/usb/serial/io_16654.h

/* SPDX-License-Identifier: GPL-2.0+ */
/************************************************************************
 *
 *	16654.H		Definitions for 16C654 UART used on EdgePorts
 *
 *	Copyright (C) 1998 Inside Out Networks, Inc.
 *
 ************************************************************************/

#if !defined(_16654_H)
#define _16654_H

/************************************************************************
 *
 *			D e f i n e s   /   T y p e d e f s
 *
 ************************************************************************/

	//
	// UART register numbers
	// Numbers 0-7 are passed to the Edgeport directly. Numbers 8 and
	// above are used internally to indicate that we must enable access
	// to them via LCR bit 0x80 or LCR = 0xBF.
	// The register number sent to the Edgeport is then (x & 0x7).
	//
	// Driver must not access registers that affect operation of the
	// the EdgePort firmware -- that includes THR, RHR, IER, FCR.


#define THR
#define RDR
#define IER
#define FCR
#define ISR
#define LCR
#define MCR
#define LSR
#define MSR
#define SPR
#define DLL
#define DLM
#define EFR
//efine unused			11	// Bank2[ 3 ]
#define XON1
#define XON2
#define XOFF1
#define XOFF2

#define NUM_16654_REGS

#define IS_REG_2ND_BANK(x)

	//
	// Bit definitions for each register
	//

#define IER_RX
#define IER_TX
#define IER_RXS
#define IER_MDM
#define IER_SLEEP
#define IER_XOFF
#define IER_RTS
#define IER_CTS
#define IER_ENABLE_ALL


#define FCR_FIFO_EN
#define FCR_RXCLR
#define FCR_TXCLR
#define FCR_DMA_BLK
#define FCR_TX_LEVEL_MASK
#define FCR_TX_LEVEL_8
#define FCR_TX_LEVEL_16
#define FCR_TX_LEVEL_32
#define FCR_TX_LEVEL_56
#define FCR_RX_LEVEL_MASK
#define FCR_RX_LEVEL_8
#define FCR_RX_LEVEL_16
#define FCR_RX_LEVEL_56
#define FCR_RX_LEVEL_60


#define ISR_INT_MDM_STATUS
#define ISR_INT_NONE
#define ISR_INT_TXRDY
#define ISR_INT_RXRDY
#define ISR_INT_LINE_STATUS
#define ISR_INT_RX_TIMEOUT
#define ISR_INT_RX_XOFF
#define ISR_INT_RTS_CTS
#define ISR_FIFO_ENABLED
#define ISR_INT_BITS_MASK


#define LCR_BITS_5
#define LCR_BITS_6
#define LCR_BITS_7
#define LCR_BITS_8
#define LCR_BITS_MASK

#define LCR_STOP_1
#define LCR_STOP_1_5
#define LCR_STOP_2
#define LCR_STOP_MASK

#define LCR_PAR_NONE
#define LCR_PAR_ODD
#define LCR_PAR_EVEN
#define LCR_PAR_MARK
#define LCR_PAR_SPACE
#define LCR_PAR_MASK

#define LCR_SET_BREAK
#define LCR_DL_ENABLE

#define LCR_ACCESS_EFR
					// and also the '654-only registers
					// EFR, XON1, XON2, XOFF1, XOFF2


#define MCR_DTR
#define MCR_RTS
#define MCR_OUT1
#define MCR_MASTER_IE
#define MCR_LOOPBACK
#define MCR_XON_ANY
#define MCR_IR_ENABLE
#define MCR_BRG_DIV_4


#define LSR_RX_AVAIL
#define LSR_OVER_ERR
#define LSR_PAR_ERR
#define LSR_FRM_ERR
#define LSR_BREAK
#define LSR_TX_EMPTY
#define LSR_TX_ALL_EMPTY
#define LSR_FIFO_ERR


#define EDGEPORT_MSR_DELTA_CTS
#define EDGEPORT_MSR_DELTA_DSR
#define EDGEPORT_MSR_DELTA_RI
#define EDGEPORT_MSR_DELTA_CD
#define EDGEPORT_MSR_CTS
#define EDGEPORT_MSR_DSR
#define EDGEPORT_MSR_RI
#define EDGEPORT_MSR_CD



					//	Tx		Rx
					//-------------------------------
#define EFR_SWFC_NONE
#define EFR_SWFC_RX1
#define EFR_SWFC_RX2
#define EFR_SWFC_RX12
#define EFR_SWFC_TX1
#define EFR_SWFC_TX1_RX1
#define EFR_SWFC_TX1_RX2
#define EFR_SWFC_TX1_RX12
#define EFR_SWFC_TX2
#define EFR_SWFC_TX2_RX1
#define EFR_SWFC_TX2_RX2
#define EFR_SWFC_TX2_RX12
#define EFR_SWFC_TX12
#define EFR_SWFC_TX12_RX1
#define EFR_SWFC_TX12_RX2
#define EFR_SWFC_TX12_RX12

#define EFR_TX_FC_MASK
#define EFR_TX_FC_NONE
#define EFR_TX_FC_X1
#define EFR_TX_FC_X2
#define EFR_TX_FC_X1_2

#define EFR_RX_FC_MASK
#define EFR_RX_FC_NONE
#define EFR_RX_FC_X1
#define EFR_RX_FC_X2
#define EFR_RX_FC_X1_2


#define EFR_SWFC_MASK
#define EFR_ENABLE_16654
#define EFR_SPEC_DETECT
#define EFR_AUTO_RTS
#define EFR_AUTO_CTS

#endif	// if !defined(_16654_H)