RTEMS 7.0-rc1
Loading...
Searching...
No Matches
at91rm9200_dbgu.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2003 Cogent Computer Systems
13 * Written by Mike Kelly <mike@cogcomp.com>
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef __AT91RM9200_DBGU_H__
38#define __AT91RM9200_DBGU_H__
39
40#include "bits.h"
41
42/* Register Offsets */
43#define DBGU_CR 0x00 /* Control Register */
44#define DBGU_MR 0x04 /* Mode Register */
45#define DBGU_IER 0x08 /* Interrupt Enable Register */
46#define DBGU_IDR 0x0C /* Interrupt Disable Register */
47#define DBGU_IMR 0x10 /* Interrupt Mask Register */
48#define DBGU_SR 0x14 /* Channel Status Register */
49#define DBGU_RHR 0x18 /* Receiver Holding Register */
50#define DBGU_THR 0x1C /* Transmitter Holding Register */
51#define DBGU_BRGR 0x20 /* Baud Rate Generator Register */
52#define DBGU_C1R 0x40 /* Chip ID1 Register */
53#define DBGU_C2R 0x44 /* Chip ID2 Register */
54#define DBGU_FNTR 0x48 /* Force NTRST Register */
55
56/* Bit Defines */
57/* Control Register, DBGU_CR, Offset 0x00 */
58#define DBGU_CR_RSTRX BIT2 /* 1 = Reset and disable receiver */
59#define DBGU_CR_RSTTX BIT3 /* 1 = Reset and disable transmitter */
60#define DBGU_CR_RXEN BIT4 /* 1 = Receiver enable */
61#define DBGU_CR_RXDIS BIT5 /* 1 = Receiver disable */
62#define DBGU_CR_TXEN BIT6 /* 1 = Transmitter enable */
63#define DBGU_CR_TXDIS BIT7 /* 1 = Transmitter disable */
64#define DBGU_CR_RSTSTA BIT8 /* 1 = Reset PARE, FRAME and OVRE in DBGU_SR. */
65
66/* Mode Register. DBGU_MR. Offset 0x04 */
67#define DBGU_MR_PAR_EVEN (0x0 << 9) /* Even Parity */
68#define DBGU_MR_PAR_ODD (0x1 << 9) /* Odd Parity */
69#define DBGU_MR_PAR_SPACE (0x2 << 9) /* Parity forced to 0 (Space) */
70#define DBGU_MR_PAR_MARK (0x3 << 9) /* Parity forced to 1 (Mark) */
71#define DBGU_MR_PAR_NONE (0x4 << 9) /* No Parity */
72#define DBGU_MR_PAR_MDROP (0x6 << 9) /* Multi-drop mode */
73#define DBGU_MR_CHMODE_NORM (0x0 << 14) /* Normal Mode */
74#define DBGU_MR_CHMODE_AUTO (0x1 << 14) /* Auto Echo: RXD drives TXD */
75#define DBGU_MR_CHMODE_LOC (0x2 << 14) /* Local Loopback: TXD drives RXD */
76#define DBGU_MR_CHMODE_REM (0x3 << 14) /* Remote Loopback: RXD pin connected to TXD pin. */
77
78/* Interrupt Enable Register, DBGU_IER, Offset 0x08 */
79/* Interrupt Disable Register, DBGU_IDR, Offset 0x0C */
80/* Interrupt Mask Register, DBGU_IMR, Offset 0x10 */
81/* Channel Status Register, DBGU_SR, Offset 0x14 */
82#define DBGU_INT_RXRDY BIT0 /* RXRDY Interrupt */
83#define DBGU_INT_TXRDY BIT1 /* TXRDY Interrupt */
84#define DBGU_INT_ENDRX BIT3 /* End of Receive Transfer Interrupt */
85#define DBGU_INT_ENDTX BIT4 /* End of Transmit Interrupt */
86#define DBGU_INT_OVRE BIT5 /* Overrun Interrupt */
87#define DBGU_INT_FRAME BIT6 /* Framing Error Interrupt */
88#define DBGU_INT_PARE BIT7 /* Parity Error Interrupt */
89#define DBGU_INT_TXEMPTY BIT9 /* TXEMPTY Interrupt */
90#define DBGU_INT_TXBUFE BIT11 /* TXBUFE Interrupt */
91#define DBGU_INT_RXBUFF BIT12 /* RXBUFF Interrupt */
92#define DBGU_INT_COMM_TX BIT30 /* COMM_TX Interrupt */
93#define DBGU_INT_COMM_RX BIT31 /* COMM_RX Interrupt */
94#define DBGU_INT_ALL 0xC0001AFB /* all assigned bits */
95
96/* FORCE_NTRST Register, DBGU_FNTR, Offset 0x48 */
97#define DBGU_FNTR_NTRST BIT0 /* 1 = Force NTRST low in JTAG */
98
99typedef struct {
100 volatile uint32_t cr;
101 volatile uint32_t mr;
102 volatile uint32_t ier;
103 volatile uint32_t idr;
104 volatile uint32_t imr;
105 volatile uint32_t sr;
106 volatile uint32_t rhr;
107 volatile uint32_t thr;
108 volatile uint32_t brgr;
109 volatile uint32_t _res0[7];
110 volatile uint32_t cidr;
111 volatile uint32_t exid;
112 volatile uint32_t fnr;
114
115#endif /* __AT91RM9200_DBGU_H__ */
Contains bit position definitions.
Definition: at91rm9200_dbgu.h:99