OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [arm/] [xscale/] [iop310/] [current/] [include/] [hal_iop310.h] - Blame information for rev 868

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_HAL_IOP310_H
2
#define CYGONCE_HAL_IOP310_H
3
 
4
/*=============================================================================
5
//
6
//      hal_iop310.h
7
//
8
//      HAL Description of IOP310 (IQ80200/IQ80310) control registers, etc.
9
//
10
//=============================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under
17
// the terms of the GNU General Public License as published by the Free
18
// Software Foundation; either version 2 or (at your option) any later
19
// version.
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
29
//
30
// As a special exception, if other files instantiate templates or use
31
// macros or inline functions from this file, or you compile this file
32
// and link it with other works to produce a work based on this file,
33
// this file does not by itself cause the resulting work to be covered by
34
// the GNU General Public License. However the source code for this file
35
// must still be made available in accordance with section (3) of the GNU
36
// General Public License v2.
37
//
38
// This exception does not invalidate any other reasons why a work based
39
// on this file might be covered by the GNU General Public License.
40
// -------------------------------------------
41
// ####ECOSGPLCOPYRIGHTEND####
42
//=============================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):    msalter
46
// Contributors: msalter, gthomas
47
// Date:         2000-10-10
48
// Purpose:      Intel IOP310 hardware description
49
// Description:
50
// Usage:        #include <cyg/hal/hal_iop310.h>
51
//
52
//####DESCRIPTIONEND####
53
//
54
//===========================================================================*/
55
 
56
#include <cyg/hal/hal_xscale.h>
57
 
58
#ifndef __ASSEMBLER__
59
// Platform specific initializations
60
extern void hal_plf_hardware_init(void);
61
#endif
62
 
63
// Serial ports
64
#define IOP310_SERIAL_PORT_A 0xFE800000
65
#define IOP310_SERIAL_PORT_B 0xFE810000
66
 
67
#define DCACHE_FLUSH_AREA 0xc0000000
68
 
69
// Addresses of the left and right 7-segment display
70
#define DISPLAY_LEFT    0xFE840000
71
#define DISPLAY_RIGHT   0xFE850000
72
 
73
// 7-segment encodings for the hex display
74
#define DISPLAY_0       0xc0
75
#define DISPLAY_1       0xf9
76
#define DISPLAY_2       0xa4
77
#define DISPLAY_3       0xb0
78
#define DISPLAY_4       0x99
79
#define DISPLAY_5       0x92
80
#define DISPLAY_6       0x82
81
#define DISPLAY_7       0xF8
82
#define DISPLAY_8       0x80
83
#define DISPLAY_9       0x90
84
#define DISPLAY_A       0x88
85
#define DISPLAY_B       0x83
86
#define DISPLAY_C       0xa7
87
#define DISPLAY_D       0xa1
88
#define DISPLAY_E       0x86
89
#define DISPLAY_F       0x8e
90
 
91
#ifndef iop310_is_host
92
/* Backplane Detect Register */
93
#define BACKPLANE_DET_REG       ((volatile unsigned char *)0xfe870000)
94
#  define BP_HOST_BIT           0x1
95
#define iop310_is_host()        (*BACKPLANE_DET_REG & BP_HOST_BIT)
96
#endif
97
 
98
// XINT3 mask register
99
#define X3ISR_REG   ((volatile unsigned char *)0xfe820000)
100
#define X3MASK_REG  ((volatile unsigned char *)0xfe860000)
101
#  define XINT3_TIMER    0x01
102
#  define XINT3_ETHERNET 0x02
103
#  define XINT3_UART_1   0x04
104
#  define XINT3_UART_2   0x08
105
#  define XINT3_PCI_INTD 0x10
106
 
107
/* PAL-based external timer definitions */
108
#define TIMER_LA0_REG_ADDR      ((volatile unsigned char *)0xfe880000)
109
#define TIMER_LA1_REG_ADDR      ((volatile unsigned char *)0xfe890000)
110
#define TIMER_LA2_REG_ADDR      ((volatile unsigned char *)0xfe8a0000)
111
#define TIMER_LA3_REG_ADDR      ((volatile unsigned char *)0xfe8b0000)
112
#define TIMER_ENABLE_REG_ADDR   ((volatile unsigned char *)0xfe8c0000)
113
 
114
#define TIMER_COUNT_MASK                0x5f    /* 6 bits of timer data with the MSB in bit 6 not bit 5 */
115
#define TIMER_CNT_ENAB                  0x1
116
#define TIMER_INT_ENAB                  0x2
117
#define EXT_TIMER_CLK_FREQ              33000000        /* external timer runs at 33 MHz */
118
#define TICKS_10MSEC                    100                     /* 10msec = 100 ticks/sec */
119
#define EXT_TIMER_10MSEC_COUNT  (EXT_TIMER_CLK_FREQ / TICKS_10MSEC)
120
#define TICKS_5MSEC                             200                     /* 5msec = 200 ticks/sec */
121
#define EXT_TIMER_5MSEC_COUNT   (EXT_TIMER_CLK_FREQ / TICKS_5MSEC)
122
 
123
#define EXT_TIMER_CNT_ENAB()            (*TIMER_ENABLE_REG_ADDR |= TIMER_CNT_ENAB)
124
#define EXT_TIMER_CNT_DISAB()           (*TIMER_ENABLE_REG_ADDR &= ~TIMER_CNT_ENAB)
125
#define EXT_TIMER_INT_ENAB()            (*TIMER_ENABLE_REG_ADDR |= TIMER_INT_ENAB)
126
#define EXT_TIMER_INT_DISAB()           (*TIMER_ENABLE_REG_ADDR &= ~TIMER_INT_ENAB)
127
 
128
// Companion chip MCU registers
129
#define    MMR_BASE         0x00001500
130
#define    SDIR_OFF         0x00000000
131
#define    SDCR_OFF         0x00000004
132
#define    SDBR_OFF         0x00000008
133
#define    SBR0_OFF         0x0000000C
134
#define    SBR1_OFF         0x00000010
135
#define    ECCR_OFF         0x00000034
136
#define    FEBR1_OFF        0x00000050
137
#define    FBSR1_OFF        0x00000058
138
#define    FWSR0_OFF        0x0000005C
139
#define    FWSR1_OFF        0x00000060
140
#define    RFR_OFF          0x00000068
141
 
142
// MCU Register Values
143
#define    MRS_CAS_LAT_2    0x00000000
144
#define    MRS_CAS_LAT_3    0x00000001
145
#define    MRS_PRECHRG      0x00000002       
146
#define    MRS_NO_OP        0x00000003
147
#define    MRS_AUTO_RFRSH   0x00000004
148
#define    MRS_NORM_OP      0x00000006
149
#define    MRS_NOP_DELAY    0x00004000
150
#define    SDCR_INIT_VAL    0x00000aa0  // was 0x14
151
#define    SBR0_INIT_VAL    0x00000008  // 32 Meg Boundary (64 mbit device)
152
#define    SBR1_INIT_VAL    0x00000008  // 32 Meg Boundary (64 mbit device)
153
#define    ECCR_INIT_VAL    0x0000000C  // ECC enabled, correction on and no reporting
154
#define    RFR_INIT_VAL     0x00000600  // Initial Refresh Rate
155
#define    FBSR1_INIT_VAL   0x00000040  // 8MB Bank Size
156
#define    FWSR0_INIT_VAL   0x00000001  // 1ws add-data (needed for PP state machine), 0ws recovery
157
#define    FWSR1_INIT_VAL   0x00000000  // 0ws add-data, 0ws recovery
158
 
159
 
160
/**************************
161
 * I2C Bus Interface Unit *
162
 **************************/
163
 
164
/* Processor I2C Device ID */
165
#define I2C_DEVID       0x02  /* I2C slave address to which the unit responds when in slave-receive mode */
166
 
167
/* Timeout limit for SDRAM EEPROM to respond */
168
#define I2C_TIMOUT      0x1000000  /* bumped this way up...used to be 0x100000*/ 
169
 
170
/* Control Register */
171
#define ICR_ADDR        0x00001680  /* Address */
172
#define ICR_START       0x0001  /* 1:send a Start condition to the I2C when in master mode */
173
#define ICR_STOP        0x0002  /* 1:send a Stop condition after next data byte transferred on I2C bus in master mode */
174
#define ICR_ACK         0x0004  /* Ack/Nack control: 1:Nack, 0:Ack (negative or positive pulse) */
175
#define ICR_TRANSFER    0x0008  /* 1:send/receive byte, 0:cleared by I2C unit when done */
176
#define ICR_ABORT       0x0010  /* 1:I2C sends STOP w/out data permission, 0:ICR bit used only */
177
#define ICR_SCLENB      0x0020  /* I2C clock output: 1:Enabled, 0:Disabled. ICCR configured before ! */
178
#define ICR_ENB         0x0040  /* I2C unit: 1:Enabled, 0:Disabled */
179
#define ICR_GCALL       0x0080  /* General Call: 1:Disabled, 0:Enabled */
180
#define ICR_IEMPTY      0x0100  /* 1: IDBR Transmit Empty Interrupt Enable */
181
#define ICR_IFULL       0x0200  /* 1: IDBR Receive Full Interrupt Enable */
182
#define ICR_IERR        0x0400  /* 1: Bus Error Interrupt Enable */
183
#define ICR_ISTOP       0x0800  /* 1: Slave Stop Detected Interrupt Enable */
184
#define ICR_IARB        0x1000  /* 1: Arbitration Loss Detected Interrupt Enable */
185
#define ICR_ISADDR      0x2000  /* 1: Slave Address Detected Interrupt Enable */
186
#define ICR_RESET       0x4000  /* 1: I2C unit reset */
187
 
188
/* Status Register */
189
#define ISR_ADDR        0x00001684  /* Address */
190
#define ISR_RWMODE      0x0001  /* 1: I2C in master receive = slave transmit mode */
191
#define ISR_ACK         0x0002  /* 1: I2C received/sent a Nack, 0: Ack */
192
#define ISR_BUSY        0x0004  /* 1: Processor's I2C unit busy */
193
#define ISR_BUSBUSY     0x0008  /* 1: I2C bus busy. Processor's I2C unit not involved */
194
#define ISR_STOP        0x0010  /* 1: Slave Stop detected (when in slave mode: receive or transmit) */
195
#define ISR_ARB         0x0020  /* 1: Arbitration Loss Detected */
196
#define ISR_EMPTY       0x0040  /* 1: Transfer finished on I2C bus. If enabled in ICR, interrupt signaled */
197
#define ISR_FULL        0x0080  /* 1: IDBR received new byte from I2C bus. If ICR, interrupt signaled */
198
#define ISR_GCALL       0x0100  /* 1: I2C unit received a General Call address */
199
#define ISR_SADDR       0x0200  /* 1: I2C unit detected a 7-bit address matching the general call or ISAR */
200
#define ISR_ERROR       0x0400  /* Bit set by unit when a Bus Error detected */
201
 
202
#define ISAR_ADDR       0x00001688  /* Address of the I2C Slave Address Register */
203
#define IDBR_ADDR       0x0000168C  /* Address of the I2C Data Buffer Register */
204
#define IDBR_MASK       0x000000ff
205
#define IDBR_MODE       0x01
206
#define ICCR_ADDR       0x00001690  /* Address of the I2C Clock Control Register */
207
#define IBMR_ADDR       0x00001694  /* Address of the I2C Bus Monitor Register */
208
 
209
/* SDRAM configuration */
210
 
211
/* SDRAM bank size values (SPD << 2) */
212
#define         RAM_0MEG        
213
#define         RAM_4MEG        4
214
#define         RAM_8MEG        8
215
#define         RAM_16MEG       16
216
#define         RAM_32MEG       32
217
#define         RAM_64MEG       64
218
#define         RAM_128MEG      128
219
#define         RAM_256MEG      256
220
 
221
/* SBR register definitions (valid bits are [7:3])*/
222
#define         SBR_32MEG       0x08
223
#define         SBR_64MEG       0x10
224
#define         SBR_128MEG      0x20
225
#define         SBR_256MEG      0x40
226
 
227
/* Drive Strengths - assume single DIMM configuration */
228
#define    SDCR_1BANK_X16       0x0aa0
229
#define    SDCR_2BANK_X16       0x12c8
230
#define    SDCR_1BANK_X8        0x1520
231
#define    SDCR_2BANK_X8        0x1548
232
 
233
/* SDRAM PD bytes                               */
234
#define         BANKCNT_BYTE     0x06 /* Byte #5 of SPD: number of module banks */
235
#define         SDRAM_WIDTH_BYTE 0x0e /* Byte #13 of SPD: DRAM width */
236
#define         BANKSZ_BYTE      0x20 /* Byte #31 of SPD: module bank density */
237
#define         CHECKSUM_BYTE    0x40 /* Byte #63 of SPD: checksum for bytes 0-62 */
238
#define         CONFIG_BYTE     0x0C  /* Byte #11 of SPD: DIMM configuration type (Parity or not, EEC) */
239
 
240
#define SDRAM_DEVID     0xA2  /* SDRAM Device ID  */
241
 
242
// Yavapai PCI and Peripheral Interrupt Unit
243
/*** Yavapai Registers ***/
244
 
245
/* PCI-to-PCI Bridge Unit 0000 1000H through 0000 10FFH */
246
#define VIDR_ADDR       0x00001000
247
#define DIDR_ADDR       0x00001002
248
#define PCR_ADDR        0x00001004
249
#define PSR_ADDR        0x00001006
250
#define RIDR_ADDR       0x00001008
251
#define CCR_ADDR        0x00001009
252
#define CLSR_ADDR       0x0000100C
253
#define PLTR_ADDR       0x0000100D
254
#define HTR_ADDR        0x0000100E
255
/* Reserved 0x0000100F through  0x00001017 */
256
#define PBNR_ADDR       0x00001018
257
#define SBNR_ADDR       0x00001019
258
#define SUBBNR_ADDR     0x0000101A
259
#define SLTR_ADDR       0x0000101B
260
#define IOBR_ADDR       0x0000101C
261
#define IOLR_ADDR       0x0000101D
262
#define SSR_ADDR        0x0000101E
263
#define MBR_ADDR        0x00001020
264
#define MLR_ADDR        0x00001022
265
#define PMBR_ADDR       0x00001024
266
#define PMLR_ADDR       0x00001026
267
/* Reserved 0x00001028 through 0x00001033 */
268
#define BSVIR_ADDR      0x00001034
269
#define BSIR_ADDR       0x00001036
270
/* Reserved 0x00001038 through 0x0000103D */
271
#define BCR_ADDR        0x0000103E
272
#define EBCR_ADDR       0x00001040
273
#define SISR_ADDR       0x00001042
274
#define PBISR_ADDR      0x00001044
275
#define SBISR_ADDR      0x00001048
276
#define SACR_ADDR       0x0000104C
277
#define PIRSR_ADDR      0x00001050
278
#define SIOBR_ADDR      0x00001054
279
#define SIOLR_ADDR      0x00001055
280
#define SCCR_ADDR       0x00001056              /* EAS inconsistent */
281
#define SMBR_ADDR       0x00001058
282
#define SMLR_ADDR       0x0000105A
283
#define SDER_ADDR       0x0000105C
284
#define QCR_ADDR        0x0000105E
285
#define CDTR_ADDR       0x00001060              /* EAS inconsistent */
286
/* Reserved 0x00001064 through 0x000010FFH */
287
 
288
/* Performance Monitoring Unit 0000 1100H through 0000 11FFH */
289
#define GTMR_ADDR       0x00001100
290
#define ESR_ADDR        0x00001104
291
#define EMISR_ADDR      0x00001108
292
/* Reserved 0x0000110C */                       /* EAS inconsistent */
293
#define GTSR_ADDR       0x00001110              /* EAS inconsistent */
294
#define PECR1_ADDR      0x00001114              /* EAS inconsistent */
295
#define PECR2_ADDR      0x00001118              /* EAS inconsistent */
296
#define PECR3_ADDR      0x0000111C              /* EAS inconsistent */
297
#define PECR4_ADDR      0x00001120              /* EAS inconsistent */
298
#define PECR5_ADDR      0x00001124              /* EAS inconsistent */
299
#define PECR6_ADDR      0x00001128              /* EAS inconsistent */
300
#define PECR7_ADDR      0x0000112C              /* EAS inconsistent */
301
#define PECR8_ADDR      0x00001130              /* EAS inconsistent */
302
#define PECR9_ADDR      0x00001134              /* EAS inconsistent */
303
#define PECR10_ADDR     0x00001138              /* EAS inconsistent */
304
#define PECR11_ADDR     0x0000113C              /* EAS inconsistent */
305
#define PECR12_ADDR     0x00001140              /* EAS inconsistent */
306
#define PECR13_ADDR     0x00001144              /* EAS inconsistent */
307
#define PECR14_ADDR     0x00001148              /* EAS inconsistent */
308
/* Reserved 0x0000104C through 0x000011FFH */   /* EAS inconsistent */
309
 
310
/* Address Translation Unit 0000 1200H through 0000 12FFH */
311
#define ATUVID_ADDR             0x00001200
312
#define ATUDID_ADDR             0x00001202
313
#define PATUCMD_ADDR            0x00001204
314
#define PATUSR_ADDR             0x00001206
315
#define ATURID_ADDR             0x00001208
316
#define ATUCCR_ADDR             0x00001209
317
#define ATUCLSR_ADDR            0x0000120C
318
#define ATULT_ADDR              0x0000120D
319
#define ATUHTR_ADDR             0x0000120E
320
#define ATUBISTR_ADDR           0x0000120F
321
#define PIABAR_ADDR             0x00001210
322
/* Reserved 0x00001214 through 0x0000122B */
323
#define ASVIR_ADDR              0x0000122C
324
#define ASIR_ADDR               0x0000122E
325
#define ERBAR_ADDR              0x00001230
326
/* Reserved 0x00001234 */
327
/* Reserved 0x00001238 */
328
#define ATUILR_ADDR             0x0000123C
329
#define ATUIPR_ADDR             0x0000123D
330
#define ATUMGNT_ADDR            0x0000123E
331
#define ATUMLAT_ADDR            0x0000123F
332
#define PIALR_ADDR              0x00001240
333
#define PIATVR_ADDR             0x00001244
334
#define SIABAR_ADDR             0x00001248
335
#define SIALR_ADDR              0x0000124C
336
#define SIATVR_ADDR             0x00001250
337
#define POMWVR_ADDR             0x00001254
338
/* Reserved 0x00001258 */
339
#define POIOWVR_ADDR            0x0000125C
340
#define PODWVR_ADDR             0x00001260
341
#define POUDR_ADDR              0x00001264
342
#define SOMWVR_ADDR             0x00001268
343
#define SOIOWVR_ADDR            0x0000126C
344
/* Reserved 0x00001270 */
345
#define ERLR_ADDR               0x00001274
346
#define ERTVR_ADDR              0x00001278
347
/* Reserved 0x0000127C */
348
/* Reserved 0x00001280 */
349
/* Reserved 0x00001284 */
350
#define ATUCR_ADDR              0x00001288
351
/* Reserved 0x0000128C */
352
#define PATUISR_ADDR            0x00001290
353
#define SATUISR_ADDR            0x00001294
354
#define SATUCMD_ADDR            0x00001298
355
#define SATUSR_ADDR             0x0000129A
356
#define SODWVR_ADDR             0x0000129C
357
#define SOUDR_ADDR              0x000012A0
358
#define POCCAR_ADDR             0x000012A4
359
#define SOCCAR_ADDR             0x000012A8
360
#define POCCDR_ADDR             0x000012AC
361
#define SOCCDR_ADDR             0x000012B0
362
#define PAQCR_ADDR              0x000012B4
363
#define SAQCR_ADDR              0x000012B8
364
#define PAIMR_ADDR              0x000012BC
365
#define SAIMR_ADDR              0x000012C0
366
/* Reserved 0x000012C4 through 0x000012FF */
367
 
368
/* Messaging Unit 0000 1300H through 0000 130FH */
369
#define IMR0_ADDR               0x00001310
370
#define IMR1_ADDR               0x00001314
371
#define OMR0_ADDR               0x00001318
372
#define OMR1_ADDR               0x0000131C
373
#define IDR_ADDR                0x00001320
374
#define IISR_ADDR               0x00001324
375
#define IIMR_ADDR               0x00001328
376
#define ODR_ADDR                0x0000132C
377
#define OISR_ADDR               0x00001330
378
#define OIMR_ADDR               0x00001334
379
/* Reserved 0x00001338 through 0x0000134F */
380
#define MUCR_ADDR               0x00001350
381
#define QBAR_ADDR               0x00001354
382
/* Reserved 0x00001358 */
383
/* Reserved 0x0000135C */
384
#define IFHPR_ADDR              0x00001360
385
#define IFTPR_ADDR              0x00001364
386
#define IPHPR_ADDR              0x00001368
387
#define IPTPR_ADDR              0x0000136C
388
#define OFHPR_ADDR              0x00001370
389
#define OFTPR_ADDR              0x00001374
390
#define OPHPR_ADDR              0x00001378
391
#define OPTPR_ADDR              0x0000137C
392
#define IAR_ADDR                0x00001380
393
/* Reserved 0x00001384 through 0x000013FF */
394
 
395
/* DMA Controller 0000 1400H through 0000 14FFH */
396
#define CCR0_ADDR               0x00001400
397
#define CSR0_ADDR               0x00001404
398
/* Reserved 0x00001408 */
399
#define DAR0_ADDR               0x0000140C
400
#define NDAR0_ADDR              0x00001410
401
#define PADR0_ADDR              0x00001414
402
#define PUADR0_ADDR             0x00001418
403
#define LADR0_ADDR              0x0000141C
404
#define BCR0_ADDR               0x00001420
405
#define DCR0_ADDR               0x00001424
406
/* Reserved 0x00001428 through 0x0000143F */
407
#define CCR1_ADDR               0x00001440
408
#define CSR1_ADDR               0x00001444
409
/* Reserved 0x00001448 */
410
#define DAR1_ADDR               0x0000144C
411
#define NDAR1_ADDR              0x00001450
412
#define PADR1_ADDR              0x00001454
413
#define PUADR1_ADDR             0x00001458
414
#define LADR1_ADDR              0x0000145C
415
#define BCR1_ADDR               0x00001460
416
#define DCR1_ADDR               0x00001464
417
/* Reserved 0x00001468 through 0x0000147F */
418
#define CCR2_ADDR               0x00001480
419
#define CSR2_ADDR               0x00001484
420
/* Reserved 0x00001488 */
421
#define DAR2_ADDR               0x0000148C
422
#define NDAR2_ADDR              0x00001490
423
#define PADR2_ADDR              0x00001494
424
#define PUADR2_ADDR             0x00001498
425
#define LADR2_ADDR              0x0000149C
426
#define BCR2_ADDR               0x000014A0
427
#define DCR2_ADDR               0x000014A4
428
/* Reserved 0x000014A8 through 0x000014FF */
429
 
430
/* Memory Controller 0000 1500H through 0000 15FFH */
431
#define SDIR_ADDR               0x00001500
432
#define SDCR_ADDR               0x00001504
433
#define SDBR_ADDR               0x00001508
434
#define SBR0_ADDR               0x0000150C
435
#define SBR1_ADDR               0x00001510
436
#define SDPR0_ADDR              0x00001514
437
#define SDPR1_ADDR              0x00001518
438
#define SDPR2_ADDR              0x0000151C
439
#define SDPR3_ADDR              0x00001520
440
#define SDPR4_ADDR              0x00001524
441
#define SDPR5_ADDR              0x00001528
442
#define SDPR6_ADDR              0x0000152C
443
#define SDPR7_ADDR              0x00001530
444
#define ECCR_ADDR               0x00001534
445
#define ELOG0_ADDR              0x00001538
446
#define ELOG1_ADDR              0x0000153C
447
#define ECAR0_ADDR              0x00001540
448
#define ECAR1_ADDR              0x00001544
449
#define ECTST_ADDR              0x00001548
450
#define FEBR0_ADDR              0x0000154C
451
#define FEBR1_ADDR              0x00001550
452
#define FBSR0_ADDR              0x00001554
453
#define FBSR1_ADDR              0x00001558
454
#define FWSR0_ADDR              0x0000155C
455
#define FWSR1_ADDR              0x00001560
456
#define MCISR_ADDR              0x00001564
457
#define RFR_ADDR                0x00001568
458
/* Reserved 0x0000156C through 0x000015FF */
459
 
460
/* Arbitration Control Unit 0000 1600H through 0000 167FH */
461
#define IACR_ADDR               0x00001600
462
#define MLTR_ADDR               0x00001604
463
#define MTTR_ADDR               0x00001608
464
/* Reserved 0x0000160C through 0x0000163F */
465
 
466
/* Bus Interface Control Unit 0000 1640H through 0000 167FH */
467
#define BIUCR_ADDR              0x00001640
468
#define BIUISR_ADDR             0x00001644
469
/* Reserved 0x00001648 through 0x0000167F */
470
 
471
/* I2C Bus Interface Unit 0000 1680H through 0000 16FFH */
472
#define ICR_ADDR                0x00001680
473
#define ISR_ADDR                0x00001684
474
#define ISAR_ADDR               0x00001688
475
#define IDBR_ADDR               0x0000168C
476
#define ICCR_ADDR               0x00001690
477
#define IBMR_ADDR               0x00001694
478
/* Reserved 0x00001698 through 0x000016FF */
479
 
480
/* PCI And Peripheral Interrupt Controller 0000 1700H through 0000 17FFH */
481
#define NISR_ADDR               0x00001700
482
#define X7ISR_ADDR              0x00001704
483
#define X6ISR_ADDR              0x00001708
484
#define PDIDR_ADDR              0x00001710              /* EAS inconsistent */
485
/* Reserved 0x00001714 through 0x0000177F */
486
 
487
/* Application Accelerator Unit 0000 1800H through 0000 18FFH */
488
#define ACR_ADDR                0x00001800
489
#define ASR_ADDR                0x00001804
490
#define ADAR_ADDR               0x00001808
491
#define ANDAR_ADDR              0x0000180C
492
#define SAR1_ADDR               0x00001810
493
#define SAR2_ADDR               0x00001814
494
#define SAR3_ADDR               0x00001818
495
#define SAR4_ADDR               0x0000181C
496
#define DAR_ADDR                0x00001820
497
#define ABCR_ADDR               0x00001824
498
#define ADCR_ADDR               0x00001828
499
#define SAR5_ADDR               0x0000182C
500
#define SAR6_ADDR               0x00001830
501
#define SAR7_ADDR               0x00001834
502
#define SAR8_ADDR               0x00001838
503
 
504
/* Reserved 0x0000183C through 0x000018FF */
505
 
506
#define X6ISR_REG ((volatile cyg_uint32 *)X6ISR_ADDR)
507
#  define X6ISR_DIP0 0x01
508
#  define X6ISR_DIP1 0x02
509
#  define X6ISR_DIP2 0x04
510
#  define X6ISR_EMIP 0x10
511
#  define X6ISR_AAIP 0x20
512
 
513
#define X7ISR_REG ((volatile cyg_uint32 *)X7ISR_ADDR)
514
#  define X7ISR_ISQC 0x02
515
#  define X7ISR_INDB 0x04
516
#  define X7ISR_BIST 0x08
517
 
518
#define NISR_REG ((volatile cyg_uint32 *)NISR_ADDR)
519
#  define NISR_MCU  0x01    
520
#  define NISR_PATU 0x02
521
#  define NISR_SATU 0x04
522
#  define NISR_PBDG 0x08
523
#  define NISR_SBDG 0x10
524
#  define NISR_DMA0 0x20
525
#  define NISR_DMA1 0x40
526
#  define NISR_DMA2 0x80
527
#  define NISR_MU   0x100
528
#  define NISR_AAU  0x400
529
#  define NISR_BIU  0x800
530
 
531
#define PIRSR_REG       REG32(0,PIRSR_ADDR)
532
#define IISR_REG        REG32(0,IISR_ADDR)
533
#define IIMR_REG        REG32(0,IIMR_ADDR)
534
#define OISR_REG        REG32(0,OISR_ADDR)
535
#define OIMR_REG        REG32(0,OIMR_ADDR)
536
#define EMISR_REG       REG32(0,EMISR_ADDR)
537
#define ISR_REG         REG32(0,ISR_ADDR)
538
#define GTMR_REG        REG32(0,GTMR_ADDR)
539
#define ESR_REG         REG32(0,ESR_ADDR)
540
#define ADCR_REG        REG32(0,ADCR_ADDR)
541
#define ICR_REG         REG32(0,ICR_ADDR)
542
#define ATUCR_REG       REG32(0,ATUCR_ADDR)
543
 
544
#define DCR0_REG        REG32(0,DCR0_ADDR)
545
#define DCR1_REG        REG32(0,DCR1_ADDR)
546
#define DCR2_REG        REG32(0,DCR2_ADDR)
547
 
548
#define ECCR_REG        REG32(0,ECCR_ADDR)
549
#define MCISR_REG       REG32(0,MCISR_ADDR)
550
#define ELOG0_REG       REG32(0,ELOG0_ADDR)
551
#define ELOG1_REG       REG32(0,ELOG1_ADDR)
552
#define ECAR0_REG       REG32(0,ECAR0_ADDR)
553
#define ECAR1_REG       REG32(0,ECAR1_ADDR)
554
 
555
#define PATUISR_REG     REG32(0,PATUISR_ADDR)
556
#define SATUISR_REG     REG32(0,SATUISR_ADDR)
557
#define PBISR_REG       REG32(0,PBISR_ADDR)
558
#define SBISR_REG       REG32(0,SBISR_ADDR)
559
#define CSR0_REG        REG32(0,CSR0_ADDR)
560
#define CSR1_REG        REG32(0,CSR1_ADDR)
561
#define CSR2_REG        REG32(0,CSR2_ADDR)
562
#define IISR_REG        REG32(0,IISR_ADDR)
563
#define ASR_REG         REG32(0,ASR_ADDR)
564
#define BIUISR_REG      REG32(0,BIUISR_ADDR)
565
 
566
#define PATUSR_REG      REG16(0,PATUSR_ADDR)
567
#define SATUSR_REG      REG16(0,SATUSR_ADDR)
568
#define PSR_REG         REG16(0,PSR_ADDR)
569
#define SSR_REG         REG16(0,SSR_ADDR)
570
 
571
#define PCR_REG         REG16(0,PCR_ADDR)
572
#define PBNR_REG        REG8(0,PBNR_ADDR)
573
#define SBNR_REG        REG8(0,SBNR_ADDR)
574
#define SUBBNR_REG      REG8(0,SUBBNR_ADDR)
575
#define BCR_REG         REG16(0,BCR_ADDR)
576
#define PATUCMD_REG     REG32(0,PATUCMD_ADDR)
577
#define PIABAR_REG      REG32(0,PIABAR_ADDR)
578
#define SIABAR_REG      REG32(0,SIABAR_ADDR)
579
#define SIALR_REG       REG32(0,SIALR_ADDR)
580
#define SIATVR_REG      REG32(0,SIATVR_ADDR)
581
#define POMWVR_REG      REG32(0,POMWVR_ADDR)
582
#define POIOWVR_REG     REG32(0,POIOWVR_ADDR)
583
#define PODWVR_REG      REG32(0,PODWVR_ADDR)
584
#define SOMWVR_REG      REG32(0,SOMWVR_ADDR)
585
#define SOIOWVR_REG     REG32(0,SOIOWVR_ADDR)
586
#define SATUCMD_REG     REG16(0,SATUCMD_ADDR)
587
#define SODWVR_REG      REG32(0,SODWVR_ADDR)
588
 
589
 
590
#define MEMBASE_DRAM 0xa0000000
591
 
592
/* primary PCI bus definitions */
593
#define PRIMARY_BUS_NUM         0
594
#define PRIMARY_MEM_BASE        0x80000000
595
#define PRIMARY_DAC_BASE        0x84000000
596
#define PRIMARY_IO_BASE         0x90000000
597
#define PRIMARY_MEM_LIMIT       0x83ffffff
598
#define PRIMARY_DAC_LIMIT       0x87ffffff
599
#define PRIMARY_IO_LIMIT        0x9000ffff
600
 
601
/* secondary PCI bus definitions */
602
#define SECONDARY_BUS_NUM       1
603
#define SECONDARY_MEM_BASE      0x88000000
604
#define SECONDARY_DAC_BASE      0x8c000000
605
#define SECONDARY_IO_BASE       0x90010000
606
#define SECONDARY_MEM_LIMIT     0x8bffffff
607
#define SECONDARY_DAC_LIMIT     0x8fffffff
608
#define SECONDARY_IO_LIMIT      0x9001ffff
609
 
610
#ifndef __ASSEMBLER__
611
extern unsigned int _80312_EMISR;  // Only valid for PEC ISR
612
#endif
613
 
614
// ------------------------------------------------------------------------
615
#ifdef __ASSEMBLER__
616
// Macro to perform early setup (in hal_platform_setup.h) of some PCI
617
// registers. This should be used prior to the ECC scrup loop to prevent
618
// timeouts with some Plug 'n Play PC BIOSes. Before the 'retry' bit is
619
// cleared, this macro must setup the vendor/device ID and the primary
620
// inbound window BAR to allow primary side access to SDRAM.
621
//
622
//  Input: reg, reg1      -- scratch registers
623
//         reg_dram_size  -- register holding size of SDRAM
624
//         vendor_id      -- PCI vendor ID
625
//         device_id      -- PCI device ID
626
 
627
.macro IOP310_EARLY_PCI_SETUP reg0, reg1, reg_dram_size, vendor_id, device_id
628
        // Setup vendor/device ID for 80312
629
        ldr     \reg0, =ASVIR_ADDR
630
        ldr     \reg1, =\vendor_id
631
        strh    \reg1, [\reg0]
632
        ldr     \reg0, =ASIR_ADDR
633
        ldr     \reg1, =\device_id
634
        strh    \reg1, [\reg0]
635
        // Make all secondary bus devices private
636
        ldr     \reg0, =SISR_ADDR
637
        ldr     \reg1, =0x03FF
638
        strh    \reg1, [\reg0]
639
        // Setup primary inbound window into SDRAM
640
        ldr     \reg0, =PIATVR_ADDR
641
        mov     \reg1, #0xa0000000
642
        str     \reg1, [\reg0]
643
        ldr     \reg0, =PIALR_ADDR
644
        sub     \reg1, \reg_dram_size, #1  // dram_size - 1
645
        mvn     \reg1, \reg1               // 1s complement
646
        str     \reg1, [\reg0]
647
#ifdef CYGSEM_HAL_ARM_IOP310_CLEAR_PCI_RETRY
648
        ldr     \reg0, =EBCR_ADDR
649
        mov     \reg1, #0x0008
650
        strh    \reg1, [\reg0]
651
#endif  
652
.endm
653
 
654
#endif // __ASSEMBLER__
655
 
656
// ------------------------------------------------------------------------
657
 
658
// Override the default MMU off code. This is intended
659
// to be included in an inline asm statement.
660
#define CYGARC_HAL_MMU_OFF(__paddr__)        \
661
              "   mrc p15,0,r0,c1,c0,0\n"    \
662
              "   bic r0,r0,#0x05\n"         \
663
              "   b 99f\n"                   \
664
              "   .p2align 5\n"              \
665
              "99:\n"                        \
666
              "   mcr p15,0,r0,c1,c0,0\n"    \
667
              "   mrc p15,0,r0,c2,c0,0\n"    \
668
              "   mov r0,r0\n"               \
669
              "   sub pc,pc,#4\n"            \
670
              "   mov pc," #__paddr__ "\n"
671
 
672
 
673
/*---------------------------------------------------------------------------*/
674
/* end of hal_iop310.h                                                         */
675
#endif /* CYGONCE_HAL_IOP310_H */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.