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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [asm/] [or1k.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
 
2
/* include/asm-or1k/or1k.h: OR1K control registers
3
 */
4
 
5
#ifndef _MC68EZ328_H_
6
#define _MC68EZ328_H_
7
 
8
#define BYTE_REF(addr) (*((volatile unsigned char*)addr))
9
#define WORD_REF(addr) (*((volatile unsigned short*)addr))
10
#define LONG_REF(addr) (*((volatile unsigned long*)addr))
11
 
12
#define PUT_FIELD(field, val) (((val) << field##_SHIFT) & field##_MASK)
13
#define GET_FIELD(reg, field) (((reg) & field##_MASK) >> field##_SHIFT)
14
 
15
/**********
16
 *
17
 * 0xFFFFF0xx -- System Control
18
 *
19
 **********/
20
 
21
/*
22
 * System Control Register (SCR)
23
 */
24
#define SCR_ADDR        0xfffff000
25
#define SCR             BYTE_REF(SCR_ADDR)
26
 
27
#define SCR_WDTH8       0x01    /* 8-Bit Width Select */
28
#define SCR_DMAP        0x04    /* Double Map */
29
#define SCR_SO          0x08    /* Supervisor Only */
30
#define SCR_BETEN       0x10    /* Bus-Error Time-Out Enable */
31
#define SCR_PRV         0x20    /* Privilege Violation */
32
#define SCR_WPV         0x40    /* Write Protect Violation */
33
#define SCR_BETO        0x80    /* Bus-Error TimeOut */
34
 
35
/*
36
 * Silicon ID Register (Mask Revision Register (MRR) for '328 Compatibility)
37
 */
38
#define MRR_ADDR 0xfffff004
39
#define MRR      LONG_REF(MRR_ADDR)
40
 
41
/**********
42
 *
43
 * 0xFFFFF1xx -- Chip-Select logic
44
 *
45
 **********/
46
 
47
/*
48
 * Chip Select Group Base Registers
49
 */
50
#define CSGBA_ADDR      0xfffff100
51
#define CSGBB_ADDR      0xfffff102
52
 
53
#define CSGBC_ADDR      0xfffff104
54
#define CSGBD_ADDR      0xfffff106
55
 
56
#define CSGBA           WORD_REF(CSGBA_ADDR)
57
#define CSGBB           WORD_REF(CSGBB_ADDR)
58
#define CSGBC           WORD_REF(CSGBC_ADDR)
59
#define CSGBD           WORD_REF(CSGBD_ADDR)
60
 
61
/*
62
 * Chip Select Registers
63
 */
64
#define CSA_ADDR        0xfffff110
65
#define CSB_ADDR        0xfffff112
66
#define CSC_ADDR        0xfffff114
67
#define CSD_ADDR        0xfffff116
68
 
69
#define CSA             WORD_REF(CSA_ADDR)
70
#define CSB             WORD_REF(CSB_ADDR)
71
#define CSC             WORD_REF(CSC_ADDR)
72
#define CSD             WORD_REF(CSD_ADDR)
73
 
74
#define CSA_EN          0x0001          /* Chip-Select Enable */
75
#define CSA_SIZ_MASK    0x000e          /* Chip-Select Size */
76
#define CSA_SIZ_SHIFT   1
77
#define CSA_WS_MASK     0x0070          /* Wait State */
78
#define CSA_WS_SHIFT    4
79
#define CSA_BSW         0x0080          /* Data Bus Width */
80
#define CSA_FLASH       0x0100          /* FLASH Memory Support */
81
#define CSA_RO          0x8000          /* Read-Only */
82
 
83
#define CSB_EN          0x0001          /* Chip-Select Enable */
84
#define CSB_SIZ_MASK    0x000e          /* Chip-Select Size */
85
#define CSB_SIZ_SHIFT   1
86
#define CSB_WS_MASK     0x0070          /* Wait State */
87
#define CSB_WS_SHIFT    4
88
#define CSB_BSW         0x0080          /* Data Bus Width */
89
#define CSB_FLASH       0x0100          /* FLASH Memory Support */
90
#define CSB_UPSIZ_MASK  0x1800          /* Unprotected memory block size */
91
#define CSB_UPSIZ_SHIFT 11
92
#define CSB_ROP         0x2000          /* Readonly if protected */
93
#define CSB_SOP         0x4000          /* Supervisor only if protected */
94
#define CSB_RO          0x8000          /* Read-Only */
95
 
96
#define CSC_EN          0x0001          /* Chip-Select Enable */
97
#define CSC_SIZ_MASK    0x000e          /* Chip-Select Size */
98
#define CSC_SIZ_SHIFT   1
99
#define CSC_WS_MASK     0x0070          /* Wait State */
100
#define CSC_WS_SHIFT    4
101
#define CSC_BSW         0x0080          /* Data Bus Width */
102
#define CSC_FLASH       0x0100          /* FLASH Memory Support */
103
#define CSC_UPSIZ_MASK  0x1800          /* Unprotected memory block size */
104
#define CSC_UPSIZ_SHIFT 11
105
#define CSC_ROP         0x2000          /* Readonly if protected */
106
#define CSC_SOP         0x4000          /* Supervisor only if protected */
107
#define CSC_RO          0x8000          /* Read-Only */
108
 
109
#define CSD_EN          0x0001          /* Chip-Select Enable */
110
#define CSD_SIZ_MASK    0x000e          /* Chip-Select Size */
111
#define CSD_SIZ_SHIFT   1
112
#define CSD_WS_MASK     0x0070          /* Wait State */
113
#define CSD_WS_SHIFT    4
114
#define CSD_BSW         0x0080          /* Data Bus Width */
115
#define CSD_FLASH       0x0100          /* FLASH Memory Support */
116
#define CSD_DRAM        0x0200          /* Dram Selection */
117
#define CSD_COMB        0x0400          /* Combining */
118
#define CSD_UPSIZ_MASK  0x1800          /* Unprotected memory block size */
119
#define CSD_UPSIZ_SHIFT 11
120
#define CSD_ROP         0x2000          /* Readonly if protected */
121
#define CSD_SOP         0x4000          /* Supervisor only if protected */
122
#define CSD_RO          0x8000          /* Read-Only */
123
 
124
/*
125
 * Emulation Chip-Select Register
126
 */
127
#define EMUCS_ADDR      0xfffff118
128
#define EMUCS           WORD_REF(EMUCS_ADDR)
129
 
130
#define EMUCS_WS_MASK   0x0070
131
#define EMUCS_WS_SHIFT  4
132
 
133
/**********
134
 *
135
 * 0xFFFFF2xx -- Phase Locked Loop (PLL) & Power Control
136
 *
137
 **********/
138
 
139
/*
140
 * PLL Control Register
141
 */
142
#define PLLCR_ADDR      0xfffff200
143
#define PLLCR           WORD_REF(PLLCR_ADDR)
144
 
145
#define PLLCR_DISPLL           0x0008   /* Disable PLL */
146
#define PLLCR_CLKEN            0x0010   /* Clock (CLKO pin) enable */
147
#define PLLCR_PRESC            0x0020   /* VCO prescaler */
148
#define PLLCR_SYSCLK_SEL_MASK  0x0700   /* System Clock Selection */
149
#define PLLCR_SYSCLK_SEL_SHIFT 8
150
#define PLLCR_LCDCLK_SEL_MASK  0x3800   /* LCD Clock Selection */
151
#define PLLCR_LCDCLK_SEL_SHIFT 11
152
 
153
/* '328-compatible definitions */
154
#define PLLCR_PIXCLK_SEL_MASK   PLLCR_LCDCLK_SEL_MASK
155
#define PLLCR_PIXCLK_SEL_SHIFT  PLLCR_LCDCLK_SEL_SHIFT
156
 
157
/*
158
 * PLL Frequency Select Register
159
 */
160
#define PLLFSR_ADDR     0xfffff202
161
#define PLLFSR          WORD_REF(PLLFSR_ADDR)
162
 
163
#define PLLFSR_PC_MASK  0x00ff          /* P Count */
164
#define PLLFSR_PC_SHIFT 0
165
#define PLLFSR_QC_MASK  0x0f00          /* Q Count */
166
#define PLLFSR_QC_SHIFT 8
167
#define PLLFSR_PROT     0x4000          /* Protect P & Q */
168
#define PLLFSR_CLK32    0x8000          /* Clock 32 (kHz) */
169
 
170
/*
171
 * Power Control Register
172
 */
173
#define PCTRL_ADDR      0xfffff207
174
#define PCTRL           BYTE_REF(PCTRL_ADDR)
175
 
176
#define PCTRL_WIDTH_MASK        0x1f    /* CPU Clock bursts width */
177
#define PCTRL_WIDTH_SHIFT       0
178
#define PCTRL_PCEN              0x80    /* Power Control Enable */
179
 
180
/**********
181
 *
182
 * 0xFFFFF3xx -- Interrupt Controller
183
 *
184
 **********/
185
 
186
/*
187
 * Interrupt Vector Register
188
 */
189
#define IVR_ADDR        0xfffff300
190
#define IVR             BYTE_REF(IVR_ADDR)
191
 
192
#define IVR_VECTOR_MASK 0xF8
193
 
194
/*
195
 * Interrupt control Register
196
 */
197
#define ICR_ADDR        0xffff302
198
#define ICR             WORD_REF(ICR_ADDR)
199
 
200
#define ICR_POL5        0x0080  /* Polarity Control for IRQ5 */
201
#define ICR_ET6         0x0100  /* Edge Trigger Select for IRQ6 */
202
#define ICR_ET3         0x0200  /* Edge Trigger Select for IRQ3 */
203
#define ICR_ET2         0x0400  /* Edge Trigger Select for IRQ2 */
204
#define ICR_ET1         0x0800  /* Edge Trigger Select for IRQ1 */
205
#define ICR_POL6        0x1000  /* Polarity Control for IRQ6 */
206
#define ICR_POL3        0x2000  /* Polarity Control for IRQ3 */
207
#define ICR_POL2        0x4000  /* Polarity Control for IRQ2 */
208
#define ICR_POL1        0x8000  /* Polarity Control for IRQ1 */
209
 
210
/*
211
 * Interrupt Mask Register
212
 */
213
#define IMR_ADDR        0xfffff304
214
#define IMR             LONG_REF(IMR_ADDR)
215
 
216
/*
217
 * Define the names for bit positions first. This is useful for
218
 * request_irq
219
 */
220
#define SPI_IRQ_NUM     0        /* SPI interrupt */
221
#define TMR_IRQ_NUM     1       /* Timer interrupt */
222
#define UART_IRQ_NUM    2       /* UART interrupt */    
223
#define WDT_IRQ_NUM     3       /* Watchdog Timer interrupt */
224
#define RTC_IRQ_NUM     4       /* RTC interrupt */
225
#define KB_IRQ_NUM      6       /* Keyboard Interrupt */
226
#define PWM_IRQ_NUM     7       /* Pulse-Width Modulator int. */
227
#define INT0_IRQ_NUM    8       /* External INT0 */
228
#define INT1_IRQ_NUM    9       /* External INT1 */
229
#define INT2_IRQ_NUM    10      /* External INT2 */
230
#define INT3_IRQ_NUM    11      /* External INT3 */
231
#define IRQ1_IRQ_NUM    16      /* IRQ1 */
232
#define IRQ2_IRQ_NUM    17      /* IRQ2 */
233
#define IRQ3_IRQ_NUM    18      /* IRQ3 */
234
#define IRQ6_IRQ_NUM    19      /* IRQ6 */
235
#define IRQ5_IRQ_NUM    20      /* IRQ5 */
236
#define SAM_IRQ_NUM     22      /* Sampling Timer for RTC */
237
#define EMIQ_IRQ_NUM    23      /* Emulator Interrupt */
238
 
239
/* '328-compatible definitions */
240
#define SPIM_IRQ_NUM    SPI_IRQ_NUM
241
#define TMR1_IRQ_NUM    TMR_IRQ_NUM
242
 
243
/*
244
 * Here go the bitmasks themselves
245
 */
246
#define IMR_MSPI        (1 << SPI _IRQ_NUM)     /* Mask SPI interrupt */
247
#define IMR_MTMR        (1 << TMR_IRQ_NUM)      /* Mask Timer interrupt */
248
#define IMR_MUART       (1 << UART_IRQ_NUM)     /* Mask UART interrupt */       
249
#define IMR_MWDT        (1 << WDT_IRQ_NUM)      /* Mask Watchdog Timer interrupt */
250
#define IMR_MRTC        (1 << RTC_IRQ_NUM)      /* Mask RTC interrupt */
251
#define IMR_MKB         (1 << KB_IRQ_NUM)       /* Mask Keyboard Interrupt */
252
#define IMR_MPWM        (1 << PWM_IRQ_NUM)      /* Mask Pulse-Width Modulator int. */
253
#define IMR_MINT0       (1 << INT0_IRQ_NUM)     /* Mask External INT0 */
254
#define IMR_MINT1       (1 << INT1_IRQ_NUM)     /* Mask External INT1 */
255
#define IMR_MINT2       (1 << INT2_IRQ_NUM)     /* Mask External INT2 */
256
#define IMR_MINT3       (1 << INT3_IRQ_NUM)     /* Mask External INT3 */
257
#define IMR_MIRQ1       (1 << IRQ1_IRQ_NUM)     /* Mask IRQ1 */
258
#define IMR_MIRQ2       (1 << IRQ2_IRQ_NUM)     /* Mask IRQ2 */
259
#define IMR_MIRQ3       (1 << IRQ3_IRQ_NUM)     /* Mask IRQ3 */
260
#define IMR_MIRQ6       (1 << IRQ6_IRQ_NUM)     /* Mask IRQ6 */
261
#define IMR_MIRQ5       (1 << IRQ5_IRQ_NUM)     /* Mask IRQ5 */
262
#define IMR_MSAM        (1 << SAM_IRQ_NUM)      /* Mask Sampling Timer for RTC */
263
#define IMR_MEMIQ       (1 << EMIQ_IRQ_NUM)     /* Mask Emulator Interrupt */
264
 
265
/* '328-compatible definitions */
266
#define IMR_MSPIM       IMR_MSPI
267
#define IMR_MTMR1       IMR_MTMR
268
 
269
/*
270
 * Interrupt Status Register
271
 */
272
#define ISR_ADDR        0xfffff30c
273
#define ISR             LONG_REF(ISR_ADDR)
274
 
275
#define ISR_SPI         (1 << SPI _IRQ_NUM)     /* SPI interrupt */
276
#define ISR_TMR         (1 << TMR_IRQ_NUM)      /* Timer interrupt */
277
#define ISR_UART        (1 << UART_IRQ_NUM)     /* UART interrupt */    
278
#define ISR_WDT         (1 << WDT_IRQ_NUM)      /* Watchdog Timer interrupt */
279
#define ISR_RTC         (1 << RTC_IRQ_NUM)      /* RTC interrupt */
280
#define ISR_KB          (1 << KB_IRQ_NUM)       /* Keyboard Interrupt */
281
#define ISR_PWM         (1 << PWM_IRQ_NUM)      /* Pulse-Width Modulator interrupt */
282
#define ISR_INT0        (1 << INT0_IRQ_NUM)     /* External INT0 */
283
#define ISR_INT1        (1 << INT1_IRQ_NUM)     /* External INT1 */
284
#define ISR_INT2        (1 << INT2_IRQ_NUM)     /* External INT2 */
285
#define ISR_INT3        (1 << INT3_IRQ_NUM)     /* External INT3 */
286
#define ISR_IRQ1        (1 << IRQ1_IRQ_NUM)     /* IRQ1 */
287
#define ISR_IRQ2        (1 << IRQ2_IRQ_NUM)     /* IRQ2 */
288
#define ISR_IRQ3        (1 << IRQ3_IRQ_NUM)     /* IRQ3 */
289
#define ISR_IRQ6        (1 << IRQ6_IRQ_NUM)     /* IRQ6 */
290
#define ISR_IRQ5        (1 << IRQ5_IRQ_NUM)     /* IRQ5 */
291
#define ISR_SAM         (1 << SAM_IRQ_NUM)      /* Sampling Timer for RTC */
292
#define ISR_EMIQ        (1 << EMIQ_IRQ_NUM)     /* Emulator Interrupt */
293
 
294
/* '328-compatible definitions */
295
#define ISR_SPIM        ISR_SPI
296
#define ISR_TMR1        ISR_TMR
297
 
298
/*
299
 * Interrupt Pending Register
300
 */
301
#define IPR_ADDR        0xfffff30c
302
#define IPR             LONG_REF(IPR_ADDR)
303
 
304
#define IPR_SPI         (1 << SPI _IRQ_NUM)     /* SPI interrupt */
305
#define IPR_TMR         (1 << TMR_IRQ_NUM)      /* Timer interrupt */
306
#define IPR_UART        (1 << UART_IRQ_NUM)     /* UART interrupt */    
307
#define IPR_WDT         (1 << WDT_IRQ_NUM)      /* Watchdog Timer interrupt */
308
#define IPR_RTC         (1 << RTC_IRQ_NUM)      /* RTC interrupt */
309
#define IPR_KB          (1 << KB_IRQ_NUM)       /* Keyboard Interrupt */
310
#define IPR_PWM         (1 << PWM_IRQ_NUM)      /* Pulse-Width Modulator interrupt */
311
#define IPR_INT0        (1 << INT0_IRQ_NUM)     /* External INT0 */
312
#define IPR_INT1        (1 << INT1_IRQ_NUM)     /* External INT1 */
313
#define IPR_INT2        (1 << INT2_IRQ_NUM)     /* External INT2 */
314
#define IPR_INT3        (1 << INT3_IRQ_NUM)     /* External INT3 */
315
#define IPR_IRQ1        (1 << IRQ1_IRQ_NUM)     /* IRQ1 */
316
#define IPR_IRQ2        (1 << IRQ2_IRQ_NUM)     /* IRQ2 */
317
#define IPR_IRQ3        (1 << IRQ3_IRQ_NUM)     /* IRQ3 */
318
#define IPR_IRQ6        (1 << IRQ6_IRQ_NUM)     /* IRQ6 */
319
#define IPR_IRQ5        (1 << IRQ5_IRQ_NUM)     /* IRQ5 */
320
#define IPR_SAM         (1 << SAM_IRQ_NUM)      /* Sampling Timer for RTC */
321
#define IPR_EMIQ        (1 << EMIQ_IRQ_NUM)     /* Emulator Interrupt */
322
 
323
/* '328-compatible definitions */
324
#define IPR_SPIM        IPR_SPI
325
#define IPR_TMR1        IPR_TMR
326
 
327
/**********
328
 *
329
 * 0xFFFFF4xx -- Parallel Ports
330
 *
331
 **********/
332
 
333
/*
334
 * Port A
335
 */
336
#define PADIR_ADDR      0xfffff400              /* Port A direction reg */
337
#define PADATA_ADDR     0xfffff401              /* Port A data register */
338
#define PAPUEN_ADDR     0xfffff402              /* Port A Pull-Up enable reg */
339
 
340
#define PADIR           BYTE_REF(PADIR_ADDR)
341
#define PADATA          BYTE_REF(PADATA_ADDR)
342
#define PAPUEN          BYTE_REF(PAPUEN_ADDR)
343
 
344
#define PA(x)           (1 << (x))
345
 
346
/*
347
 * Port B
348
 */
349
#define PBDIR_ADDR      0xfffff408              /* Port B direction reg */
350
#define PBDATA_ADDR     0xfffff409              /* Port B data register */
351
#define PBPUEN_ADDR     0xfffff40a              /* Port B Pull-Up enable reg */
352
#define PBSEL_ADDR      0xfffff40b              /* Port B Select Register */
353
 
354
#define PBDIR           BYTE_REF(PBDIR_ADDR)
355
#define PBDATA          BYTE_REF(PBDATA_ADDR)
356
#define PBPUEN          BYTE_REF(PBPUEN_ADDR)
357
#define PBSEL           BYTE_REF(PBSEL_ADDR)
358
 
359
#define PB(x)           (1 << (x))
360
 
361
#define PB_CSB0         0x01    /* Use CSB0      as PB[0] */
362
#define PB_CSB1         0x02    /* Use CSB1      as PB[1] */
363
#define PB_CSC0_RAS0    0x04    /* Use CSC0/RAS0 as PB[2] */    
364
#define PB_CSC1_RAS1    0x08    /* Use CSC1/RAS1 as PB[3] */    
365
#define PB_CSD0_CAS0    0x10    /* Use CSD0/CAS0 as PB[4] */    
366
#define PB_CSD1_CAS1    0x20    /* Use CSD1/CAS1 as PB[5] */
367
#define PB_TIN_TOUT     0x40    /* Use TIN/TOUT  as PB[6] */
368
#define PB_PWMO         0x80    /* Use PWMO      as PB[7] */
369
 
370
/*
371
 * Port C
372
 */
373
#define PCDIR_ADDR      0xfffff410              /* Port C direction reg */
374
#define PCDATA_ADDR     0xfffff411              /* Port C data register */
375
#define PCPDEN_ADDR     0xfffff412              /* Port C Pull-Down enb. reg */
376
#define PCSEL_ADDR      0xfffff413              /* Port C Select Register */
377
 
378
#define PCDIR           BYTE_REF(PCDIR_ADDR)
379
#define PCDATA          BYTE_REF(PCDATA_ADDR)
380
#define PCPDEN          BYTE_REF(PCPDEN_ADDR)
381
#define PCSEL           BYTE_REF(PCSEL_ADDR)
382
 
383
#define PC(x)           (1 << (x))
384
 
385
#define PC_LD0          0x01    /* Use LD0  as PC[0] */
386
#define PC_LD1          0x02    /* Use LD1  as PC[1] */
387
#define PC_LD2          0x04    /* Use LD2  as PC[2] */
388
#define PC_LD3          0x08    /* Use LD3  as PC[3] */
389
#define PC_LFLM         0x10    /* Use LFLM as PC[4] */
390
#define PC_LLP          0x20    /* Use LLP  as PC[5] */
391
#define PC_LCLK         0x40    /* Use LCLK as PC[6] */
392
#define PC_LACD         0x80    /* Use LACD as PC[7] */
393
 
394
/*
395
 * Port D
396
 */
397
#define PDDIR_ADDR      0xfffff418              /* Port D direction reg */
398
#define PDDATA_ADDR     0xfffff419              /* Port D data register */
399
#define PDPUEN_ADDR     0xfffff41a              /* Port D Pull-Up enable reg */
400
#define PDSEL_ADDR      0xfffff41b              /* Port D Select Register */
401
#define PDPOL_ADDR      0xfffff41c              /* Port D Polarity Register */
402
#define PDIRQEN_ADDR    0xfffff41d              /* Port D IRQ enable register */
403
#define PDKBEN_ADDR     0xfffff41e              /* Port D Keyboard Enable reg */
404
#define PDIQEG_ADDR     0xfffff41f              /* Port D IRQ Edge Register */
405
 
406
#define PDDIR           BYTE_REF(PDDIR_ADDR)
407
#define PDDATA          BYTE_REF(PDDATA_ADDR)
408
#define PDPUEN          BYTE_REF(PDPUEN_ADDR)
409
#define PDSEL           BYTE_REF(PDSEL_ADDR)
410
#define PDPOL           BYTE_REF(PDPOL_ADDR)
411
#define PDIRQEN         BYTE_REF(PDIRQEN_ADDR)
412
#define PDKBEN          BYTE_REF(PDKBEN_ADDR)
413
#define PDIQEG          BYTE_REF(PDIQEG_ADDR)
414
 
415
#define PD(x)           (1 << (x))
416
 
417
#define PD_INT0         0x01    /* Use INT0 as PD[0] */
418
#define PD_INT1         0x02    /* Use INT1 as PD[1] */
419
#define PD_INT2         0x04    /* Use INT2 as PD[2] */
420
#define PD_INT3         0x08    /* Use INT3 as PD[3] */
421
#define PD_IRQ1         0x10    /* Use IRQ1 as PD[4] */
422
#define PD_IRQ2         0x20    /* Use IRQ2 as PD[5] */
423
#define PD_IRQ3         0x40    /* Use IRQ3 as PD[6] */
424
#define PD_IRQ6         0x80    /* Use IRQ6 as PD[7] */
425
 
426
/*
427
 * Port E
428
 */
429
#define PEDIR_ADDR      0xfffff420              /* Port E direction reg */
430
#define PEDATA_ADDR     0xfffff421              /* Port E data register */
431
#define PEPUEN_ADDR     0xfffff422              /* Port E Pull-Up enable reg */
432
#define PESEL_ADDR      0xfffff423              /* Port E Select Register */
433
 
434
#define PEDIR           BYTE_REF(PEDIR_ADDR)
435
#define PEDATA          BYTE_REF(PEDATA_ADDR)
436
#define PEPUEN          BYTE_REF(PEPUEN_ADDR)
437
#define PESEL           BYTE_REF(PESEL_ADDR)
438
 
439
#define PE(x)           (1 << (x))
440
 
441
#define PE_SPMTXD       0x01    /* Use SPMTXD as PE[0] */
442
#define PE_SPMRXD       0x02    /* Use SPMRXD as PE[1] */
443
#define PE_SPMCLK       0x04    /* Use SPMCLK as PE[2] */
444
#define PE_DWE          0x08    /* Use DWE    as PE[3] */
445
#define PE_RXD          0x10    /* Use RXD    as PE[4] */
446
#define PE_TXD          0x20    /* Use TXD    as PE[5] */
447
#define PE_RTS          0x40    /* Use RTS    as PE[6] */
448
#define PE_CTS          0x80    /* Use CTS    as PE[7] */
449
 
450
/*
451
 * Port F
452
 */
453
#define PFDIR_ADDR      0xfffff428              /* Port F direction reg */
454
#define PFDATA_ADDR     0xfffff429              /* Port F data register */
455
#define PFPUEN_ADDR     0xfffff42a              /* Port F Pull-Up enable reg */
456
#define PFSEL_ADDR      0xfffff42b              /* Port F Select Register */
457
 
458
#define PFDIR           BYTE_REF(PFDIR_ADDR)
459
#define PFDATA          BYTE_REF(PFDATA_ADDR)
460
#define PFPUEN          BYTE_REF(PFPUEN_ADDR)
461
#define PFSEL           BYTE_REF(PFSEL_ADDR)
462
 
463
#define PF(x)           (1 << (x))
464
 
465
#define PF_LCONTRAST    0x01    /* Use LCONTRAST as PF[0] */
466
#define PF_IRQ5         0x02    /* Use IRQ5      as PF[1] */
467
#define PF_CLKO         0x04    /* Use CLKO      as PF[2] */
468
#define PF_A20          0x08    /* Use A20       as PF[3] */
469
#define PF_A21          0x10    /* Use A21       as PF[4] */
470
#define PF_A22          0x20    /* Use A22       as PF[5] */
471
#define PF_A23          0x40    /* Use A23       as PF[6] */
472
#define PF_CSA1         0x80    /* Use CSA1      as PF[7] */
473
 
474
/*
475
 * Port G
476
 */
477
#define PGDIR_ADDR      0xfffff430              /* Port G direction reg */
478
#define PGDATA_ADDR     0xfffff431              /* Port G data register */
479
#define PGPUEN_ADDR     0xfffff432              /* Port G Pull-Up enable reg */
480
#define PGSEL_ADDR      0xfffff433              /* Port G Select Register */
481
 
482
#define PGDIR           BYTE_REF(PGDIR_ADDR)
483
#define PGDATA          BYTE_REF(PGDATA_ADDR)
484
#define PGPUEN          BYTE_REF(PGPUEN_ADDR)
485
#define PGSEL           BYTE_REF(PGSEL_ADDR)
486
 
487
#define PG(x)           (1 << (x))
488
 
489
#define PG_BUSW_DTACK   0x01    /* Use BUSW/DTACK as PG[0] */
490
#define PG_A0           0x02    /* Use A0         as PG[1] */
491
#define PG_EMUIRQ       0x04    /* Use EMUIRQ     as PG[2] */
492
#define PG_HIZ_P_D      0x08    /* Use HIZ/P/D    as PG[3] */
493
#define PG_EMUCS        0x10    /* Use EMUCS      as PG[4] */
494
#define PG_EMUBRK       0x20    /* Use EMUBRK     as PG[5] */
495
 
496
/**********
497
 *
498
 * 0xFFFFF5xx -- Pulse-Width Modulator (PWM)
499
 *
500
 **********/
501
 
502
/*
503
 * PWM Control Register
504
 */
505
#define PWMC_ADDR       0xfffff500
506
#define PWMC            WORD_REF(PWMC_ADDR)
507
 
508
#define PWMC_CLKSEL_MASK        0x0003  /* Clock Selection */
509
#define PWMC_CLKSEL_SHIFT       0
510
#define PWMC_REPEAT_MASK        0x000c  /* Sample Repeats */
511
#define PWMC_REPEAT_SHIFT       2
512
#define PWMC_EN                 0x0010  /* Enable PWM */
513
#define PMNC_FIFOAV             0x0020  /* FIFO Available */
514
#define PWMC_IRQEN              0x0040  /* Interrupt Request Enable */
515
#define PWMC_IRQ                0x0080  /* Interrupt Request (FIFO empty) */
516
#define PWMC_PRESCALER_MASK     0x7f00  /* Incoming Clock prescaler */
517
#define PWMC_PRESCALER_SHIFT    8
518
#define PWMC_CLKSRC             0x8000  /* Clock Source Select */
519
 
520
/* '328-compatible definitions */
521
#define PWMC_PWMEN      PWMC_EN
522
 
523
/*
524
 * PWM Sample Register
525
 */
526
#define PWMS_ADDR       0xfffff502
527
#define PWMS            WORD_REF(PWMS_ADDR)
528
 
529
/*
530
 * PWM Period Register
531
 */
532
#define PWMP_ADDR       0xfffff504
533
#define PWMP            BYTE_REF(PWMP_ADDR)
534
 
535
/*
536
 * PWM Counter Register
537
 */
538
#define PWMCNT_ADDR     0xfffff505
539
#define PWMCNT          BYTE_REF(PWMCNT_ADDR)
540
 
541
/**********
542
 *
543
 * 0xFFFFF6xx -- General-Purpose Timer
544
 *
545
 **********/
546
 
547
/*
548
 * Timer Control register
549
 */
550
#define TCTL_ADDR       0xfffff600
551
#define TCTL            WORD_REF(TCTL_ADDR)
552
 
553
#define TCTL_TEN                0x0001  /* Timer Enable  */
554
#define TCTL_CLKSOURCE_MASK     0x000e  /* Clock Source: */
555
#define   TCTL_CLKSOURCE_STOP      0x0000       /* Stop count (disabled)    */
556
#define   TCTL_CLKSOURCE_SYSCLK    0x0002       /* SYSCLK to prescaler      */
557
#define   TCTL_CLKSOURCE_SYSCLK_16 0x0004       /* SYSCLK/16 to prescaler   */
558
#define   TCTL_CLKSOURCE_TIN       0x0006       /* TIN to prescaler         */
559
#define   TCTL_CLKSOURCE_32KHZ     0x0008       /* 32kHz clock to prescaler */
560
#define TCTL_IRQEN              0x0010  /* IRQ Enable    */
561
#define TCTL_OM                 0x0020  /* Output Mode   */
562
#define TCTL_CAP_MASK           0x00c0  /* Capture Edge: */
563
#define   TCTL_CAP_RE           0x0040          /* Capture on rizing edge   */
564
#define   TCTL_CAP_FE           0x0080          /* Capture on falling edge  */
565
#define TCTL_FRR                0x0010  /* Free-Run Mode */
566
 
567
/* '328-compatible definitions */
568
#define TCTL1_ADDR      TCTL_ADDR
569
#define TCTL1           TCTL
570
 
571
/*
572
 * Timer Prescaler Register
573
 */
574
#define TPRER_ADDR      0xfffff602
575
#define TPRER           WORD_REF(TPRER_ADDR)
576
 
577
/* '328-compatible definitions */
578
#define TPRER1_ADDR     TPRER_ADDR
579
#define TPRER1          TPRER
580
 
581
/*
582
 * Timer Compare Register
583
 */
584
#define TCMP_ADDR       0xfffff604
585
#define TCMP            WORD_REF(TCMP_ADDR)
586
 
587
/* '328-compatible definitions */
588
#define TCMP1_ADDR      TCMP_ADDR
589
#define TCMP1           TCMP
590
 
591
/*
592
 * Timer Capture register
593
 */
594
#define TCR_ADDR        0xfffff606
595
#define TCR             WORD_REF(TCR_ADDR)
596
 
597
/* '328-compatible definitions */
598
#define TCR1_ADDR       TCR_ADDR
599
#define TCR1            TCR
600
 
601
/*
602
 * Timer Counter Register
603
 */
604
#define TCN_ADDR        0xfffff608
605
#define TCN             WORD_REF(TCN_ADDR)
606
 
607
/* '328-compatible definitions */
608
#define TCN1_ADDR       TCN_ADDR
609
#define TCN1            TCN
610
 
611
/*
612
 * Timer Status Register
613
 */
614
#define TSTAT_ADDR      0xfffff60a
615
#define TSTAT           WORD_REF(TSTAT_ADDR)
616
 
617
#define TSTAT_COMP      0x0001          /* Compare Event occurred */
618
#define TSTAT_CAPT      0x0001          /* Capture Event occurred */
619
 
620
/* '328-compatible definitions */
621
#define TSTAT1_ADDR     TSTAT_ADDR
622
#define TSTAT1          TSTAT
623
 
624
/**********
625
 *
626
 * 0xFFFFF8xx -- Serial Periferial Interface Master (SPIM)
627
 *
628
 **********/
629
 
630
/*
631
 * SPIM Data Register
632
 */
633
#define SPIMDATA_ADDR   0xfffff800
634
#define SPIMDATA        WORD_REF(SPIMDATA_ADDR)
635
 
636
/*
637
 * SPIM Control/Status Register
638
 */
639
#define SPIMCONT_ADDR   0xfffff802
640
#define SPIMCONT        WORD_REF(SPIMCONT_ADDR)
641
 
642
#define SPIMCONT_BIT_COUNT_MASK  0x000f /* Transfer Length in Bytes */
643
#define SPIMCONT_BIT_COUNT_SHIFT 0
644
#define SPIMCONT_POL             0x0010 /* SPMCLK Signel Polarity */
645
#define SPIMCONT_PHA             0x0020 /* Clock/Data phase relationship */
646
#define SPIMCONT_IRQEN           0x0040 /* IRQ Enable */
647
#define SPIMCONT_IRQ             0x0080 /* Interrupt Request */
648
#define SPIMCONT_XCH             0x0100 /* Exchange */
649
#define SPIMCONT_ENABLE          0x0200 /* Enable SPIM */
650
#define SPIMCONT_DATA_RATE_MASK  0xe000 /* SPIM Data Rate */
651
#define SPIMCONT_DATA_RATE_SHIFT 13
652
 
653
/* '328-compatible definitions */
654
#define SPIMCONT_SPIMIRQ        SPIMCONT_IRQ
655
#define SPIMCONT_SPIMEN         SPIMCONT_ENABLE
656
 
657
/**********
658
 *
659
 * 0xFFFFF9xx -- UART
660
 *
661
 **********/
662
 
663
/*
664
 * UART Status/Control Register
665
 */
666
#define USTCNT_ADDR     0xfffff900
667
#define USTCNT          WORD_REF(USTCNT_ADDR)
668
 
669
#define USTCNT_TXAE     0x0001  /* Transmitter Available Interrupt Enable */
670
#define USTCNT_TXHE     0x0002  /* Transmitter Half Empty Enable */
671
#define USTCNT_TXEE     0x0004  /* Transmitter Empty Interrupt Enable */
672
#define USTCNT_RXRE     0x0008  /* Receiver Ready Interrupt Enable */
673
#define USTCNT_RXHE     0x0010  /* Receiver Half-Full Interrupt Enable */
674
#define USTCNT_RXFE     0x0020  /* Receiver Full Interrupt Enable */
675
#define USTCNT_CTSD     0x0040  /* CTS Delta Interrupt Enable */
676
#define USTCNT_ODEN     0x0080  /* Old Data Interrupt Enable */
677
#define USTCNT_8_7      0x0100  /* Eight or seven-bit transmission */
678
#define USTCNT_STOP     0x0200  /* Stop bit transmission */
679
#define USTCNT_ODD      0x0400  /* Odd Parity */
680
#define USTCNT_PEN      0x0800  /* Parity Enable */
681
#define USTCNT_CLKM     0x1000  /* Clock Mode Select */
682
#define USTCNT_TXEN     0x2000  /* Transmitter Enable */
683
#define USTCNT_RXEN     0x4000  /* Receiver Enable */
684
#define USTCNT_UEN      0x8000  /* UART Enable */
685
 
686
/* '328-compatible definitions */
687
#define USTCNT_TXAVAILEN        USTCNT_TXAE
688
#define USTCNT_TXHALFEN         USTCNT_TXHE
689
#define USTCNT_TXEMPTYEN        USTCNT_TXEE
690
#define USTCNT_RXREADYEN        USTCNT_RXRE
691
#define USTCNT_RXHALFEN         USTCNT_RXHE
692
#define USTCNT_RXFULLEN         USTCNT_RXFE
693
#define USTCNT_CTSDELTAEN       USTCNT_CTSD
694
#define USTCNT_ODD_EVEN         USTCNT_ODD
695
#define USTCNT_PARITYEN         USTCNT_PEN
696
#define USTCNT_CLKMODE          USTCNT_CLKM
697
#define USTCNT_UARTEN           USTCNT_UEN
698
 
699
/*
700
 * UART Baud Control Register
701
 */
702
#define UBAUD_ADDR      0xfffff902
703
#define UBAUD           WORD_REF(UBAUD_ADDR)
704
 
705
#define UBAUD_PRESCALER_MASK    0x003f  /* Actual divisor is 65 - PRESCALER */
706
#define UBAUD_PRESCALER_SHIFT   0
707
#define UBAUD_DIVIDE_MASK       0x0700  /* Baud Rate freq. divizor */
708
#define UBAUD_DIVIDE_SHIFT      8
709
#define UBAUD_BAUD_SRC          0x0800  /* Baud Rate Source */
710
#define UBAUD_UCLKDIR           0x2000  /* UCLK Direction */
711
 
712
/*
713
 * UART Receiver Register
714
 */
715
#define URX_ADDR        0xfffff904
716
#define URX             WORD_REF(URX_ADDR)
717
 
718
#define URX_RXDATA_ADDR 0xfffff905
719
#define URX_RXDATA      BYTE_REF(URX_RXDATA_ADDR)
720
 
721
#define URX_RXDATA_MASK  0x00ff /* Received data */
722
#define URX_RXDATA_SHIFT 0
723
#define URX_PARITY_ERROR 0x0100 /* Parity Error */
724
#define URX_BREAK        0x0200 /* Break Detected */
725
#define URX_FRAME_ERROR  0x0400 /* Framing Error */
726
#define URX_OVRUN        0x0800 /* Serial Overrun */
727
#define URX_OLD_DATA     0x1000 /* Old data in FIFO */
728
#define URX_DATA_READY   0x2000 /* Data Ready (FIFO not empty) */
729
#define URX_FIFO_HALF    0x4000 /* FIFO is Half-Full */
730
#define URX_FIFO_FULL    0x8000 /* FIFO is Full */
731
 
732
/*
733
 * UART Transmitter Register
734
 */
735
#define UTX_ADDR        0xfffff906
736
#define UTX             WORD_REF(UTX_ADDR)
737
 
738
#define UTX_TXDATA_ADDR 0xfffff907
739
#define UTX_TXDATA      BYTE_REF(UTX_TXDATA_ADDR)
740
 
741
#define UTX_TXDATA_MASK  0x00ff /* Data to be transmitted */
742
#define UTX_TXDATA_SHIFT 0
743
#define UTX_CTS_DELTA    0x0100 /* CTS changed */
744
#define UTX_CTS_STAT     0x0200 /* CTS State */
745
#define UTX_BUSY         0x0400 /* FIFO is busy, sending a character */
746
#define UTX_NOCTS        0x0800 /* Ignore CTS */
747
#define UTX_SEND_BREAK   0x1000 /* Send a BREAK */
748
#define UTX_TX_AVAIL     0x2000 /* Transmit FIFO has a slot available */
749
#define UTX_FIFO_HALF    0x4000 /* Transmit FIFO is half empty */
750
#define UTX_FIFO_EMPTY   0x8000 /* Transmit FIFO is empty */
751
 
752
/* '328-compatible definitions */
753
#define UTX_CTS_STATUS  UTX_CTS_STAT
754
#define UTX_IGNORE_CTS  UTX_NOCTS
755
 
756
/*
757
 * UART Miscellaneous Register
758
 */
759
#define UMISC_ADDR      0xfffff908
760
#define UMISC           WORD_REF(UMISC_ADDR)
761
 
762
#define UMISC_TX_POL     0x0004 /* Transmit Polarity */
763
#define UMISC_RX_POL     0x0008 /* Receive Polarity */
764
#define UMISC_IRDA_LOOP  0x0010 /* IrDA Loopback Enable */
765
#define UMISC_IRDA_EN    0x0020 /* Infra-Red Enable */
766
#define UMISC_RTS        0x0040 /* Set RTS status */
767
#define UMISC_RTSCONT    0x0080 /* Choose RTS control */
768
#define UMISC_IR_TEST    0x0400 /* IRDA Test Enable */
769
#define UMISC_BAUD_RESET 0x0800 /* Reset Baud Rate Generation Counters */
770
#define UMISC_LOOP       0x1000 /* Serial Loopback Enable */
771
#define UMISC_FORCE_PERR 0x2000 /* Force Parity Error */
772
#define UMISC_CLKSRC     0x4000 /* Clock Source */
773
#define UMISC_BAUD_TEST  0x8000 /* Enable Baud Test Mode */
774
 
775
/*
776
 * UART Non-integer Prescaler Register
777
 */
778
#define NIPR_ADDR       0xfffff90a
779
#define NIPR            WORD_REF(NIPR_ADDR)
780
 
781
#define NIPR_STEP_VALUE_MASK    0x00ff  /* NI prescaler step value */
782
#define NIPR_STEP_VALUE_SHIFT   0
783
#define NIPR_SELECT_MASK        0x0700  /* Tap Selection */
784
#define NIPR_SELECT_SHIFT       8
785
#define NIPR_PRE_SEL            0x8000  /* Non-integer prescaler select */
786
 
787
/**********
788
 *
789
 * 0xFFFFFAxx -- LCD Controller
790
 *
791
 **********/
792
 
793
/*
794
 * LCD Screen Starting Address Register
795
 */
796
#define LSSA_ADDR       0xfffffa00
797
#define LSSA            LONG_REF(LSSA_ADDR)
798
 
799
#define LSSA_SSA_MASK   0x1ffffffe      /* Bits 0 and 29-31 are reserved */
800
 
801
/*
802
 * LCD Virtual Page Width Register
803
 */
804
#define LVPW_ADDR       0xfffffa05
805
#define LVPW            BYTE_REF(LVPW_ADDR)
806
 
807
/*
808
 * LCD Screen Width Register (not compatible with '328 !!!)
809
 */
810
#define LXMAX_ADDR      0xfffffa08
811
#define LXMAX           WORD_REF(LXMAX_ADDR)
812
 
813
#define LXMAX_XM_MASK   0x02f0          /* Bits 0-3 and 10-15 are reserved */
814
 
815
/*
816
 * LCD Screen Height Register
817
 */
818
#define LYMAX_ADDR      0xfffffa0a
819
#define LYMAX           WORD_REF(LYMAX_ADDR)
820
 
821
#define LYMAX_YM_MASK   0x01ff          /* Bits 9-15 are reserved */
822
 
823
/*
824
 * LCD Cursor X Position Register
825
 */
826
#define LCXP_ADDR       0xfffffa18
827
#define LCXP            WORD_REF(LCXP_ADDR)
828
 
829
#define LCXP_CC_MASK    0xc000          /* Cursor Control */
830
#define   LCXP_CC_TRAMSPARENT   0x0000
831
#define   LCXP_CC_BLACK         0x4000
832
#define   LCXP_CC_REVERSED      0x8000
833
#define   LCXP_CC_WHITE         0xc000
834
#define LCXP_CXP_MASK   0x02ff          /* Cursor X position */
835
 
836
/*
837
 * LCD Cursor Y Position Register
838
 */
839
#define LCYP_ADDR       0xfffffa1a
840
#define LCYP            WORD_REF(LCYP_ADDR)
841
 
842
#define LCYP_CYP_MASK   0x01ff          /* Cursor Y Position */
843
 
844
/*
845
 * LCD Cursor Width and Heigth Register
846
 */
847
#define LCWCH_ADDR      0xfffffa1c
848
#define LCWCH           WORD_REF(LCWCH_ADDR)
849
 
850
#define LCWCH_CH_MASK   0x001f          /* Cursor Height */
851
#define LCWCH_CH_SHIFT  0
852
#define LCWCH_CW_MASK   0x1f00          /* Cursor Width */
853
#define LCWCH_CW_SHIFT  8
854
 
855
/*
856
 * LCD Blink Control Register
857
 */
858
#define LBLKC_ADDR      0xfffffa1f
859
#define LBLKC           BYTE_REF(LBLKC_ADDR)
860
 
861
#define LBLKC_BD_MASK   0x7f    /* Blink Divisor */
862
#define LBLKC_BD_SHIFT  0
863
#define LBLKC_BKEN      0x80    /* Blink Enabled */
864
 
865
/*
866
 * LCD Panel Interface Configuration Register
867
 */
868
#define LPICF_ADDR      0xfffffa20
869
#define LPICF           BYTE_REF(LPICF_ADDR)
870
 
871
#define LPICF_GS_MASK    0x03    /* Gray-Scale Mode */
872
#define   LPICF_GS_BW      0x00
873
#define   LPICF_GS_GRAY_4  0x01
874
#define   LPICF_GS_GRAY_16 0x02
875
#define LPICF_PBSIZ_MASK 0x0c   /* Panel Bus Width */
876
#define   LPICF_PBSIZ_1    0x00
877
#define   LPICF_PBSIZ_2    0x04
878
#define   LPICF_PBSIZ_4    0x08
879
 
880
/*
881
 * LCD Polarity Configuration Register
882
 */
883
#define LPOLCF_ADDR     0xfffffa21
884
#define LPOLCF          BYTE_REF(LPOLCF_ADDR)
885
 
886
#define LPOLCF_PIXPOL   0x01    /* Pixel Polarity */
887
#define LPOLCF_LPPOL    0x02    /* Line Pulse Polarity */
888
#define LPOLCF_FLMPOL   0x04    /* Frame Marker Polarity */
889
#define LPOLCF_LCKPOL   0x08    /* LCD Shift Lock Polarity */
890
 
891
/*
892
 * LACD (LCD Alternate Crystal Direction) Rate Control Register
893
 */
894
#define LACDRC_ADDR     0xfffffa23
895
#define LACDRC          BYTE_REF(LACDRC_ADDR)
896
 
897
#define LACDRC_ACDSLT    0x80   /* Signal Source Select */
898
#define LACDRC_ACD_MASK  0x0f   /* Alternate Crystal Direction Control */
899
#define LACDRC_ACD_SHIFT 0
900
 
901
/*
902
 * LCD Pixel Clock Divider Register
903
 */
904
#define LPXCD_ADDR      0xfffffa25
905
#define LPXCD           BYTE_REF(LPXCD_ADDR)
906
 
907
#define LPXCD_PCD_MASK  0x3f    /* Pixel Clock Divider */
908
#define LPXCD_PCD_SHIFT 0
909
 
910
/*
911
 * LCD Clocking Control Register
912
 */
913
#define LCKCON_ADDR     0xfffffa27
914
#define LCKCON          BYTE_REF(LCKCON_ADDR)
915
 
916
#define LCKCON_DWS_MASK  0x0f   /* Display Wait-State */
917
#define LCKCON_DWS_SHIFT 0
918
#define LCKCON_DWIDTH    0x40   /* Display Memory Width  */
919
#define LCKCON_LCDON     0x80   /* Enable LCD Controller */
920
 
921
/* '328-compatible definitions */
922
#define LCKCON_DW_MASK  LCKCON_DWS_MASK
923
#define LCKCON_DW_SHIFT LCKCON_DWS_SHIFT
924
 
925
/*
926
 * LCD Refresh Rate Adjustment Register
927
 */
928
#define LRRA_ADDR       0xfffffa29
929
#define LRRA            BYTE_REF(LRRA_ADDR)
930
 
931
/*
932
 * LCD Panning Offset Register
933
 */
934
#define LPOSR_ADDR      0xfffffa2d
935
#define LPOSR           BYTE_REF(LPOSR_ADDR)
936
 
937
#define LPOSR_POS_MASK  0x0f    /* Pixel Offset Code */
938
#define LPOSR_POS_SHIFT 0
939
 
940
/*
941
 * LCD Frame Rate Control Modulation Register
942
 */
943
#define LFRCM_ADDR      0xfffffa31
944
#define LFRCM           BYTE_REF(LFRCM_ADDR)
945
 
946
#define LFRCM_YMOD_MASK  0x0f   /* Vertical Modulation */
947
#define LFRCM_YMOD_SHIFT 0
948
#define LFRCM_XMOD_MASK  0xf0   /* Horizontal Modulation */
949
#define LFRCM_XMOD_SHIFT 4
950
 
951
/*
952
 * LCD Gray Palette Mapping Register
953
 */
954
#define LGPMR_ADDR      0xfffffa33
955
#define LGPMR           BYTE_REF(LGPMR_ADDR)
956
 
957
#define LGPMR_G1_MASK   0x0f
958
#define LGPMR_G1_SHIFT  0
959
#define LGPMR_G2_MASK   0xf0
960
#define LGPMR_G2_SHIFT  4
961
 
962
/*
963
 * PWM Contrast Control Register
964
 */
965
#define PWMR_ADDR       0xfffffa36
966
#define PWMR            WORD_REF(PWMR_ADDR)
967
 
968
#define PWMR_PW_MASK    0x00ff  /* Pulse Width */
969
#define PWMR_PW_SHIFT   0
970
#define PWMR_CCPEN      0x0100  /* Contrast Control Enable */
971
#define PWMR_SRC_MASK   0x0600  /* Input Clock Source */
972
#define   PWMR_SRC_LINE   0x0000        /* Line Pulse  */
973
#define   PWMR_SRC_PIXEL  0x0200        /* Pixel Clock */
974
#define   PWMR_SRC_LCD    0x4000        /* LCD clock   */
975
 
976
/**********
977
 *
978
 * 0xFFFFFBxx -- Real-Time Clock (RTC)
979
 *
980
 **********/
981
 
982
/*
983
 * RTC Hours Minutes and Seconds Register
984
 */
985
#define RTCTIME_ADDR    0xfffffb00
986
#define RTCTIME         LONG_REF(RTCTIME_ADDR)
987
 
988
#define RTCTIME_SECONDS_MASK    0x0000003f      /* Seconds */
989
#define RTCTIME_SECONDS_SHIFT   0
990
#define RTCTIME_MINUTES_MASK    0x003f0000      /* Minutes */
991
#define RTCTIME_MINUTES_SHIFT   16
992
#define RTCTIME_HOURS_MASK      0x1f000000      /* Hours */
993
#define RTCTIME_HOURS_SHIFT     24
994
 
995
/*
996
 *  RTC Alarm Register
997
 */
998
#define RTCALRM_ADDR    0xfffffb04
999
#define RTCALRM         LONG_REF(RTCALRM_ADDR)
1000
 
1001
#define RTCALRM_SECONDS_MASK    0x0000003f      /* Seconds */
1002
#define RTCALRM_SECONDS_SHIFT   0
1003
#define RTCALRM_MINUTES_MASK    0x003f0000      /* Minutes */
1004
#define RTCALRM_MINUTES_SHIFT   16
1005
#define RTCALRM_HOURS_MASK      0x1f000000      /* Hours */
1006
#define RTCALRM_HOURS_SHIFT     24
1007
 
1008
/*
1009
 * Watchdog Timer Register
1010
 */
1011
#define WATCHDOG_ADDR   0xfffffb0a
1012
#define WATCHDOG        WORD_REF(WATCHDOR_ADDR)
1013
 
1014
#define WATCHDOG_EN     0x0001  /* Watchdog Enabled */
1015
#define WATCHDOG_ISEL   0x0002  /* Select the watchdog interrupt */
1016
#define WATCHDOG_INTF   0x0080  /* Watchdog interrupt occcured */
1017
#define WATCHDOG_CNT_MASK  0x0300       /* Watchdog Counter */
1018
#define WATCHDOG_CNT_SHIFT 8
1019
 
1020
/*
1021
 * RTC Control Register
1022
 */
1023
#define RTCCTL_ADDR     0xfffffb0c
1024
#define RTCCTL          WORD_REF(RTCCTL_ADDR)
1025
 
1026
#define RTCCTL_XTL      0x0020  /* Crystal Selection */
1027
#define RTCCTL_EN       0x0080  /* RTC Enable */
1028
 
1029
/* '328-compatible definitions */
1030
#define RTCCTL_384      RTCCTL_XTL
1031
#define RTCCTL_ENABLE   RTCCTL_EN
1032
 
1033
/*
1034
 * RTC Interrupt Status Register
1035
 */
1036
#define RTCISR_ADDR     0xfffffb0e
1037
#define RTCISR          WORD_REF(RTCISR_ADDR)
1038
 
1039
#define RTCISR_SW       0x0001  /* Stopwatch timed out */
1040
#define RTCISR_MIN      0x0002  /* 1-minute interrupt has occured */
1041
#define RTCISR_ALM      0x0004  /* Alarm interrupt has occured */
1042
#define RTCISR_DAY      0x0008  /* 24-hour rollover interrupt has occured */
1043
#define RTCISR_1HZ      0x0010  /* 1Hz interrupt has occured */
1044
#define RTCISR_HR       0x0020  /* 1-hour interrupt has occured */
1045
#define RTCISR_SAM0     0x0100  /*   4Hz /   4.6875Hz interrupt has occured */ 
1046
#define RTCISR_SAM1     0x0200  /*   8Hz /   9.3750Hz interrupt has occured */ 
1047
#define RTCISR_SAM2     0x0400  /*  16Hz /  18.7500Hz interrupt has occured */ 
1048
#define RTCISR_SAM3     0x0800  /*  32Hz /  37.5000Hz interrupt has occured */ 
1049
#define RTCISR_SAM4     0x1000  /*  64Hz /  75.0000Hz interrupt has occured */ 
1050
#define RTCISR_SAM5     0x2000  /* 128Hz / 150.0000Hz interrupt has occured */ 
1051
#define RTCISR_SAM6     0x4000  /* 256Hz / 300.0000Hz interrupt has occured */ 
1052
#define RTCISR_SAM7     0x8000  /* 512Hz / 600.0000Hz interrupt has occured */ 
1053
 
1054
/*
1055
 * RTC Interrupt Enable Register
1056
 */
1057
#define RTCIENR_ADDR    0xfffffb10
1058
#define RTCIENR         WORD_REF(RTCIENR_ADDR)
1059
 
1060
#define RTCIENR_SW      0x0001  /* Stopwatch interrupt enable */
1061
#define RTCIENR_MIN     0x0002  /* 1-minute interrupt enable */
1062
#define RTCIENR_ALM     0x0004  /* Alarm interrupt enable */
1063
#define RTCIENR_DAY     0x0008  /* 24-hour rollover interrupt enable */
1064
#define RTCIENR_1HZ     0x0010  /* 1Hz interrupt enable */
1065
#define RTCIENR_HR      0x0020  /* 1-hour interrupt enable */
1066
#define RTCIENR_SAM0    0x0100  /*   4Hz /   4.6875Hz interrupt enable */ 
1067
#define RTCIENR_SAM1    0x0200  /*   8Hz /   9.3750Hz interrupt enable */ 
1068
#define RTCIENR_SAM2    0x0400  /*  16Hz /  18.7500Hz interrupt enable */ 
1069
#define RTCIENR_SAM3    0x0800  /*  32Hz /  37.5000Hz interrupt enable */ 
1070
#define RTCIENR_SAM4    0x1000  /*  64Hz /  75.0000Hz interrupt enable */ 
1071
#define RTCIENR_SAM5    0x2000  /* 128Hz / 150.0000Hz interrupt enable */ 
1072
#define RTCIENR_SAM6    0x4000  /* 256Hz / 300.0000Hz interrupt enable */ 
1073
#define RTCIENR_SAM7    0x8000  /* 512Hz / 600.0000Hz interrupt enable */ 
1074
 
1075
/*
1076
 * Stopwatch Minutes Register
1077
 */
1078
#define STPWCH_ADDR     0xfffffb12
1079
#define STPWCH          WORD_REF(STPWCH)
1080
 
1081
#define STPWCH_CNT_MASK  0x003f /* Stopwatch countdown value */
1082
#define SPTWCH_CNT_SHIFT 0
1083
 
1084
/*
1085
 * RTC Day Count Register
1086
 */
1087
#define DAYR_ADDR       0xfffffb1a
1088
#define DAYR            WORD_REF(DAYR_ADDR)
1089
 
1090
#define DAYR_DAYS_MASK  0x1ff   /* Day Setting */
1091
#define DAYR_DAYS_SHIFT 0
1092
 
1093
/*
1094
 * RTC Day Alarm Register
1095
 */
1096
#define DAYALARM_ADDR   0xfffffb1c
1097
#define DAYALARM        WORD_REF(DAYALARM_ADDR)
1098
 
1099
#define DAYALARM_DAYSAL_MASK    0x01ff  /* Day Setting of the Alarm */
1100
#define DAYALARM_DAYSAL_SHIFT   0
1101
 
1102
/**********
1103
 *
1104
 * 0xFFFFFCxx -- DRAM Controller
1105
 *
1106
 **********/
1107
 
1108
/*
1109
 * DRAM Memory Configuration Register
1110
 */
1111
#define DRAMMC_ADDR     0xfffffc00
1112
#define DRAMMC          WORD_REF(DRAMMC_ADDR)
1113
 
1114
#define DRAMMC_ROW12_MASK       0xc000  /* Row address bit for MD12 */
1115
#define   DRAMMC_ROW12_PA10     0x0000
1116
#define   DRAMMC_ROW12_PA21     0x4000  
1117
#define   DRAMMC_ROW12_PA23     0x8000
1118
#define DRAMMC_ROW0_MASK        0x3000  /* Row address bit for MD0 */
1119
#define   DRAMMC_ROW0_PA11      0x0000
1120
#define   DRAMMC_ROW0_PA22      0x1000
1121
#define   DRAMMC_ROW0_PA23      0x2000
1122
#define DRAMMC_ROW11            0x0800  /* Row address bit for MD11 PA20/PA22 */
1123
#define DRAMMC_ROW10            0x0400  /* Row address bit for MD10 PA19/PA21 */
1124
#define DRAMMC_ROW9             0x0200  /* Row address bit for MD9  PA9/PA19  */
1125
#define DRAMMC_ROW8             0x0100  /* Row address bit for MD8  PA10/PA20 */
1126
#define DRAMMC_COL10            0x0080  /* Col address bit for MD10 PA11/PA0  */
1127
#define DRAMMC_COL9             0x0040  /* Col address bit for MD9  PA10/PA0  */
1128
#define DRAMMC_COL8             0x0020  /* Col address bit for MD8  PA9/PA0   */
1129
#define DRAMMC_REF_MASK         0x001f  /* Reresh Cycle */
1130
#define DRAMMC_REF_SHIFT        0
1131
 
1132
/*
1133
 * DRAM Control Register
1134
 */
1135
#define DRAMC_ADDR      0xfffffc02
1136
#define DRAMC           WORD_REF(DRAMC_ADDR)
1137
 
1138
#define DRAMC_DWE          0x0001       /* DRAM Write Enable */
1139
#define DRAMC_RST          0x0002       /* Reset Burst Refresh Enable */
1140
#define DRAMC_LPR          0x0004       /* Low-Power Refresh Enable */
1141
#define DRAMC_SLW          0x0008       /* Slow RAM */
1142
#define DRAMC_LSP          0x0010       /* Light Sleep */
1143
#define DRAMC_MSW          0x0020       /* Slow Multiplexing */
1144
#define DRAMC_WS_MASK      0x00c0       /* Wait-states */
1145
#define DRAMC_WS_SHIFT     6
1146
#define DRAMC_PGSZ_MASK    0x0300       /* Page Size for fast page mode */
1147
#define DRAMC_PGSZ_SHIFT   8
1148
#define   DRAMC_PGSZ_256K  0x0000       
1149
#define   DRAMC_PGSZ_512K  0x0100
1150
#define   DRAMC_PGSZ_1024K 0x0200
1151
#define   DRAMC_PGSZ_2048K 0x0300
1152
#define DRAMC_EDO          0x0400       /* EDO DRAM */
1153
#define DRAMC_CLK          0x0800       /* Refresh Timer Clock source select */
1154
#define DRAMC_BC_MASK      0x3000       /* Page Access Clock Cycle (FP mode) */
1155
#define DRAMC_BC_SHIFT     12
1156
#define DRAMC_RM           0x4000       /* Refresh Mode */
1157
#define DRAMC_EN           0x8000       /* DRAM Controller enable */
1158
 
1159
 
1160
/**********
1161
 *
1162
 * 0xFFFFFDxx -- In-Circuit Emulation (ICE)
1163
 *
1164
 **********/
1165
 
1166
/*
1167
 * ICE Module Address Compare Register
1168
 */
1169
#define ICEMACR_ADDR    0xfffffd00
1170
#define ICEMACR         LONG_REF(ICEMACR_ADDR)
1171
 
1172
/*
1173
 * ICE Module Address Mask Register
1174
 */
1175
#define ICEMAMR_ADDR    0xfffffd04
1176
#define ICEMAMR         LONG_REF(ICEMAMR_ADDR)
1177
 
1178
/*
1179
 * ICE Module Control Compare Register
1180
 */
1181
#define ICEMCCR_ADDR    0xfffffd08
1182
#define ICEMCCR         WORD_REF(ICEMCCR_ADDR)
1183
 
1184
#define ICEMCCR_PD      0x0001  /* Program/Data Cycle Selection */
1185
#define ICEMCCR_RW      0x0002  /* Read/Write Cycle Selection */
1186
 
1187
/*
1188
 * ICE Module Control Mask Register
1189
 */
1190
#define ICEMCMR_ADDR    0xfffffd0a
1191
#define ICEMCMR         WORD_REF(ICEMCMR_ADDR)
1192
 
1193
#define ICEMCMR_PDM     0x0001  /* Program/Data Cycle Mask */
1194
#define ICEMCMR_RWM     0x0002  /* Read/Write Cycle Mask */
1195
 
1196
/*
1197
 * ICE Module Control Register
1198
 */
1199
#define ICEMCR_ADDR     0xfffffd0c
1200
#define ICEMCR          WORD_REF(ICEMCR_ADDR)
1201
 
1202
#define ICEMCR_CEN      0x0001  /* Compare Enable */
1203
#define ICEMCR_PBEN     0x0002  /* Program Break Enable */
1204
#define ICEMCR_SB       0x0004  /* Single Breakpoint */
1205
#define ICEMCR_HMDIS    0x0008  /* HardMap disable */
1206
#define ICEMCR_BBIEN    0x0010  /* Bus Break Interrupt Enable */
1207
 
1208
/*
1209
 * ICE Module Status Register
1210
 */
1211
#define ICEMSR_ADDR     0xfffffd0e
1212
#define ICEMSR          WORD_REF(ICEMSR_ADDR)
1213
 
1214
#define ICEMSR_EMUEN    0x0001  /* Emulation Enable */
1215
#define ICEMSR_BRKIRQ   0x0002  /* A-Line Vector Fetch Detected */
1216
#define ICEMSR_BBIRQ    0x0004  /* Bus Break Interrupt Detected */
1217
#define ICEMSR_EMIRQ    0x0008  /* EMUIRQ Falling Edge Detected */
1218
 
1219
#endif /* _MC68EZ328_H_ */

powered by: WebSVN 2.1.0

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