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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [arch-trio/] [hardware.h] - Blame information for rev 1777

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

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/arch-trio/hardware.h
3
 *
4
 * Copyright (C) 1996 Russell King.
5
 *
6
 * This file contains the hardware definitions of the APLIO TRIO series machines.
7
 */
8
 
9
#ifndef __ASM_ARCH_HARDWARE_H
10
#define __ASM_ARCH_HARDWARE_H
11
 
12
/*
13
 * What hardware must be present
14
 */
15
#ifndef __ASSEMBLER__
16
 
17
typedef unsigned long u_32;
18
/* ARM asynchronous clock */
19
#define ARM_CLK         ((u_32)(24000000))
20
/* ARM synchronous with OAK clock */
21
#define A_O_CLK         ((u_32)(20000000))
22
 
23
#else
24
 
25
#define ARM_CLK 24000000
26
#define A_O_CLK 20000000
27
 
28
#endif
29
 
30
#ifndef __ASSEMBLER__
31
/*
32
 * RAM definitions
33
 */
34
#define MAPTOPHYS(a)            ((unsigned long)a)
35
#define KERNTOPHYS(a)           ((unsigned long)(&a))
36
#define GET_MEMORY_END(p)       ((p->u1.s.page_size) * (p->u1.s.nr_pages))
37
#define PARAMS_BASE                     0x1000
38
//#define KERNEL_BASE           (PAGE_OFFSET + 0x80000)
39
#endif
40
 
41
#define IO_BASE         0
42
#define PERIPH_BASE 0xff000000
43
#define OAKA_PRAM       0xfd000000
44
#define OAKB_PRAM       0xfe000000
45
 
46
#define SRAM_BASE       0xfc000000
47
#define SRAM_SIZE       0x1000
48
 
49
#define DPMBA_BASE  0xfa000000
50
#define DPMBB_BASE  0xfb000000
51
#define DPMB_SIZE       0x800
52
 
53
#define BOOTROM_BASE 0xfb000000
54
#define BOOTROM_SIZE 0x400
55
 
56
/*
57
        Peripherials
58
*/
59
#define SIAP_BASE       (PERIPH_BASE+0)
60
#define SMC_BASE        (PERIPH_BASE+0x4000)
61
#define DMC_BASE        (PERIPH_BASE+0x8000)
62
#define PIOA_BASE       (PERIPH_BASE+0xc000)
63
#define PIOB_BASE       (PERIPH_BASE+0x10000)
64
#define KB_BASE         (PERIPH_BASE+0x10000)
65
#define TMC_BASE        (PERIPH_BASE+0x14000)
66
#define USARTA_BASE     (PERIPH_BASE+0x18000)
67
#define USARTB_BASE     (PERIPH_BASE+0x1c000)
68
#define SPI_BASE        (PERIPH_BASE+0x20000)
69
#define WDG_BASE        (PERIPH_BASE+0x28000)
70
#define AIC_BASE        (PERIPH_BASE+0x30000)
71
/*
72
        SIAP registers
73
*/
74
#define SIAP_MD   (SIAP_BASE)
75
#define SIAP_ID   (SIAP_BASE+4)
76
#define SIAP_RST   (SIAP_BASE+8)
77
 
78
/* SIAP mode register */
79
#define SIAP_SW2        (1<<11)
80
#define SIAP_SW1        (1<<10)
81
#define SIAP_LPCS(x)(x<<8 & 0x300)
82
#define SIAP_LP         (1<<6)
83
#define SIAP_CS         (1<<5)
84
#define SIAP_IB         (1<<4)
85
#define SIAP_IA         (1<<3)
86
#define SIAP_RB         (1<<2)
87
#define SIAP_RA         (1<<1)
88
#define SIAP_RM         (1)
89
 
90
/* SIAP ID register */
91
#define SIAP_PKG        (1<<31)
92
#define SIAP_VERS       (1)     
93
 
94
/* SIAP reset register */
95
#define SIAP_RESET      (7)     
96
 
97
/*
98
        DRAM Memory controller registers
99
*/
100
#define DMR0    (DMC_BASE + 0)          
101
#define DMR1    (DMC_BASE + 4)
102
#define DMC_CR  (DMC_BASE + 8)
103
 
104
/* DMRx registers */
105
#define DMR_EMR         1
106
#define DMR_PS(x)       (x<<1 & 6)
107
#define DMR_SZ(x)       (x<<3 & 0x18)
108
 
109
/* DMR memory control register */
110
#define DMR_ROR         (1<<2)
111
#define DMR_BBR         (1<<1)
112
#define DMR_DBW         1
113
 
114
/*
115
        Static Memory controller registers
116
*/
117
#define SMC_CSR0        (SMC_BASE + 0)          
118
#define SMC_CSR1        (SMC_BASE + 4)          
119
#define SMC_CSR2        (SMC_BASE + 8)          
120
#define SMC_CSR3        (SMC_BASE + 0xc)                
121
#define SMC_MCR         (SMC_BASE + 0x24)               
122
 
123
/* SMC chip select registers */
124
#define SMC_CSEN        (1<<13)
125
#define SMC_BAT         (1<<12)
126
#define SMC_TDF(x)      (x<<9 & 0xe000)
127
#define SMC_PGS(x)      (x<<7 & 0x1800)
128
#define SMC_WSE         (1<<5)
129
#define SMC_NWS(x)      (x<<2 & 0x1c)
130
#define SMC_DBW(x)      (x & 3)
131
 
132
/* SMC memory control register */
133
#define SMC_DRP         (1<<4)
134
 
135
/*
136
        Dual Port Memory A
137
*/
138
#define DPMBA_S0        (DPMBA_BASE + 0x200)
139
#define DPMBA_S1        (DPMBA_BASE + 0x204)
140
#define DPMBA_S2        (DPMBA_BASE + 0x208)
141
#define DPMBA_S3        (DPMBA_BASE + 0x20c)
142
#define DPMBA_S4        (DPMBA_BASE + 0x210)
143
#define DPMBA_S5        (DPMBA_BASE + 0x214)
144
#define DPMBA_S6        (DPMBA_BASE + 0x218)
145
#define DPMBA_S7        (DPMBA_BASE + 0x21c)
146
#define DPMBA_CC        (DPMBA_BASE + 0x220)
147
/*
148
        Dual Port Memory B
149
*/
150
#define DPMBB_S0        (DPMBB_BASE + 0x200)
151
#define DPMBB_S1        (DPMBB_BASE + 0x204)
152
#define DPMBB_S2        (DPMBB_BASE + 0x208)
153
#define DPMBB_S3        (DPMBB_BASE + 0x20c)
154
#define DPMBB_S4        (DPMBB_BASE + 0x210)
155
#define DPMBB_S5        (DPMBB_BASE + 0x214)
156
#define DPMBB_S6        (DPMBB_BASE + 0x218)
157
#define DPMBB_S7        (DPMBB_BASE + 0x21c)
158
#define DPMBB_CC        (DPMBB_BASE + 0x220)
159
/*
160
        Timer  registers
161
*/
162
#define TC0_BASE        (TMC_BASE + 0)
163
#define TC1_BASE        (TMC_BASE + 0x40)
164
#define TC2_BASE        (TMC_BASE + 0x80)
165
 
166
#define TC_OFFSET 0x14000
167
#define TC_BASE(i) (PERIPH_BASE+TC_OFFSET+(i)*0x40)
168
 
169
#define TC_BCR          (TMC_BASE + 0xC0)
170
#define TC_BMR          (TMC_BASE + 0xC4)
171
 
172
#ifndef __ASSEMBLER__
173
struct trio_timer_channel
174
{
175
        unsigned long ccr;                              // channel control register             (WO)
176
        unsigned long cmr;                              // channel mode register                (RW)
177
        unsigned long reserved[2];
178
        unsigned long cv;                               // counter value                                (RW)
179
        unsigned long ra;                               // register A                                   (RW)
180
        unsigned long rb;                               // register B                                   (RW)
181
        unsigned long rc;                               // register C                                   (RW)
182
        unsigned long sr;                               // status register                              (RO)
183
        unsigned long ier;                              // interrupt enable register    (WO)
184
        unsigned long idr;                              // interrupt disable register   (WO)
185
        unsigned long imr;                              // interrupt mask register              (RO)
186
};
187
 
188
struct trio_timers
189
{
190
        struct {
191
                struct trio_timer_channel ch;
192
                unsigned char padding[0x40-sizeof(struct trio_timer_channel)];
193
        } chans[3];
194
        unsigned  long bcr;                             // block control register               (WO)
195
        unsigned  long bmr;                             // block mode    register               (RW)
196
};
197
 
198
#endif
199
 
200
/*  TC control register */
201
#define TC_SYNC (1)
202
 
203
/*  TC mode register */
204
#define TC2XC2S(x)      (x & 0x3)
205
#define TC1XC1S(x)      (x<<2 & 0xc)
206
#define TC0XC0S(x)      (x<<4 & 0x30)
207
 
208
/* TC channel control */
209
#define TC_CLKEN        (1)                     
210
#define TC_CLKDIS       (1<<1)                  
211
#define TC_SWTRG        (1<<2)                  
212
 
213
/* TC interrupts enable/disable/mask and status registers */
214
#define TC_MTIOB        (1<<18)
215
#define TC_MTIOA        (1<<17)
216
#define TC_CLKSTA       (1<<16)
217
 
218
#define TC_ETRGS        (1<<7)
219
#define TC_LDRBS        (1<<6)
220
#define TC_LDRAS        (1<<5)
221
#define TC_CPCS         (1<<4)
222
#define TC_CPBS         (1<<3)
223
#define TC_CPAS         (1<<2)
224
#define TC_LOVRS        (1<<1)
225
#define TC_COVFS        (1)
226
 
227
#ifndef __ASSEMBLER__
228
/*
229
        UART registers
230
*/
231
struct uart_regs{
232
        u_32 cr;                // control 
233
        u_32 mr;                // mode
234
        u_32 ier;               // interrupt enable
235
        u_32 idr;               // interrupt disable
236
        u_32 imr;               // interrupt mask
237
        u_32 csr;               // channel status
238
        u_32 rhr;               // receive holding 
239
        u_32 thr;               // tramsmit holding             
240
        u_32 brgr;              // baud rate generator          
241
        u_32 rtor;              // rx time-out
242
        u_32 ttgr;              // tx time-guard
243
        u_32 res1;
244
        u_32 rpr;               // rx pointer
245
        u_32 rcr;               // rx counter
246
        u_32 tpr;               // tx pointer
247
        u_32 tcr;               // tx counter
248
        u_32 mc;                // modem control
249
        u_32 ms;                // modem status
250
};
251
#endif
252
 
253
/*  US control register */
254
#define US_SENDA        (1<<12)
255
#define US_STTO         (1<<11)
256
#define US_STPBRK       (1<<10)
257
#define US_STTBRK       (1<<9)
258
#define US_RSTSTA       (1<<8)
259
#define US_TXDIS        (1<<7)
260
#define US_TXEN         (1<<6)
261
#define US_RXDIS        (1<<5)
262
#define US_RXEN         (1<<4)
263
#define US_RSTTX        (1<<3)
264
#define US_RSTRX        (1<<2)
265
 
266
/* US mode register */
267
#define US_CLK0         (1<<18)
268
#define US_MODE9        (1<<17)
269
#define US_CHMODE(x)(x<<14 & 0xc000)
270
#define US_NBSTOP(x)(x<<12 & 0x3000)
271
#define US_PAR(x)       (x<<9 & 0xe00)
272
#define US_SYNC         (1<<8)
273
#define US_CHRL(x)      (x<<6 & 0xc0)
274
#define US_USCLKS(x)(x<<4 & 0x30)
275
 
276
/* US interrupts enable/disable/mask and status register */
277
#define US_DMSI         (1<<10)
278
#define US_TXEMPTY      (1<<9)
279
#define US_TIMEOUT      (1<<8)
280
#define US_PARE         (1<<7)
281
#define US_FRAME        (1<<6)
282
#define US_OVRE         (1<<5)
283
#define US_ENDTX        (1<<4)
284
#define US_ENDRX        (1<<3)
285
#define US_RXBRK        (1<<2)
286
#define US_TXRDY        (1<<1)
287
#define US_RXRDY        (1)
288
 
289
#define US_ALL_INTS (US_DMSI|US_TXEMPTY|US_TIMEOUT|US_PARE|US_FRAME|US_OVRE|US_ENDTX|US_ENDRX|US_RXBRK|US_TXRDY|US_RXRDY)
290
 
291
 
292
/* US modem control register */
293
#define US_FCM  (1<<5)
294
#define US_RTS  (1<<1)
295
#define US_DTR  (1)
296
 
297
/* US modem status register */
298
#define US_FCMS (1<<8)
299
#define US_DCD  (1<<7)
300
#define US_RI   (1<<6)
301
#define US_DSR  (1<<5)
302
#define US_CTS  (1<<4)
303
#define US_DDCD (1<<3)
304
#define US_TERI (1<<2)
305
#define US_DDSR (1<<1)
306
#define US_DCTS (1)
307
 
308
/*
309
        Advanced Interrupt Controller registers
310
*/
311
#define AIC_SMR(i)  (AIC_BASE+i*4)
312
#define AIC_IVR     (AIC_BASE+0x100)
313
#define AIC_FVR     (AIC_BASE+0x104)
314
#define AIC_ISR     (AIC_BASE+0x108)
315
#define AIC_IPR     (AIC_BASE+0x10C)
316
#define AIC_IMR     (AIC_BASE+0x110)
317
#define AIC_CISR        (AIC_BASE+0x114)
318
#define AIC_IECR        (AIC_BASE+0x120)
319
#define AIC_IDCR        (AIC_BASE+0x124)
320
#define AIC_ICCR        (AIC_BASE+0x128)
321
#define AIC_ISCR        (AIC_BASE+0x12C)
322
#define AIC_EOICR   (AIC_BASE+0x130)
323
 
324
/* AIC enable/disable/mask/pending registers */
325
 
326
#define AIC_PIOB        (1<<15)
327
#define AIC_UB          (1<<14)
328
#define AIC_OAKB        (1<<13)
329
#define AIC_OAKA        (1<<12)
330
#define AIC_IRQ1        (1<<11)
331
#define AIC_IRQ0        (1<<10)
332
#define AIC_SPI         (1<<9)
333
#define AIC_LCD         (1<<8)
334
#define AIC_PIOA        (1<<7)
335
#define AIC_TC2         (1<<6)
336
#define AIC_TC1         (1<<5)
337
#define AIC_TC0         (1<<4)
338
#define AIC_UA          (1<<3)
339
#define AIC_SWI         (1<<2)
340
#define AIC_WD          (1<<1)
341
#define AIC_FIQ         (1)
342
/*
343
        PIOA registers
344
*/
345
#define PIOA_PER        (PIOA_BASE+0)                   
346
#define PIOA_PDR        (PIOA_BASE+0x4)                 
347
#define PIOA_PSR        (PIOA_BASE+0x8)                 
348
 
349
#define PIOA_OER        (PIOA_BASE+0x10)                
350
#define PIOA_ODR        (PIOA_BASE+0x14)                
351
#define PIOA_OSR        (PIOA_BASE+0x18)                
352
 
353
#define PIOA_IFER       (PIOA_BASE+0x20)                
354
#define PIOA_IFDR       (PIOA_BASE+0x24)                
355
#define PIOA_IFSR       (PIOA_BASE+0x28)                
356
 
357
#define PIOA_SODR       (PIOA_BASE+0x30)                
358
#define PIOA_CODR       (PIOA_BASE+0x34)                
359
#define PIOA_ODSR       (PIOA_BASE+0x38)                
360
 
361
#define PIOA_PDSR       (PIOA_BASE+0x3C)                
362
 
363
#define PIOA_IER        (PIOA_BASE+0x40)                
364
#define PIOA_IDR        (PIOA_BASE+0x44)                
365
#define PIOA_IMR        (PIOA_BASE+0x48)                
366
#define PIOA_ISR        (PIOA_BASE+0x4C)                
367
 
368
/* PIOA bit allocation */
369
#define PIOA_TCLK0      (1<<8)                                  
370
#define PIOA_TI0A0      (1<<9)                                  
371
#define PIOA_TI0B0      (1<<10)                                 
372
#define PIOA_SCLKA      (1<<11)                                 
373
#define PIOA_NPCS1      (1<<12)                                 
374
#define PIOA_SCLKB      (1<<13)                                 
375
#define PIOA_NPCS2      (1<<14)                                 
376
#define PIOA_NPCS3      (1<<15)                                 
377
#define PIOA_TCLK2      (1<<16)                                 
378
#define PIOA_TIOA2      (1<<17)                                 
379
#define PIOA_TIOB2      (1<<18)                                 
380
#define PIOA_ACLK       (1<<19)                                 
381
 
382
/*
383
        PIOB registers
384
*/
385
#define PIOB_PER        (PIOB_BASE+0)                   
386
#define PIOB_PDR        (PIOB_BASE+0x4)                 
387
#define PIOB_PSR        (PIOB_BASE+0x8)                 
388
 
389
#define PIOB_OER        (PIOB_BASE+0x10)                
390
#define PIOB_ODR        (PIOB_BASE+0x14)                
391
#define PIOB_OSR        (PIOB_BASE+0x18)                
392
 
393
#define PIOB_IFER       (PIOB_BASE+0x20)                
394
#define PIOB_IFDR       (PIOB_BASE+0x24)                
395
#define PIOB_IFSR       (PIOB_BASE+0x28)                
396
 
397
#define PIOB_SODR       (PIOB_BASE+0x30)                
398
#define PIOB_CODR       (PIOB_BASE+0x34)                
399
#define PIOB_ODSR       (PIOB_BASE+0x38)                
400
 
401
#define PIOB_PDSR       (PIOB_BASE+0x3C)                
402
 
403
#define PIOB_IER        (PIOB_BASE+0x40)                
404
#define PIOB_IDR        (PIOB_BASE+0x44)                
405
#define PIOB_IMR        (PIOB_BASE+0x48)                
406
#define PIOB_ISR        (PIOB_BASE+0x4C)                
407
 
408
/* PIOB bit allocation */
409
#define PIOB_TCLK1      (1)                                     
410
#define PIOB_TIOA1      (1<<1)                          
411
#define PIOB_TIOB1      (1<<2)                          
412
#define PIOB_NCTSA      (1<<3)                          
413
 
414
#define PIOB_NRIA       (1<<5)                          
415
#define PIOB_NWDOVF     (1<<6)                          
416
#define PIOB_NCE1       (1<<7)                          
417
#define PIOB_NCE2       (1<<8)                          
418
 
419
#ifndef __ASSEMBLER__
420
struct pio_regs{
421
        u_32 per;
422
        u_32 pdr;
423
        u_32 psr;
424
        u_32 res1;
425
        u_32 oer;
426
        u_32 odr;
427
        u_32 osr;
428
        u_32 res2;
429
        u_32 ifer;
430
        u_32 ifdr;
431
        u_32 ifsr;
432
        u_32 res3;
433
        u_32 sodr;
434
        u_32 codr;
435
        u_32 odsr;
436
        u_32 pdsr;
437
        u_32 ier;
438
        u_32 idr;
439
        u_32 imr;
440
        u_32 isr;
441
};
442
#endif
443
 
444
/*
445
        Serial Peripheral Interface
446
*/
447
#define SP_CR           (SPI_BASE + 0)
448
#define SP_MR           (SPI_BASE + 4)
449
#define SP_RDR          (SPI_BASE + 8)
450
#define SP_TDR          (SPI_BASE + 0xC)
451
#define SP_SR           (SPI_BASE + 0x10)
452
#define SP_IER          (SPI_BASE + 0x14)
453
#define SP_IDR          (SPI_BASE + 0x18)
454
#define SP_IMR          (SPI_BASE + 0x1C)
455
#define SP_CSR0         (SPI_BASE + 0x30)
456
#define SP_CSR1         (SPI_BASE + 0x34)
457
#define SP_CSR2         (SPI_BASE + 0x38)
458
#define SP_CSR3         (SPI_BASE + 0x3C)
459
 
460
#ifndef __ASSEMBLER__
461
struct spi_regs{
462
        u_32 cr;
463
        u_32 mr;
464
        u_32 rdr;
465
        u_32 tdr;
466
        u_32 sr;
467
        u_32 ier;
468
        u_32 idr;
469
        u_32 imr;
470
        u_32 res1;
471
        u_32 res2;
472
        u_32 res3;
473
        u_32 res4;
474
        u_32 csr0;
475
        u_32 csr1;
476
        u_32 csr2;
477
        u_32 csr3;
478
};
479
#endif
480
 
481
/* SPI control register */
482
#define SPI_SWRST               (1<<7)
483
#define SPI_SPIDIS              (1<<1)
484
#define SPI_SPIEN               (1)
485
 
486
/* SPI mode register */
487
#define SPI_MSTR                (1)
488
#define SPI_PS                  (1<<1)
489
#define SPI_PCSDEC              (1<<2)
490
#define SPI_MCSK32              (1<<3)
491
#define SPI_LLB                 (1<<7)
492
#define SPI_PCS(x)              (x<<16 & 0xF0000)
493
#define SPI_DLYBCS(x)   (x<<24 & 0xFF000000)
494
 
495
/* SPI Receive/Transmit Data Register */
496
#define SPI_PCS_MASK    (0xF0000)
497
 
498
/* SPI Interrupt enable/disable and Status registers */
499
#define SPI_OVRES               (1<<3)
500
#define SPI_MODF                (1<<2)
501
#define SPI_TDRE                (1<<1)
502
#define SPI_RDRF                (1)
503
 
504
/* SPI chip selects registers */
505
#define SPI_CPOL                (1)
506
#define SPI_NCPHA               (1<<1)
507
 
508
#define SPI_BITS_MASK   0xF0
509
#define SPI_SCBR_MASK   0xF00
510
#define SPI_DLYBS_MASK  0xF0000
511
#define SPI_DLYBCT_MASK 0xF000000
512
 
513
#define SPI_BITS(x)             (x<<4 & SPI_BITS_MASK)
514
#define SPI_SCBR(x)             (x<<8 & SPI_SCBR_MASK)
515
#define SPI_DLYBS(x)    (x<<16 & SPI_DLYBS_MASK)
516
#define SPI_DLYBCT(x)   (x<<24 & SPI_DLYBCT_MASK)
517
 
518
/*
519
        Watchdog registers
520
*/
521
#define WDG_OMR         (WD_BASE + 0)
522
#define WDG_CMR         (WD_BASE + 4)
523
#define WDG_CR          (WD_BASE + 8)
524
#define WDG_SR          (WD_BASE + 0xC)
525
 
526
/* Overflow Mode Register */
527
#define WDG_OKEY_MASK   0xFFF0
528
#define WDG_OKEY(x)             (x<<4 & WDG_OKEY_MASK)
529
#define WDG_EXTEN               (1<<3)
530
#define WDG_IRQEN               (1<<2)
531
#define WDG_RSTEN               (1<<1)
532
#define WDG_WDEN                (1)
533
 
534
/* Clock Mode Register */
535
#define WDG_CKEY_MASK   0xFF80
536
#define WDG_HPCV_MASK   0x3C
537
#define WDG_WDCLKS_MASK 0x3
538
#define WDG_CKEY(x)             (x<<7 & WDG_CKEY_MASK)
539
#define WDG_HPCV(x)             (x<<2 & WDG_HPCV_MASK)
540
#define WDG_WDCLKS(x)   (x & WDG_WDCLKS_MASK)
541
 
542
/* Control Register */
543
#define WDG_RESTART_KEY         0xC071
544
 
545
/* Status Register */
546
#define WDG_WDOVF               (1)
547
 
548
 
549
#endif
550
 

powered by: WebSVN 2.1.0

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