1*5137fa51Sskrll /* $NetBSD: zynq_uartreg.h,v 1.1 2019/06/11 13:01:48 skrll Exp $ */ 2*5137fa51Sskrll /*- 3*5137fa51Sskrll * Copyright (c) 2015 Genetec Corporation. All rights reserved. 4*5137fa51Sskrll * Written by Hashimoto Kenichi for Genetec Corporation. 5*5137fa51Sskrll * 6*5137fa51Sskrll * Redistribution and use in source and binary forms, with or without 7*5137fa51Sskrll * modification, are permitted provided that the following conditions 8*5137fa51Sskrll * are met: 9*5137fa51Sskrll * 1. Redistributions of source code must retain the above copyright 10*5137fa51Sskrll * notice, this list of conditions and the following disclaimer. 11*5137fa51Sskrll * 2. Redistributions in binary form must reproduce the above copyright 12*5137fa51Sskrll * notice, this list of conditions and the following disclaimer in the 13*5137fa51Sskrll * documentation and/or other materials provided with the distribution. 14*5137fa51Sskrll * 15*5137fa51Sskrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16*5137fa51Sskrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17*5137fa51Sskrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18*5137fa51Sskrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19*5137fa51Sskrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20*5137fa51Sskrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21*5137fa51Sskrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22*5137fa51Sskrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23*5137fa51Sskrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24*5137fa51Sskrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25*5137fa51Sskrll * POSSIBILITY OF SUCH DAMAGE. 26*5137fa51Sskrll */ 27*5137fa51Sskrll 28*5137fa51Sskrll #ifndef _ARM_XILINX_ZYNQ_UARTREG_H 29*5137fa51Sskrll #define _ARM_XILINX_ZYNQ_UARTREG_H 30*5137fa51Sskrll 31*5137fa51Sskrll /* register offset address */ 32*5137fa51Sskrll #define UART_CONTROL 0x00000000 /* UART Control Register */ 33*5137fa51Sskrll #define CR_STPBRK __BIT(8) 34*5137fa51Sskrll #define CR_STTBRK __BIT(7) 35*5137fa51Sskrll #define CR_RSTTO __BIT(6) 36*5137fa51Sskrll #define CR_TXDIS __BIT(5) 37*5137fa51Sskrll #define CR_TXEN __BIT(4) 38*5137fa51Sskrll #define CR_RXDIS __BIT(3) 39*5137fa51Sskrll #define CR_RXEN __BIT(2) 40*5137fa51Sskrll #define CR_TXRES __BIT(1) 41*5137fa51Sskrll #define CR_RXRES __BIT(0) 42*5137fa51Sskrll #define UART_MODE 0x00000004 /* UART Mode Register */ 43*5137fa51Sskrll #define MR_CHMODE __BITS(9, 8) 44*5137fa51Sskrll #define MR_NBSTOP __BITS(7, 6) 45*5137fa51Sskrll #define NBSTOP_1 __SHIFTIN(0, MR_NBSTOP) 46*5137fa51Sskrll #define NBSTOP_15 __SHIFTIN(1, MR_NBSTOP) 47*5137fa51Sskrll #define NBSTOP_2 __SHIFTIN(2, MR_NBSTOP) 48*5137fa51Sskrll #define MR_PAR __BITS(5, 3) 49*5137fa51Sskrll #define PAR_EVEN __SHIFTIN(0, MR_PAR) 50*5137fa51Sskrll #define PAR_ODD __SHIFTIN(1, MR_PAR) 51*5137fa51Sskrll #define PAR_ZERO __SHIFTIN(2, MR_PAR) 52*5137fa51Sskrll #define PAR_ONE __SHIFTIN(3, MR_PAR) 53*5137fa51Sskrll #define PAR_NONE __SHIFTIN(4, MR_PAR) 54*5137fa51Sskrll #define MR_CHRL __BITS(2, 1) 55*5137fa51Sskrll #define CHRL_6BIT __SHIFTIN(3, MR_CHRL) 56*5137fa51Sskrll #define CHRL_7BIT __SHIFTIN(2, MR_CHRL) 57*5137fa51Sskrll #define CHRL_8BIT __SHIFTIN(1, MR_CHRL) 58*5137fa51Sskrll #define MR_CLKS __BIT(0) 59*5137fa51Sskrll #define UART_INTRPT_EN 0x00000008 /* Interrupt Enable Register */ 60*5137fa51Sskrll #define UART_INTRPT_DIS 0x0000000C /* Interrupt Disable Register */ 61*5137fa51Sskrll #define UART_INTRPT_MASK 0x00000010 /* Interrupt Mask Register */ 62*5137fa51Sskrll #define UART_CHNL_INT_STS 0x00000014 /* Channel Interrupt Status Register */ 63*5137fa51Sskrll #define INT_TOVR __BIT(12) 64*5137fa51Sskrll #define INT_TNFUL __BIT(11) 65*5137fa51Sskrll #define INT_TTRIG __BIT(10) 66*5137fa51Sskrll #define INT_DMSI __BIT(9) 67*5137fa51Sskrll #define INT_TIMEOUT __BIT(8) 68*5137fa51Sskrll #define INT_PARE __BIT(7) 69*5137fa51Sskrll #define INT_FRAME __BIT(6) 70*5137fa51Sskrll #define INT_ROVR __BIT(5) 71*5137fa51Sskrll #define INT_TFUL __BIT(4) 72*5137fa51Sskrll #define INT_TEMPTY __BIT(3) 73*5137fa51Sskrll #define INT_RFUL __BIT(2) 74*5137fa51Sskrll #define INT_REMPTY __BIT(1) 75*5137fa51Sskrll #define INT_RTRIG __BIT(0) 76*5137fa51Sskrll #define UART_BAUD_RATE_GEN 0x00000018 /* Baud Rate Generator Register. */ 77*5137fa51Sskrll #define UART_RCVR_TIMEOUT 0x0000001C /* Receiver Timeout Register */ 78*5137fa51Sskrll #define UART_RCVR_FIFO_TRIGGER 0x00000020 /* Receiver FIFO Trigger Level Register */ 79*5137fa51Sskrll #define UART_MODEM_CTRL 0x00000024 /* Modem Control Register */ 80*5137fa51Sskrll #define MODEMCR_FCM __BIT(5) 81*5137fa51Sskrll #define MODEMCR_RTS __BIT(1) 82*5137fa51Sskrll #define MODEMCR_DTR __BIT(0) 83*5137fa51Sskrll #define UART_MODEM_STS 0x00000028 /* Modem Status Register */ 84*5137fa51Sskrll #define MODEMSR_FCMS __BIT(8) 85*5137fa51Sskrll #define MODEMSR_DCD __BIT(7) 86*5137fa51Sskrll #define MODEMSR_RI __BIT(6) 87*5137fa51Sskrll #define MODEMSR_DSR __BIT(5) 88*5137fa51Sskrll #define MODEMSR_CTS __BIT(4) 89*5137fa51Sskrll #define MODEMSR_DDCD __BIT(3) 90*5137fa51Sskrll #define MODEMSR_TERI __BIT(2) 91*5137fa51Sskrll #define MODEMSR_DDSR __BIT(1) 92*5137fa51Sskrll #define MODEMSR_DCTS __BIT(0) 93*5137fa51Sskrll #define UART_CHANNEL_STS 0x0000002C /* Channel Status Register */ 94*5137fa51Sskrll #define STS_TNFUL __BIT(14) 95*5137fa51Sskrll #define STS_TTRIG __BIT(13) 96*5137fa51Sskrll #define STS_FDELT __BIT(12) 97*5137fa51Sskrll #define STS_TAVTIVE __BIT(11) 98*5137fa51Sskrll #define STS_RACTIVE __BIT(10) 99*5137fa51Sskrll #define STS_TFUL __BIT(4) 100*5137fa51Sskrll #define STS_TEMPTY __BIT(3) 101*5137fa51Sskrll #define STS_RFUL __BIT(2) 102*5137fa51Sskrll #define STS_REMPTY __BIT(1) 103*5137fa51Sskrll #define STS_RTRIG __BIT(0) 104*5137fa51Sskrll #define UART_TX_RX_FIFO 0x00000030 /* Transmit and Receive FIFO */ 105*5137fa51Sskrll #define UART_BAUD_RATE_DIVIDER 0x00000034 /* Baud Rate Divider Register */ 106*5137fa51Sskrll #define UART_FLOW_DELAY 0x00000038 /* Flow Control Delay Register */ 107*5137fa51Sskrll #define UART_TX_FIFO_TRIGGER 0x00000044 /* Transmitter FIFO Trigger */ 108*5137fa51Sskrll 109*5137fa51Sskrll #endif /* _ARM_XILINX_ZYNQ_UARTREG_H */ 110*5137fa51Sskrll 111