bonitoreg.h revision 1.3.8.4 1 1.3.8.4 nathanw /* $NetBSD: bonitoreg.h,v 1.3.8.4 2002/08/27 23:44:48 nathanw Exp $ */
2 1.3.8.2 nathanw
3 1.3.8.2 nathanw /*
4 1.3.8.4 nathanw * Bonito Register Map
5 1.3.8.2 nathanw * Copyright (c) 1999 Algorithmics Ltd
6 1.3.8.2 nathanw *
7 1.3.8.2 nathanw * Algorithmics gives permission for anyone to use and modify this file
8 1.3.8.2 nathanw * without any obligation or license condition except that you retain
9 1.3.8.2 nathanw * this copyright message in any source redistribution in whole or part.
10 1.3.8.2 nathanw *
11 1.3.8.2 nathanw * Updated copies of this and other files can be found at
12 1.3.8.2 nathanw * ftp://ftp.algor.co.uk/pub/bonito/
13 1.3.8.4 nathanw *
14 1.3.8.2 nathanw * Users of the Bonito controller are warmly recommended to contribute
15 1.3.8.2 nathanw * any useful changes back to Algorithmics (mail to
16 1.3.8.2 nathanw * bonito (at) algor.co.uk).
17 1.3.8.2 nathanw */
18 1.3.8.2 nathanw
19 1.3.8.4 nathanw /* Revision 1.48 autogenerated on 08/17/99 15:20:01 */
20 1.3.8.2 nathanw
21 1.3.8.2 nathanw #ifndef _BONITO_H_
22 1.3.8.2 nathanw
23 1.3.8.2 nathanw #define BONITO(x) (BONITO_REG_BASE + (x))
24 1.3.8.2 nathanw
25 1.3.8.2 nathanw #define REGVAL(x) *((__volatile u_int32_t *) MIPS_PHYS_TO_KSEG1(x))
26 1.3.8.2 nathanw
27 1.3.8.2 nathanw #define BONITO_BOOT_BASE 0x1fc00000
28 1.3.8.2 nathanw #define BONITO_BOOT_SIZE 0x00100000
29 1.3.8.4 nathanw #define BONITO_BOOT_TOP (BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1)
30 1.3.8.2 nathanw #define BONITO_FLASH_BASE 0x1c000000
31 1.3.8.2 nathanw #define BONITO_FLASH_SIZE 0x03000000
32 1.3.8.4 nathanw #define BONITO_FLASH_TOP (BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1)
33 1.3.8.2 nathanw #define BONITO_SOCKET_BASE 0x1f800000
34 1.3.8.2 nathanw #define BONITO_SOCKET_SIZE 0x00400000
35 1.3.8.4 nathanw #define BONITO_SOCKET_TOP (BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1)
36 1.3.8.2 nathanw #define BONITO_REG_BASE 0x1fe00000
37 1.3.8.2 nathanw #define BONITO_REG_SIZE 0x00040000
38 1.3.8.4 nathanw #define BONITO_REG_TOP (BONITO_REG_BASE+BONITO_REG_SIZE-1)
39 1.3.8.2 nathanw #define BONITO_DEV_BASE 0x1ff00000
40 1.3.8.2 nathanw #define BONITO_DEV_SIZE 0x00100000
41 1.3.8.4 nathanw #define BONITO_DEV_TOP (BONITO_DEV_BASE+BONITO_DEV_SIZE-1)
42 1.3.8.2 nathanw #define BONITO_PCILO_BASE 0x10000000
43 1.3.8.2 nathanw #define BONITO_PCILO_SIZE 0x0c000000
44 1.3.8.4 nathanw #define BONITO_PCILO_TOP (BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1)
45 1.3.8.4 nathanw #define BONITO_PCILO0_BASE 0x10000000
46 1.3.8.4 nathanw #define BONITO_PCILO1_BASE 0x14000000
47 1.3.8.4 nathanw #define BONITO_PCILO2_BASE 0x18000000
48 1.3.8.2 nathanw #define BONITO_PCIHI_BASE 0x20000000
49 1.3.8.2 nathanw #define BONITO_PCIHI_SIZE 0x20000000
50 1.3.8.4 nathanw #define BONITO_PCIHI_TOP (BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1)
51 1.3.8.2 nathanw #define BONITO_PCIIO_BASE 0x1fd00000
52 1.3.8.2 nathanw #define BONITO_PCIIO_SIZE 0x00100000
53 1.3.8.4 nathanw #define BONITO_PCIIO_TOP (BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1)
54 1.3.8.2 nathanw #define BONITO_PCICFG_BASE 0x1fe80000
55 1.3.8.2 nathanw #define BONITO_PCICFG_SIZE 0x00080000
56 1.3.8.4 nathanw #define BONITO_PCICFG_TOP (BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1)
57 1.3.8.4 nathanw
58 1.3.8.2 nathanw
59 1.3.8.2 nathanw /* Bonito Register Bases */
60 1.3.8.2 nathanw
61 1.3.8.2 nathanw #define BONITO_PCICONFIGBASE 0x00
62 1.3.8.2 nathanw #define BONITO_REGBASE 0x100
63 1.3.8.2 nathanw
64 1.3.8.2 nathanw
65 1.3.8.2 nathanw /* PCI Configuration Registers */
66 1.3.8.2 nathanw
67 1.3.8.4 nathanw #define BONITO_PCI_REG(x) BONITO(BONITO_PCICONFIGBASE + (x))
68 1.3.8.4 nathanw #define BONITO_PCIDID BONITO_PCI_REG(0x00)
69 1.3.8.4 nathanw #define BONITO_PCICMD BONITO_PCI_REG(0x04)
70 1.3.8.4 nathanw #define BONITO_PCICLASS BONITO_PCI_REG(0x08)
71 1.3.8.4 nathanw #define BONITO_PCILTIMER BONITO_PCI_REG(0x0c)
72 1.3.8.4 nathanw #define BONITO_PCIBASE0 BONITO_PCI_REG(0x10)
73 1.3.8.4 nathanw #define BONITO_PCIBASE1 BONITO_PCI_REG(0x14)
74 1.3.8.4 nathanw #define BONITO_PCIBASE2 BONITO_PCI_REG(0x18)
75 1.3.8.4 nathanw #define BONITO_PCIEXPRBASE BONITO_PCI_REG(0x30)
76 1.3.8.4 nathanw #define BONITO_PCIINT BONITO_PCI_REG(0x3c)
77 1.3.8.2 nathanw
78 1.3.8.2 nathanw #define BONITO_PCICMD_PERR_CLR 0x80000000
79 1.3.8.2 nathanw #define BONITO_PCICMD_SERR_CLR 0x40000000
80 1.3.8.2 nathanw #define BONITO_PCICMD_MABORT_CLR 0x20000000
81 1.3.8.2 nathanw #define BONITO_PCICMD_MTABORT_CLR 0x10000000
82 1.3.8.2 nathanw #define BONITO_PCICMD_TABORT_CLR 0x08000000
83 1.3.8.2 nathanw #define BONITO_PCICMD_MPERR_CLR 0x01000000
84 1.3.8.2 nathanw #define BONITO_PCICMD_PERRRESPEN 0x00000040
85 1.3.8.2 nathanw #define BONITO_PCICMD_ASTEPEN 0x00000080
86 1.3.8.2 nathanw #define BONITO_PCICMD_SERREN 0x00000100
87 1.3.8.2 nathanw #define BONITO_PCILTIMER_BUSLATENCY 0x0000ff00
88 1.3.8.2 nathanw #define BONITO_PCILTIMER_BUSLATENCY_SHIFT 8
89 1.3.8.2 nathanw
90 1.3.8.2 nathanw
91 1.3.8.2 nathanw #define BONITO_REV_FPGA(x) ((x) & 0x80)
92 1.3.8.2 nathanw #define BONITO_REV_MAJOR(x) (((x) >> 4) & 0x7)
93 1.3.8.2 nathanw #define BONITO_REV_MINOR(x) ((x) & 0xf)
94 1.3.8.2 nathanw
95 1.3.8.2 nathanw
96 1.3.8.2 nathanw /* 1. Bonito h/w Configuration */
97 1.3.8.2 nathanw /* Power on register */
98 1.3.8.2 nathanw
99 1.3.8.2 nathanw #define BONITO_BONPONCFG BONITO(BONITO_REGBASE + 0x00)
100 1.3.8.2 nathanw
101 1.3.8.2 nathanw #define BONITO_BONPONCFG_SYSCONTROLLERRD 0x00040000
102 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMCS1SAMP 0x00020000
103 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMCS0SAMP 0x00010000
104 1.3.8.2 nathanw #define BONITO_BONPONCFG_CPUBIGEND 0x00004000
105 1.3.8.2 nathanw #define BONITO_BONPONCFG_CPUPARITY 0x00002000
106 1.3.8.4 nathanw #define BONITO_BONPONCFG_BURSTORDER 0x00001000
107 1.3.8.2 nathanw #define BONITO_BONPONCFG_CPUTYPE 0x00000007
108 1.3.8.2 nathanw #define BONITO_BONPONCFG_CPUTYPE_SHIFT 0
109 1.3.8.2 nathanw #define BONITO_BONPONCFG_PCIRESET_OUT 0x00000008
110 1.3.8.2 nathanw #define BONITO_BONPONCFG_IS_ARBITER 0x00000010
111 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMBOOT 0x000000c0
112 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMBOOT_SHIFT 6
113 1.3.8.2 nathanw
114 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMBOOT_FLASH (0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
115 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
116 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMBOOT_SDRAM (0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
117 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMBOOT_CPURESET (0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
118 1.3.8.2 nathanw
119 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMCS0WIDTH 0x00000100
120 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMCS1WIDTH 0x00000200
121 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMCS0FAST 0x00000400
122 1.3.8.2 nathanw #define BONITO_BONPONCFG_ROMCS1FAST 0x00000800
123 1.3.8.2 nathanw #define BONITO_BONPONCFG_CONFIG_DIS 0x00000020
124 1.3.8.2 nathanw
125 1.3.8.2 nathanw
126 1.3.8.2 nathanw /* Other Bonito configuration */
127 1.3.8.2 nathanw
128 1.3.8.4 nathanw #define BONITO_BONGENCFG_OFFSET 0x4
129 1.3.8.4 nathanw #define BONITO_BONGENCFG BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET)
130 1.3.8.2 nathanw
131 1.3.8.2 nathanw #define BONITO_BONGENCFG_DEBUGMODE 0x00000001
132 1.3.8.2 nathanw #define BONITO_BONGENCFG_SNOOPEN 0x00000002
133 1.3.8.2 nathanw #define BONITO_BONGENCFG_CPUSELFRESET 0x00000004
134 1.3.8.2 nathanw
135 1.3.8.2 nathanw #define BONITO_BONGENCFG_FORCE_IRQA 0x00000008
136 1.3.8.2 nathanw #define BONITO_BONGENCFG_IRQA_ISOUT 0x00000010
137 1.3.8.2 nathanw #define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020
138 1.3.8.2 nathanw #define BONITO_BONGENCFG_BYTESWAP 0x00000040
139 1.3.8.2 nathanw
140 1.3.8.2 nathanw #define BONITO_BONGENCFG_UNCACHED 0x00000080
141 1.3.8.2 nathanw #define BONITO_BONGENCFG_PREFETCHEN 0x00000100
142 1.3.8.2 nathanw #define BONITO_BONGENCFG_WBEHINDEN 0x00000200
143 1.3.8.2 nathanw #define BONITO_BONGENCFG_CACHEALG 0x00000c00
144 1.3.8.2 nathanw #define BONITO_BONGENCFG_CACHEALG_SHIFT 10
145 1.3.8.2 nathanw #define BONITO_BONGENCFG_PCIQUEUE 0x00001000
146 1.3.8.2 nathanw #define BONITO_BONGENCFG_CACHESTOP 0x00002000
147 1.3.8.2 nathanw #define BONITO_BONGENCFG_MSTRBYTESWAP 0x00004000
148 1.3.8.4 nathanw #define BONITO_BONGENCFG_BUSERREN 0x00008000
149 1.3.8.2 nathanw #define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000
150 1.3.8.4 nathanw #define BONITO_BONGENCFG_SHORTCOPYTIMEOUT 0x00020000
151 1.3.8.2 nathanw
152 1.3.8.2 nathanw /* 2. IO & IDE configuration */
153 1.3.8.2 nathanw
154 1.3.8.2 nathanw #define BONITO_IODEVCFG BONITO(BONITO_REGBASE + 0x08)
155 1.3.8.2 nathanw
156 1.3.8.2 nathanw /* 3. IO & IDE configuration */
157 1.3.8.2 nathanw
158 1.3.8.2 nathanw #define BONITO_SDCFG BONITO(BONITO_REGBASE + 0x0c)
159 1.3.8.2 nathanw
160 1.3.8.2 nathanw /* 4. PCI address map control */
161 1.3.8.2 nathanw
162 1.3.8.2 nathanw #define BONITO_PCIMAP BONITO(BONITO_REGBASE + 0x10)
163 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG BONITO(BONITO_REGBASE + 0x14)
164 1.3.8.2 nathanw #define BONITO_PCIMAP_CFG BONITO(BONITO_REGBASE + 0x18)
165 1.3.8.2 nathanw
166 1.3.8.2 nathanw /* 5. ICU & GPIO regs */
167 1.3.8.4 nathanw
168 1.3.8.2 nathanw /* GPIO Regs - r/w */
169 1.3.8.2 nathanw
170 1.3.8.4 nathanw #define BONITO_GPIODATA_OFFSET 0x1c
171 1.3.8.4 nathanw #define BONITO_GPIODATA BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET)
172 1.3.8.2 nathanw #define BONITO_GPIOIE BONITO(BONITO_REGBASE + 0x20)
173 1.3.8.2 nathanw
174 1.3.8.2 nathanw /* ICU Configuration Regs - r/w */
175 1.3.8.2 nathanw
176 1.3.8.2 nathanw #define BONITO_INTEDGE BONITO(BONITO_REGBASE + 0x24)
177 1.3.8.2 nathanw #define BONITO_INTSTEER BONITO(BONITO_REGBASE + 0x28)
178 1.3.8.2 nathanw #define BONITO_INTPOL BONITO(BONITO_REGBASE + 0x2c)
179 1.3.8.2 nathanw
180 1.3.8.2 nathanw /* ICU Enable Regs - IntEn & IntISR are r/o. */
181 1.3.8.2 nathanw
182 1.3.8.2 nathanw #define BONITO_INTENSET BONITO(BONITO_REGBASE + 0x30)
183 1.3.8.2 nathanw #define BONITO_INTENCLR BONITO(BONITO_REGBASE + 0x34)
184 1.3.8.2 nathanw #define BONITO_INTEN BONITO(BONITO_REGBASE + 0x38)
185 1.3.8.2 nathanw #define BONITO_INTISR BONITO(BONITO_REGBASE + 0x3c)
186 1.3.8.2 nathanw
187 1.3.8.2 nathanw /* PCI mail boxes */
188 1.3.8.2 nathanw
189 1.3.8.4 nathanw #define BONITO_PCIMAIL0_OFFSET 0x40
190 1.3.8.4 nathanw #define BONITO_PCIMAIL1_OFFSET 0x44
191 1.3.8.4 nathanw #define BONITO_PCIMAIL2_OFFSET 0x48
192 1.3.8.4 nathanw #define BONITO_PCIMAIL3_OFFSET 0x4c
193 1.3.8.2 nathanw #define BONITO_PCIMAIL0 BONITO(BONITO_REGBASE + 0x40)
194 1.3.8.2 nathanw #define BONITO_PCIMAIL1 BONITO(BONITO_REGBASE + 0x44)
195 1.3.8.2 nathanw #define BONITO_PCIMAIL2 BONITO(BONITO_REGBASE + 0x48)
196 1.3.8.2 nathanw #define BONITO_PCIMAIL3 BONITO(BONITO_REGBASE + 0x4c)
197 1.3.8.2 nathanw
198 1.3.8.2 nathanw
199 1.3.8.2 nathanw /* 6. PCI cache */
200 1.3.8.2 nathanw
201 1.3.8.2 nathanw #define BONITO_PCICACHECTRL BONITO(BONITO_REGBASE + 0x50)
202 1.3.8.2 nathanw #define BONITO_PCICACHETAG BONITO(BONITO_REGBASE + 0x54)
203 1.3.8.2 nathanw
204 1.3.8.2 nathanw #define BONITO_PCIBADADDR BONITO(BONITO_REGBASE + 0x58)
205 1.3.8.2 nathanw #define BONITO_PCIMSTAT BONITO(BONITO_REGBASE + 0x5c)
206 1.3.8.2 nathanw
207 1.3.8.2 nathanw
208 1.3.8.2 nathanw /*
209 1.3.8.2 nathanw #define BONITO_PCIRDPOST BONITO(BONITO_REGBASE + 0x60)
210 1.3.8.2 nathanw #define BONITO_PCIDATA BONITO(BONITO_REGBASE + 0x64)
211 1.3.8.2 nathanw */
212 1.3.8.2 nathanw
213 1.3.8.2 nathanw /* 7. IDE DMA & Copier */
214 1.3.8.4 nathanw
215 1.3.8.2 nathanw #define BONITO_CONFIGBASE 0x000
216 1.3.8.2 nathanw #define BONITO_BONITOBASE 0x100
217 1.3.8.2 nathanw #define BONITO_LDMABASE 0x200
218 1.3.8.2 nathanw #define BONITO_COPBASE 0x300
219 1.3.8.2 nathanw #define BONITO_REG_BLOCKMASK 0x300
220 1.3.8.2 nathanw
221 1.3.8.2 nathanw #define BONITO_LDMACTRL BONITO(BONITO_LDMABASE + 0x0)
222 1.3.8.2 nathanw #define BONITO_LDMASTAT BONITO(BONITO_LDMABASE + 0x0)
223 1.3.8.2 nathanw #define BONITO_LDMAADDR BONITO(BONITO_LDMABASE + 0x4)
224 1.3.8.2 nathanw #define BONITO_LDMAGO BONITO(BONITO_LDMABASE + 0x8)
225 1.3.8.2 nathanw #define BONITO_LDMADATA BONITO(BONITO_LDMABASE + 0xc)
226 1.3.8.2 nathanw
227 1.3.8.2 nathanw #define BONITO_COPCTRL BONITO(BONITO_COPBASE + 0x0)
228 1.3.8.2 nathanw #define BONITO_COPSTAT BONITO(BONITO_COPBASE + 0x0)
229 1.3.8.2 nathanw #define BONITO_COPPADDR BONITO(BONITO_COPBASE + 0x4)
230 1.3.8.2 nathanw #define BONITO_COPDADDR BONITO(BONITO_COPBASE + 0x8)
231 1.3.8.2 nathanw #define BONITO_COPGO BONITO(BONITO_COPBASE + 0xc)
232 1.3.8.2 nathanw
233 1.3.8.2 nathanw
234 1.3.8.2 nathanw /* ###### Bit Definitions for individual Registers #### */
235 1.3.8.2 nathanw
236 1.3.8.2 nathanw /* Gen DMA. */
237 1.3.8.2 nathanw
238 1.3.8.2 nathanw #define BONITO_IDECOPDADDR_DMA_DADDR 0x0ffffffc
239 1.3.8.2 nathanw #define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT 2
240 1.3.8.2 nathanw #define BONITO_IDECOPPADDR_DMA_PADDR 0xfffffffc
241 1.3.8.2 nathanw #define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT 2
242 1.3.8.4 nathanw #define BONITO_IDECOPGO_DMA_SIZE 0x0000fffe
243 1.3.8.2 nathanw #define BONITO_IDECOPGO_DMA_SIZE_SHIFT 0
244 1.3.8.2 nathanw #define BONITO_IDECOPGO_DMA_WRITE 0x00010000
245 1.3.8.4 nathanw #define BONITO_IDECOPGO_DMAWCOUNT 0x000f0000
246 1.3.8.4 nathanw #define BONITO_IDECOPGO_DMAWCOUNT_SHIFT 16
247 1.3.8.2 nathanw
248 1.3.8.2 nathanw #define BONITO_IDECOPCTRL_DMA_STARTBIT 0x80000000
249 1.3.8.2 nathanw #define BONITO_IDECOPCTRL_DMA_RSTBIT 0x40000000
250 1.3.8.2 nathanw
251 1.3.8.2 nathanw /* DRAM - sdCfg */
252 1.3.8.2 nathanw
253 1.3.8.2 nathanw #define BONITO_SDCFG_AROWBITS 0x00000003
254 1.3.8.2 nathanw #define BONITO_SDCFG_AROWBITS_SHIFT 0
255 1.3.8.2 nathanw #define BONITO_SDCFG_ACOLBITS 0x0000000c
256 1.3.8.2 nathanw #define BONITO_SDCFG_ACOLBITS_SHIFT 2
257 1.3.8.2 nathanw #define BONITO_SDCFG_ABANKBIT 0x00000010
258 1.3.8.2 nathanw #define BONITO_SDCFG_ASIDES 0x00000020
259 1.3.8.2 nathanw #define BONITO_SDCFG_AABSENT 0x00000040
260 1.3.8.2 nathanw #define BONITO_SDCFG_AWIDTH64 0x00000080
261 1.3.8.2 nathanw
262 1.3.8.2 nathanw #define BONITO_SDCFG_BROWBITS 0x00000300
263 1.3.8.2 nathanw #define BONITO_SDCFG_BROWBITS_SHIFT 8
264 1.3.8.2 nathanw #define BONITO_SDCFG_BCOLBITS 0x00000c00
265 1.3.8.2 nathanw #define BONITO_SDCFG_BCOLBITS_SHIFT 10
266 1.3.8.2 nathanw #define BONITO_SDCFG_BBANKBIT 0x00001000
267 1.3.8.2 nathanw #define BONITO_SDCFG_BSIDES 0x00002000
268 1.3.8.2 nathanw #define BONITO_SDCFG_BABSENT 0x00004000
269 1.3.8.2 nathanw #define BONITO_SDCFG_BWIDTH64 0x00008000
270 1.3.8.2 nathanw
271 1.3.8.2 nathanw #define BONITO_SDCFG_EXTRDDATA 0x00010000
272 1.3.8.2 nathanw #define BONITO_SDCFG_EXTRASCAS 0x00020000
273 1.3.8.2 nathanw #define BONITO_SDCFG_EXTPRECH 0x00040000
274 1.3.8.2 nathanw #define BONITO_SDCFG_EXTRASWIDTH 0x00180000
275 1.3.8.2 nathanw #define BONITO_SDCFG_EXTRASWIDTH_SHIFT 19
276 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMMODESET 0x00200000
277 1.3.8.2 nathanw #define BONITO_SDCFG_DRAMEXTREGS 0x00400000
278 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMPARITY 0x00800000
279 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMBURSTLEN 0x03000000
280 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMBURSTLEN_SHIFT 24
281 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMMODESET_DONE 0x80000000
282 1.3.8.4 nathanw
283 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMRFSHMULT 0xfc000000
284 1.3.8.4 nathanw #define BONITO_SDCFG_DRAMRFSHMULT_SHIFT 26
285 1.3.8.2 nathanw
286 1.3.8.2 nathanw /* PCI Cache - pciCacheCtrl */
287 1.3.8.2 nathanw
288 1.3.8.2 nathanw #define BONITO_PCICACHECTRL_CACHECMD 0x00000007
289 1.3.8.2 nathanw #define BONITO_PCICACHECTRL_CACHECMD_SHIFT 0
290 1.3.8.2 nathanw #define BONITO_PCICACHECTRL_CACHECMDLINE 0x00000018
291 1.3.8.2 nathanw #define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT 3
292 1.3.8.2 nathanw #define BONITO_PCICACHECTRL_CMDEXEC 0x00000020
293 1.3.8.2 nathanw
294 1.3.8.2 nathanw #define BONITO_IODEVCFG_BUFFBIT_CS0 0x00000001
295 1.3.8.2 nathanw #define BONITO_IODEVCFG_SPEEDBIT_CS0 0x00000002
296 1.3.8.2 nathanw #define BONITO_IODEVCFG_MOREABITS_CS0 0x00000004
297 1.3.8.2 nathanw
298 1.3.8.2 nathanw #define BONITO_IODEVCFG_BUFFBIT_CS1 0x00000008
299 1.3.8.2 nathanw #define BONITO_IODEVCFG_SPEEDBIT_CS1 0x00000010
300 1.3.8.2 nathanw #define BONITO_IODEVCFG_MOREABITS_CS1 0x00000020
301 1.3.8.2 nathanw
302 1.3.8.2 nathanw #define BONITO_IODEVCFG_BUFFBIT_CS2 0x00000040
303 1.3.8.2 nathanw #define BONITO_IODEVCFG_SPEEDBIT_CS2 0x00000080
304 1.3.8.2 nathanw #define BONITO_IODEVCFG_MOREABITS_CS2 0x00000100
305 1.3.8.2 nathanw
306 1.3.8.2 nathanw #define BONITO_IODEVCFG_BUFFBIT_CS3 0x00000200
307 1.3.8.2 nathanw #define BONITO_IODEVCFG_SPEEDBIT_CS3 0x00000400
308 1.3.8.2 nathanw #define BONITO_IODEVCFG_MOREABITS_CS3 0x00000800
309 1.3.8.2 nathanw
310 1.3.8.2 nathanw #define BONITO_IODEVCFG_BUFFBIT_IDE 0x00001000
311 1.3.8.2 nathanw #define BONITO_IODEVCFG_SPEEDBIT_IDE 0x00002000
312 1.3.8.2 nathanw #define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000
313 1.3.8.2 nathanw #define BONITO_IODEVCFG_MODEBIT_IDE 0x00008000
314 1.3.8.2 nathanw #define BONITO_IODEVCFG_DMAON_IDE 0x001f0000
315 1.3.8.2 nathanw #define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16
316 1.3.8.2 nathanw #define BONITO_IODEVCFG_DMAOFF_IDE 0x01e00000
317 1.3.8.2 nathanw #define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT 21
318 1.3.8.4 nathanw #define BONITO_IODEVCFG_EPROMSPLIT 0x02000000
319 1.3.8.4 nathanw #define BONITO_IODEVCFG_CPUCLOCKPERIOD 0xfc000000
320 1.3.8.4 nathanw #define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26
321 1.3.8.2 nathanw
322 1.3.8.2 nathanw /* gpio */
323 1.3.8.2 nathanw #define BONITO_GPIO_GPIOW 0x000003ff
324 1.3.8.2 nathanw #define BONITO_GPIO_GPIOW_SHIFT 0
325 1.3.8.2 nathanw #define BONITO_GPIO_GPIOR 0x01ff0000
326 1.3.8.2 nathanw #define BONITO_GPIO_GPIOR_SHIFT 16
327 1.3.8.2 nathanw #define BONITO_GPIO_GPINR 0xfe000000
328 1.3.8.2 nathanw #define BONITO_GPIO_GPINR_SHIFT 25
329 1.3.8.2 nathanw #define BONITO_GPIO_IOW(N) (1<<(BONITO_GPIO_GPIOW_SHIFT+(N)))
330 1.3.8.2 nathanw #define BONITO_GPIO_IOR(N) (1<<(BONITO_GPIO_GPIOR_SHIFT+(N)))
331 1.3.8.2 nathanw #define BONITO_GPIO_INR(N) (1<<(BONITO_GPIO_GPINR_SHIFT+(N)))
332 1.3.8.2 nathanw
333 1.3.8.2 nathanw /* ICU */
334 1.3.8.2 nathanw #define BONITO_ICU_MBOXES 0x0000000f
335 1.3.8.2 nathanw #define BONITO_ICU_MBOXES_SHIFT 0
336 1.3.8.2 nathanw #define BONITO_ICU_DMARDY 0x00000010
337 1.3.8.2 nathanw #define BONITO_ICU_DMAEMPTY 0x00000020
338 1.3.8.2 nathanw #define BONITO_ICU_COPYRDY 0x00000040
339 1.3.8.2 nathanw #define BONITO_ICU_COPYEMPTY 0x00000080
340 1.3.8.2 nathanw #define BONITO_ICU_COPYERR 0x00000100
341 1.3.8.2 nathanw #define BONITO_ICU_PCIIRQ 0x00000200
342 1.3.8.2 nathanw #define BONITO_ICU_MASTERERR 0x00000400
343 1.3.8.2 nathanw #define BONITO_ICU_SYSTEMERR 0x00000800
344 1.3.8.2 nathanw #define BONITO_ICU_DRAMPERR 0x00001000
345 1.3.8.2 nathanw #define BONITO_ICU_RETRYERR 0x00002000
346 1.3.8.2 nathanw #define BONITO_ICU_GPIOS 0x01ff0000
347 1.3.8.2 nathanw #define BONITO_ICU_GPIOS_SHIFT 16
348 1.3.8.2 nathanw #define BONITO_ICU_GPINS 0x7e000000
349 1.3.8.2 nathanw #define BONITO_ICU_GPINS_SHIFT 25
350 1.3.8.2 nathanw #define BONITO_ICU_MBOX(N) (1<<(BONITO_ICU_MBOXES_SHIFT+(N)))
351 1.3.8.2 nathanw #define BONITO_ICU_GPIO(N) (1<<(BONITO_ICU_GPIOS_SHIFT+(N)))
352 1.3.8.2 nathanw #define BONITO_ICU_GPIN(N) (1<<(BONITO_ICU_GPINS_SHIFT+(N)))
353 1.3.8.2 nathanw
354 1.3.8.2 nathanw /* pcimap */
355 1.3.8.2 nathanw
356 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_LO0 0x0000003f
357 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_LO0_SHIFT 0
358 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_LO1 0x00000fc0
359 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_LO1_SHIFT 6
360 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_LO2 0x0003f000
361 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_LO2_SHIFT 12
362 1.3.8.2 nathanw #define BONITO_PCIMAP_PCIMAP_2 0x00040000
363 1.3.8.4 nathanw #define BONITO_PCIMAP_WIN(WIN,ADDR) ((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
364 1.3.8.4 nathanw
365 1.3.8.4 nathanw #define BONITO_PCIMAP_WINSIZE (1<<26)
366 1.3.8.4 nathanw #define BONITO_PCIMAP_WINOFFSET(ADDR) ((ADDR) & (BONITO_PCIMAP_WINSIZE - 1))
367 1.3.8.4 nathanw #define BONITO_PCIMAP_WINBASE(ADDR) ((ADDR) << 26)
368 1.3.8.2 nathanw
369 1.3.8.2 nathanw /* pcimembaseCfg */
370 1.3.8.2 nathanw
371 1.3.8.4 nathanw #define BONITO_PCIMEMBASECFG_MASK 0xf0000000
372 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE0_MASK 0x0000001f
373 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT 0
374 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS 0x000003e0
375 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT 5
376 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED 0x00000400
377 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE0_IO 0x00000800
378 1.3.8.2 nathanw
379 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE1_MASK 0x0001f000
380 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT 12
381 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS 0x003e0000
382 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT 17
383 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED 0x00400000
384 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_MEMBASE1_IO 0x00800000
385 1.3.8.2 nathanw
386 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFG_ASHIFT 23
387 1.3.8.4 nathanw #define BONITO_PCIMEMBASECFG_AMASK 0x007fffff
388 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFGSIZE(WIN,SIZE) (((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)
389 1.3.8.2 nathanw #define BONITO_PCIMEMBASECFGBASE(WIN,BASE) (((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS)
390 1.3.8.2 nathanw
391 1.3.8.4 nathanw #define BONITO_PCIMEMBASECFG_SIZE(WIN,CFG) (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK)
392 1.3.8.4 nathanw
393 1.3.8.4 nathanw #define BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
394 1.3.8.4 nathanw #define BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
395 1.3.8.4 nathanw #define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN,CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
396 1.3.8.4 nathanw
397 1.3.8.4 nathanw #define BONITO_PCITOPHYS(WIN,ADDR,CFG) ( \
398 1.3.8.4 nathanw (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)))) | \
399 1.3.8.4 nathanw (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN,CFG)) \
400 1.3.8.4 nathanw )
401 1.3.8.2 nathanw /* PCIMAP Cfg */
402 1.3.8.2 nathanw
403 1.3.8.4 nathanw #define BONITO_PCIMAPCFG_TYPE1 0x00010000
404 1.3.8.2 nathanw
405 1.3.8.2 nathanw /* PCICmd */
406 1.3.8.2 nathanw
407 1.3.8.2 nathanw #define BONITO_PCICMD_MEMEN 0x00000002
408 1.3.8.2 nathanw #define BONITO_PCICMD_MSTREN 0x00000004
409 1.3.8.2 nathanw
410 1.3.8.2 nathanw
411 1.3.8.4 nathanw #define BONITO_TIMERCFG BONITO(BONITO_REGBASE + 0x60)
412 1.3.8.2 nathanw #endif /* _BONITO_H_ */
413