ixp12x0_pcireg.h revision 1.2 1 1.2 ichiro /* $NetBSD: ixp12x0_pcireg.h,v 1.2 2003/02/17 20:51:52 ichiro Exp $ */
2 1.1 ichiro
3 1.1 ichiro /*
4 1.2 ichiro * Copyright (c) 2002, 2003
5 1.1 ichiro * Ichiro FUKUHARA <ichiro (at) ichiro.org>. All rights reserved.
6 1.1 ichiro *
7 1.1 ichiro * Redistribution and use in source and binary forms, with or without
8 1.1 ichiro * modification, are permitted provided that the following conditions
9 1.1 ichiro * are met:
10 1.1 ichiro * 1. Redistributions of source code must retain the above copyright
11 1.1 ichiro * notice, this list of conditions and the following disclaimer.
12 1.1 ichiro * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 ichiro * notice, this list of conditions and the following disclaimer in the
14 1.1 ichiro * documentation and/or other materials provided with the distribution.
15 1.1 ichiro * 3. All advertising materials mentioning features or use of this software
16 1.1 ichiro * must display the following acknowledgement:
17 1.1 ichiro * This product includes software developed by Ichiro FUKUHARA.
18 1.1 ichiro * 4. Neither the name of the author nor the names of any co-contributors
19 1.1 ichiro * may be used to endorse or promote products derived from this software
20 1.1 ichiro * without specific prior written permission.
21 1.1 ichiro *
22 1.1 ichiro * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA AND CONTRIBUTORS ``AS IS''
23 1.1 ichiro * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 ichiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 ichiro * ARE DISCLAIMED. IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS
26 1.1 ichiro * HEAD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27 1.1 ichiro * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 1.1 ichiro * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 1.1 ichiro * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 1.1 ichiro * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 1.1 ichiro * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 1.1 ichiro * THE POSSIBILITY OF SUCH DAMAGE.
33 1.1 ichiro */
34 1.1 ichiro
35 1.1 ichiro #ifndef _IXP12X0_PCIREG_H_
36 1.1 ichiro #define _IXP12X0_PCIREG_H_
37 1.1 ichiro
38 1.1 ichiro #include <arm/ixp12x0/ixp12x0reg.h>
39 1.1 ichiro
40 1.1 ichiro /* PCI Configuration Space Registers */
41 1.1 ichiro
42 1.1 ichiro /* base address */
43 1.1 ichiro #define IXP_PCI_MEM_BAR 0x10
44 1.1 ichiro # define IXP1200_PCI_MEM_BAR 0x40000000UL
45 1.2 ichiro # define IXP_PCI_MEM_BAR_MASK 0xffffff80
46 1.2 ichiro
47 1.1 ichiro #define IXP_PCI_IO_BAR 0x14
48 1.1 ichiro # define IXP1200_PCI_IO_BAR 0x0000f000UL
49 1.2 ichiro # define IXP_PCI_IO_BAR_MASK 0xffffff80
50 1.2 ichiro
51 1.1 ichiro #define IXP_PCI_DRAM_BAR 0x18
52 1.1 ichiro # define IXP1200_PCI_DRAM_BAR 0x00000000UL
53 1.2 ichiro # define IXP_PCI_DRAM_BAR_MASK 0xfffc0000
54 1.1 ichiro
55 1.1 ichiro #define PCI_CAP_PTR 0x34
56 1.1 ichiro #define PCI_INT_LINE 0x3C
57 1.1 ichiro #define MAILBOX_0 0x50
58 1.1 ichiro #define MAILBOX_1 0x54
59 1.1 ichiro #define MAILBOX_2 0x58
60 1.1 ichiro #define MAILBOX_3 0x5C
61 1.1 ichiro #define DOORBELL 0x60
62 1.1 ichiro #define DOORBELL_SETUP 0x64
63 1.1 ichiro #define ROM_BYTE_WRITE 0x68
64 1.1 ichiro #define CAP_PTR_EXT 0x70
65 1.1 ichiro #define PWR_MGMT 0x74
66 1.1 ichiro
67 1.1 ichiro /* Reset Registers*/
68 1.1 ichiro #define IXPPCI_IXP1200_RESET 0x7C
69 1.1 ichiro # define RESET_UE0 (1U << 0)
70 1.1 ichiro # define RESET_UE1 (1U << 1)
71 1.1 ichiro # define RESET_UE2 (1U << 2)
72 1.1 ichiro # define RESET_UE3 (1U << 3)
73 1.1 ichiro # define RESET_UE4 (1U << 4)
74 1.1 ichiro # define RESET_UE5 (1U << 5)
75 1.1 ichiro # define RESET_PCIRST (1U << 14)
76 1.1 ichiro # define RESET_EXRST (1U << 15)
77 1.1 ichiro # define RESET_FBI (1U << 16)
78 1.1 ichiro # define RESET_CMDARB (1U << 17)
79 1.1 ichiro # define RESET_SDRAM (1U << 18)
80 1.1 ichiro # define RESET_SRAM (1U << 29)
81 1.1 ichiro # define RESET_PCI (1U << 30)
82 1.1 ichiro # define RESET_SACORE (1U << 31)
83 1.1 ichiro
84 1.1 ichiro # define RESET_FULL (RESET_UE0 | RESET_UE1 | RESET_UE2 | \
85 1.1 ichiro RESET_UE3 | RESET_UE4 | RESET_UE5 | \
86 1.1 ichiro RESET_EXRST | RESET_FBI | \
87 1.1 ichiro RESET_CMDARB | RESET_SDRAM | RESET_SRAM | \
88 1.1 ichiro RESET_PCI | RESET_SACORE)
89 1.1 ichiro
90 1.1 ichiro #define CHAN_1_BYTE_COUNT 0x80
91 1.1 ichiro #define CHAN_1_PCI_ADDR 0x84
92 1.1 ichiro #define CHAN_1_DRAM_ADDR 0x88
93 1.1 ichiro #define CHAN_1_DESC_PTR 0x8C
94 1.1 ichiro #define CHAN_1_CONTROL 0x90
95 1.1 ichiro #define DMA_INF_MODE 0x9C
96 1.1 ichiro #define CHAN_2_BYTE_COUNT 0xA0
97 1.1 ichiro #define CHAN_2_PCI_ADDR 0xA4
98 1.1 ichiro #define CHAN_2_DRAM_ADDR 0xA8
99 1.1 ichiro #define CHAN_2_DESC_PTR 0xAC
100 1.1 ichiro #define CHAN_2_CONTROL 0xB0
101 1.1 ichiro
102 1.1 ichiro #define CSR_BASE_ADDR_MASK 0x0F8
103 1.1 ichiro #define CSR_BASE_ADDR_OFF 0xFC
104 1.1 ichiro # define CSR_BASE_ADDR_MASK_1M 0x000c0000UL
105 1.1 ichiro
106 1.1 ichiro #define DRAM_BASE_ADDR_MASK 0x100
107 1.1 ichiro #define DRAM_BASE_ADDR_OFF 0x104
108 1.1 ichiro # define DRAM_BASE_ADDR_MASK_256MB 0x0ffc0000UL
109 1.1 ichiro
110 1.1 ichiro #define ROM_BASE_ADDR_MASK 0x108
111 1.1 ichiro #define DRAM_TIMING 0x10C
112 1.1 ichiro #define DRAM_ADDR_SIZE_0 0x110
113 1.1 ichiro #define DRAM_ADDR_SIZE_1 0x114
114 1.1 ichiro #define DRAM_ADDR_SIZE_2 0x118
115 1.1 ichiro #define DRAM_ADDR_SIZE_3 0x11C
116 1.1 ichiro #define I2O_IFH 0x120
117 1.1 ichiro #define I2O_IPT 0x124
118 1.1 ichiro #define I2O_OPH 0x128
119 1.1 ichiro #define I2O_OFT 0x12C
120 1.1 ichiro #define I2O_IFC 0x130
121 1.1 ichiro #define I2O_OPC 0x134
122 1.1 ichiro #define I2O_IPC 0x138
123 1.1 ichiro #define SA_CONTROL 0x13C
124 1.1 ichiro # define SA_CONTROL_PNR (1 << 9)
125 1.1 ichiro # define SA_CONTROL_COMPLETE (1 << 0)
126 1.1 ichiro #define PCI_ADDR_EXT 0x140
127 1.2 ichiro # define PCI_ADDR_EXT_PIOADD(x) ((x) & 0xffff0000)
128 1.2 ichiro # define PCI_ADDR_EXT_PMSA(x) (((x) & 0xe0000000) >> 16)
129 1.1 ichiro #define PREFETCH_RANGE 0x144
130 1.1 ichiro #define PCI_ABITOR_STATUS 0x148
131 1.1 ichiro #define DBELL_PCI_MASK 0x150
132 1.1 ichiro #define DBELL_SA_MASK 0x154
133 1.1 ichiro
134 1.1 ichiro /*
135 1.1 ichiro * Interrupt index assignment
136 1.1 ichiro *
137 1.1 ichiro * FIQ/IRQ bitmap in "PCI Registers Accessible Through StrongARM Core"
138 1.1 ichiro *
139 1.1 ichiro * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
140 1.1 ichiro * bit 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
141 1.1 ichiro * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------+-+-+-+-+---+-+-+
142 1.1 ichiro * |D|R|R|D|D|P|I|S|R|S|D|D| |P|D|D|D| |T|T|T|T| |S| |
143 1.1 ichiro * |P|T|M|P|T|W|I|D|S|B|M|M|R|I|M|M|F| |4|3|2|1| |I| |
144 1.1 ichiro * |E|A|A|E|E|R|P|P|E| |A|A|E|L|A|A|H| RES | | | | |RES| | |
145 1.1 ichiro * | | | |D| |M| |A|R| |2|1|S| |2|1| | | | | | | | | |
146 1.1 ichiro * | | | | | | | |R|R| |N|N| | | | | | | | | | | | | |
147 1.1 ichiro * | | | | | | | | | | |B|B| | | | | | | | | | | | | |
148 1.1 ichiro * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------+-+-+-+-+---+-+-+
149 1.1 ichiro * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1
150 1.1 ichiro * index 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 7 6 5 4 1 0
151 1.1 ichiro *
152 1.1 ichiro */
153 1.1 ichiro
154 1.1 ichiro /* PCI_IRQ_STATUS */
155 1.1 ichiro #define IXPPCI_IRQ_STATUS (IXP12X0_PCI_VBASE + 0x180)
156 1.1 ichiro #define IXPPCI_FIQ_STATUS (IXP12X0_PCI_VBASE + 0x280)
157 1.1 ichiro #define IXPPCI_IRQ_RAW_STATUS (IXP12X0_PCI_VBASE + 0x184)
158 1.1 ichiro #define IXPPCI_FIQ_RAW_STATUS (IXP12X0_PCI_VBASE + 0x284)
159 1.1 ichiro #define IXPPCI_IRQ_ENABLE (IXP12X0_PCI_VBASE + 0x188)
160 1.1 ichiro #define IXPPCI_FIQ_ENABLE (IXP12X0_PCI_VBASE + 0x288)
161 1.1 ichiro #define IXPPCI_IRQ_ENABLE_SET (IXP12X0_PCI_VBASE + 0x188)
162 1.1 ichiro #define IXPPCI_FIQ_ENABLE_SET (IXP12X0_PCI_VBASE + 0x288)
163 1.1 ichiro #define IXPPCI_IRQ_ENABLE_CLEAR (IXP12X0_PCI_VBASE + 0x18c)
164 1.1 ichiro #define IXPPCI_FIQ_ENABLE_CLEAR (IXP12X0_PCI_VBASE + 0x28c)
165 1.1 ichiro #define IXPPCI_IRQ_SOFT (IXP12X0_PCI_VBASE + 0x190)
166 1.1 ichiro #define IXPPCI_FIQ_SOFT (IXP12X0_PCI_VBASE + 0x290)
167 1.1 ichiro #define IXPPCI_IRQST_TIMER (IXP12X0_PCI_VBASE + 0x010)
168 1.1 ichiro
169 1.1 ichiro #define IXPPCI_INTR_DPE 63
170 1.1 ichiro #define IXPPCI_INTR_RTA 62
171 1.1 ichiro #define IXPPCI_INTR_RMA 61
172 1.1 ichiro #define IXPPCI_INTR_DPED 60
173 1.1 ichiro #define IXPPCI_INTR_DTE 59
174 1.1 ichiro #define IXPPCI_INTR_PWRM 58
175 1.1 ichiro #define IXPPCI_INTR_IIP 57
176 1.1 ichiro #define IXPPCI_INTR_SDPAR 56
177 1.1 ichiro #define IXPPCI_INTR_RSERR 55
178 1.1 ichiro #define IXPPCI_INTR_SB 54
179 1.1 ichiro #define IXPPCI_INTR_DMA2NB 53
180 1.1 ichiro #define IXPPCI_INTR_DMA1NB 52
181 1.1 ichiro #define IXPPCI_INTR_bit19 51
182 1.1 ichiro #define IXPPCI_INTR_PIL 50
183 1.1 ichiro #define IXPPCI_INTR_DMA2 49
184 1.1 ichiro #define IXPPCI_INTR_DMA1 48
185 1.1 ichiro #define IXPPCI_INTR_DFH 47
186 1.1 ichiro #define IXPPCI_INTR_bit14 46
187 1.1 ichiro #define IXPPCI_INTR_bit13 45
188 1.1 ichiro #define IXPPCI_INTR_bit12 44
189 1.1 ichiro #define IXPPCI_INTR_bit11 43
190 1.1 ichiro #define IXPPCI_INTR_bit10 42
191 1.1 ichiro #define IXPPCI_INTR_bit9 41
192 1.1 ichiro #define IXPPCI_INTR_bit8 40
193 1.1 ichiro #define IXPPCI_INTR_T4 39
194 1.1 ichiro #define IXPPCI_INTR_T3 38
195 1.1 ichiro #define IXPPCI_INTR_T2 37
196 1.1 ichiro #define IXPPCI_INTR_T1 36
197 1.1 ichiro #define IXPPCI_INTR_bit3 35
198 1.1 ichiro #define IXPPCI_INTR_bit2 34
199 1.1 ichiro #define IXPPCI_INTR_SI 33
200 1.1 ichiro #define IXPPCI_INTR_bit0 32
201 1.1 ichiro
202 1.1 ichiro #endif /* _IXP12X0_PCIREG_H_ */
203