summaryrefslogtreecommitdiff
path: root/sys/arch/arm/xscale/beccreg.h
blob: e97a95fb02b5bed6cf31c9681aafb5b550335277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*	$NetBSD: beccreg.h,v 1.2 2003/04/05 04:18:26 briggs Exp $	*/

/*
 * Copyright (c) 2002 Wasabi Systems, Inc.
 * All rights reserved.
 *
 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed for the NetBSD Project by
 *	Wasabi Systems, Inc.
 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
 *    or promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _BECCREG_H_
#define	_BECCREG_H_

/*
 * Register definitions for the ADI Engineering Big Endian Companion
 * Chip for the Intel i80200.
 */

/* Revision codes */

#define	BECC_REV_V7		0x00		/* rev <= 7 */
#define	BECC_REV_V8		0x01		/* rev 8 */
#define	BECC_REV_V9		0x02		/* rev >= 9 */

/* Memory Map */

#define	BECC_REG_BASE		0x04000000
#define	BECC_REG_SIZE		0x01000000	/* 16M */

#define	BECC_PCI_CONF_BASE	0x08000000
#define	BECC_PCI_CONF_SIZE	0x02000000	/* 32M */

#define	BECC_PCI_IO_BASE	0x0a000000
#define	BECC_PCI_IO_SIZE	0x02000000	/* 32M */

#define	BECC_PCI_MEM1_BASE	0x0c000000
#define	BECC_PCI_MEM1_SIZE	0x02000000	/* 32M */

#define	BECC_PCI_MEM2_BASE	0x0e000000
#define	BECC_PCI_MEM2_SIZE	0x02000000	/* 32M */

#define	BECC_SDRAM_BASE		0xc0000000

/* Peripheral clock is 33.3MHz */
#define	BECC_PERIPH_CLOCK	33300000

/* BECC registers; offsets from BECC_REG_BASE */

#define	BECC_PSISR		0x0000	/* PCI slave interrupt status */
#define	PSISR_SERR		(1U << 4)	/* system error */
#define	PSISR_PERR		(1U << 9)	/* parity error */
#define	PSISR_IFU		(1U << 16)	/* inbound FIFO uflow */
#define	PSISR_IFO		(1U << 17)	/* inbound FIFO oflow */
#define	PSISR_OFU		(1U << 18)	/* outbound FIFO uflow */
#define	PSISR_OFO		(1U << 19)	/* outbound FIFO oflow */

#define	BECC_PSTR0		0x0010	/* PCI slave translation window #0 */
#define	BECC_PSTR1		0x0018	/* PCI slave translation window #1 */
#define	PSTRx_ADDRMASK		(3U << 25)	/* address mask */
#define	PSTRx_BEE		(1U << 0)	/* big-endian enable */
#define	BECC_PSTR2		0x0020	/* PCI slave translation window #2 */
#define	PSTR2_ADDRMASK		(0U)		/* address mask (all SDRAM) */

#define	BECC_PMISR		0x0100	/* PCI master interrupt status */
#define	PMISR_PE		(1U << 0)	/* parity error */
#define	PMISR_TA		(1U << 2)	/* target abort */
#define	PMISR_MA		(1U << 3)	/* master abort */
#define	PMISR_IFU		(1U << 16)	/* inbound FIFO uflow */
#define	PMISR_IFO		(1U << 17)	/* inbound FIFO oflow */
#define	PMISR_OFU		(1U << 18)	/* outbound FIFO uflow */
#define	PMISR_OFO		(1U << 19)	/* outbound FIFO oflow */

#define	BECC_IDSEL_BIT		11	/* first device on PCI bus */

#define	BECC_POMR1		0x0110	/* PCI outbound memory window #1 */
#define	BECC_POMR2		0x0114	/* PCI outbound memory window #2 */
#define	POMRx_ADDRMASK		0xfe000000	/* address mask */
#define	POMRx_BEE		(1U << 2)	/* big-endian enable */
#define	POMRx_F32		(1U << 3)	/* force 32-bit transfer */
#define	POMRx_BO(x)		(x)		/* busrt order (MBZ) */
#define	BECC_POMR3		0x0130	/* PCI outbound memory window #3 */
#define	POMR3_ADDRMASK		0xc0000000	/* address mask */

#define	BECC_POIR		0x0118	/* PCI outbound I/O window */
#define	POIR_ADDRMASK		0xfe000000	/* address mask */
#define	POIR_BEE		(1U << 2)	/* big-endian enable */

#define	BECC_POCR		0x0120	/* PCI outbound config window */
#define	POCR_BEE		(1U << 2)	/* big-endian enable */
#define	POCR_TYPE		(1U << 0)	/* for type 1 cycles */

#define	BECC_DMACR		0x0200	/* DMA control register */
#define	DMACR_CE		(1U << 0)	/* channel enable */

#define	BECC_DMASR		0x0204	/* DMA status register */
#define	DMASR_PEF		(1U << 0)	/* PCI parity error */
#define	DMASR_PTA		(1U << 2)	/* PCI target abort */
#define	DMASR_PMA		(1U << 3)	/* PCI master abort */
#define	DMASR_EOTI		(1U << 8)	/* end of transfer interrupt */
#define	DMASR_CA		(1U << 10)	/* channel active */
#define	DMASR_IFU		(1U << 16)	/* inbound FIFO uflow */
#define	DMASR_IFO		(1U << 17)	/* inbound FIFO oflow */
#define	DMASR_OFU		(1U << 18)	/* outbound FIFO uflow */
#define	DMASR_OFO		(1U << 19)	/* outbound FIFO oflow */

#define	BECC_DMAPCIAR		0x0210	/* DMA PCI address */

#define	BECC_DMALAR		0x021c	/* DMA local address */

#define	BECC_DMABCR		0x0220	/* DMA byte count */

#define	BECC_DMADCR		0x0224	/* DMA descriptor control */
#define	DMADCR_F32		(1U << 6)	/* force 32-bit */
#define	DMADCR_BEE		(1U << 5)	/* big-endian enable */
#define	DMADCR_PCICMD(x)	(x)		/* PCI command */

#define	PCICMD_MR		0x6	/* memory read */
#define	PCICMD_MRL		0xe	/* memory read line */
#define	PCICMD_MRM		0xc	/* memory read multiple */
#define	PCICMD_MW		0x7	/* memory write */

#define	BECC_TSCRA		0x0300	/* Timer status/control A */
#define	BECC_TSCRB		0x0320	/* Timer status/control B */
#define	TSCRx_TE		(1U << 0)	/* timer enable */
#define	TSCRx_CM		(1U << 1)	/* continuous mode */
#define	TSCRx_TIF		(1U << 9)	/* timer interrupt flag */

#define	BECC_TPRA		0x0304	/* Timer preload A */
#define	BECC_TPRB		0x0324	/* Timer preload B */

#define	BECC_TCVRA		0x0308	/* Timer current value A */
#define	BECC_TCVRB		0x0328	/* Timer current value B */

#define	BECC_ICSR		0x0400	/* Interrupt control/status */
#define	BECC_ICMR		0x0404	/* Interrupt mask */
#define	BECC_ICSTR		0x0408	/* Interrupt steer */

#define	ICU_SOFT		0	/* software interrupt */
#define	ICU_TIMERA		1	/* timer A */
#define	ICU_TIMERB		2	/* timer B */
#define	ICU_DIAGERR		7	/* diagnostic error */
#define	ICU_DMA_EOT		8	/* DMA end-of-transfer */
#define	ICU_DMA_PEF		9	/* DMA parity error */
#define	ICU_DMA_TA		10	/* DMA target abort */
#define	ICU_DMA_MA		11	/* DMA master abort */
#define	ICU_PCI_PERR		16	/* PCI parity error */
#define	ICU_PCI_SERR		19	/* PCI system error */
#define	ICU_PCI_POAPEI		20	/* PCI outbound ATU parity error */
#define	ICU_PCI_POATAI		21	/* PCI outbound ATU target abort */
#define	ICU_PCI_POAMAI		22	/* PCI outbound ATU master abort */
#define	ICU_UARTA		24	/* UART A */
#define	ICU_UARTB		25	/* UART B */
#define	ICU_PCI_INTA		26	/* PCI INTA# */
#define	ICU_PCI_INTB		27	/* PCI INTB# */
#define	ICU_PCI_INTC		28	/* PCI INTC# */
#define	ICU_PCI_INTD		29	/* PCI INTD# */
#define	ICU_PUSHBUTTON		30	/* push button pulse */

#define	ICU_RESERVED_MASK	((1U << 3) | (1U << 4) | (1U << 5) |	\
				 (1U << 6) | (1U << 12) | (1U << 13) |	\
				 (1U << 14) | (1U << 15) | (1U << 17) |	\
				 (1U << 18) | (1U << 23) | (1U << 31))
#define	ICU_VALID_MASK		(~ICU_RESERVED_MASK)

#define	BECC_RSSR		0x0500	/* rotary switch status */
#define	RSSR_POS		0x0000000f	/* switch position */
#define	RSSR_BE			(1U << 6)	/* big-endian jumper */

#endif /* _BECCREG_H_ */