1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef S626_H_INCLUDED
14 #define S626_H_INCLUDED
15
16 #define S626_DMABUF_SIZE 4096
17
18 #define S626_ADC_CHANNELS 16
19 #define S626_DAC_CHANNELS 4
20 #define S626_ENCODER_CHANNELS 6
21 #define S626_DIO_CHANNELS 48
22 #define S626_DIO_BANKS 3
23 #define S626_DIO_EXTCHANS 40
24
25
26
27
28 #define S626_NUM_TRIMDACS 12
29
30
31 #define S626_INTEL 1
32 #define S626_MOTOROLA 2
33
34 #define S626_PLATFORM S626_INTEL
35
36 #define S626_RANGE_5V 0x10
37 #define S626_RANGE_10V 0x00
38
39 #define S626_EOPL 0x80
40 #define S626_GSEL_BIPOLAR5V 0x00F0
41 #define S626_GSEL_BIPOLAR10V 0x00A0
42
43
44 #define S626_ERR_ILLEGAL_PARM 0x00010000
45
46
47
48 #define S626_ERR_I2C 0x00020000
49 #define S626_ERR_COUNTERSETUP 0x00200000
50
51
52
53 #define S626_ERR_DEBI_TIMEOUT 0x00400000
54
55
56
57
58
59 #define S626_ADC_DMABUF_DWORDS 40
60
61
62
63 #define S626_DAC_WDMABUF_DWORDS 1
64
65
66
67
68
69
70
71 #define S626_DAC_WDMABUF_OS S626_ADC_DMABUF_DWORDS
72
73
74 #define S626_IRQ_GPIO3 0x00000040
75 #define S626_IRQ_RPS1 0x10000000
76 #define S626_ISR_AFOU 0x00000800
77
78
79 #define S626_IRQ_COINT1A 0x0400
80 #define S626_IRQ_COINT1B 0x0800
81 #define S626_IRQ_COINT2A 0x1000
82 #define S626_IRQ_COINT2B 0x2000
83 #define S626_IRQ_COINT3A 0x4000
84 #define S626_IRQ_COINT3B 0x8000
85
86
87 #define S626_RPS_CLRSIGNAL 0x00000000
88 #define S626_RPS_SETSIGNAL 0x10000000
89 #define S626_RPS_NOP 0x00000000
90 #define S626_RPS_PAUSE 0x20000000
91 #define S626_RPS_UPLOAD 0x40000000
92 #define S626_RPS_JUMP 0x80000000
93 #define S626_RPS_LDREG 0x90000100
94 #define S626_RPS_STREG 0xA0000100
95 #define S626_RPS_STOP 0x50000000
96 #define S626_RPS_IRQ 0x60000000
97
98 #define S626_RPS_LOGICAL_OR 0x08000000
99 #define S626_RPS_INVERT 0x04000000
100
101
102
103 #define S626_RPS_DEBI 0x00000002
104
105 #define S626_RPS_SIG0 0x00200000
106
107
108
109 #define S626_RPS_SIG1 0x00400000
110
111
112
113 #define S626_RPS_SIG2 0x00800000
114
115
116
117 #define S626_RPS_GPIO2 0x00080000
118 #define S626_RPS_GPIO3 0x00100000
119
120 #define S626_RPS_SIGADC S626_RPS_SIG0
121
122
123
124 #define S626_RPS_SIGDAC S626_RPS_SIG1
125
126
127
128
129
130 #define S626_RPSCLK_SCALAR 8
131
132
133
134 #define S626_RPSCLK_PER_US (33 / S626_RPSCLK_SCALAR)
135
136
137
138
139
140
141 #define S626_SBA_RPS_A0 0x27
142
143
144 #define S626_GPIO_BASE 0x10004000
145
146
147
148 #define S626_GPIO1_LO 0x00000000
149 #define S626_GPIO1_HI 0x00001000
150
151
152 #define S626_PSR_DEBI_E 0x00040000
153 #define S626_PSR_DEBI_S 0x00080000
154 #define S626_PSR_A2_IN 0x00008000
155
156
157
158 #define S626_PSR_AFOU 0x00000800
159
160
161
162 #define S626_PSR_GPIO2 0x00000020
163
164
165
166 #define S626_PSR_EC0S 0x00000001
167
168
169
170
171
172 #define S626_SSR_AF2_OUT 0x00000200
173
174
175
176
177
178 #define S626_MC1_SOFT_RESET 0x80000000
179 #define S626_MC1_SHUTDOWN 0x3FFF0000
180
181
182
183
184 #define S626_MC1_ERPS1 0x2000
185 #define S626_MC1_ERPS0 0x1000
186 #define S626_MC1_DEBI 0x0800
187 #define S626_MC1_AUDIO 0x0200
188 #define S626_MC1_I2C 0x0100
189 #define S626_MC1_A2OUT 0x0008
190 #define S626_MC1_A2IN 0x0004
191 #define S626_MC1_A1IN 0x0001
192
193
194 #define S626_MC2_UPLD_DEBI 0x0002
195 #define S626_MC2_UPLD_IIC 0x0001
196 #define S626_MC2_RPSSIG2 0x2000
197 #define S626_MC2_RPSSIG1 0x1000
198 #define S626_MC2_RPSSIG0 0x0800
199
200 #define S626_MC2_ADC_RPS S626_MC2_RPSSIG0
201 #define S626_MC2_DAC_RPS S626_MC2_RPSSIG1
202
203
204 #define S626_P_PCI_BT_A 0x004C
205 #define S626_P_DEBICFG 0x007C
206 #define S626_P_DEBICMD 0x0080
207 #define S626_P_DEBIPAGE 0x0084
208 #define S626_P_DEBIAD 0x0088
209 #define S626_P_I2CCTRL 0x008C
210 #define S626_P_I2CSTAT 0x0090
211 #define S626_P_BASEA2_IN 0x00AC
212
213
214
215 #define S626_P_PROTA2_IN 0x00B0
216
217
218
219 #define S626_P_PAGEA2_IN 0x00B4
220 #define S626_P_BASEA2_OUT 0x00B8
221
222
223
224 #define S626_P_PROTA2_OUT 0x00BC
225
226
227
228 #define S626_P_PAGEA2_OUT 0x00C0
229 #define S626_P_RPSPAGE0 0x00C4
230 #define S626_P_RPSPAGE1 0x00C8
231 #define S626_P_RPS0_TOUT 0x00D4
232 #define S626_P_RPS1_TOUT 0x00D8
233 #define S626_P_IER 0x00DC
234 #define S626_P_GPIO 0x00E0
235 #define S626_P_EC1SSR 0x00E4
236 #define S626_P_ECT1R 0x00EC
237 #define S626_P_ACON1 0x00F4
238 #define S626_P_ACON2 0x00F8
239 #define S626_P_MC1 0x00FC
240 #define S626_P_MC2 0x0100
241 #define S626_P_RPSADDR0 0x0104
242 #define S626_P_RPSADDR1 0x0108
243 #define S626_P_ISR 0x010C
244 #define S626_P_PSR 0x0110
245 #define S626_P_SSR 0x0114
246 #define S626_P_EC1R 0x0118
247 #define S626_P_ADP4 0x0138
248
249
250
251 #define S626_P_FB_BUFFER1 0x0144
252 #define S626_P_FB_BUFFER2 0x0148
253 #define S626_P_TSL1 0x0180
254 #define S626_P_TSL2 0x01C0
255
256
257
258 #define S626_LP_DACPOL 0x0082
259 #define S626_LP_GSEL 0x0084
260 #define S626_LP_ISEL 0x0086
261
262
263 #define S626_LP_RDDIN(x) (0x0040 + (x) * 0x10)
264 #define S626_LP_WRINTSEL(x) (0x0042 + (x) * 0x10)
265 #define S626_LP_WREDGSEL(x) (0x0044 + (x) * 0x10)
266 #define S626_LP_WRCAPSEL(x) (0x0046 + (x) * 0x10)
267 #define S626_LP_RDCAPFLG(x) (0x0048 + (x) * 0x10)
268 #define S626_LP_WRDOUT(x) (0x0048 + (x) * 0x10)
269 #define S626_LP_RDINTSEL(x) (0x004a + (x) * 0x10)
270 #define S626_LP_RDEDGSEL(x) (0x004c + (x) * 0x10)
271 #define S626_LP_RDCAPSEL(x) (0x004e + (x) * 0x10)
272
273
274 #define S626_LP_CRA(x) (0x0000 + (((x) % 3) * 0x4))
275 #define S626_LP_CRB(x) (0x0002 + (((x) % 3) * 0x4))
276
277
278 #define S626_LP_CNTR(x) (0x000c + (((x) < 3) ? 0x0 : 0x4) + \
279 (((x) % 3) * 0x8))
280
281
282 #define S626_LP_MISC1 0x0088
283 #define S626_LP_WRMISC2 0x0090
284 #define S626_LP_RDMISC2 0x0082
285
286
287 #define S626_MISC1_WENABLE 0x8000
288
289
290
291 #define S626_MISC1_WDISABLE 0x0000
292 #define S626_MISC1_EDCAP 0x1000
293
294
295
296 #define S626_MISC1_NOEDCAP 0x0000
297
298
299
300
301
302 #define S626_RDMISC1_WDTIMEOUT 0x4000
303
304
305 #define S626_WRMISC2_WDCLEAR 0x8000
306 #define S626_WRMISC2_CHARGE_ENABLE 0x4000
307
308
309 #define S626_MISC2_BATT_ENABLE 0x0008
310 #define S626_MISC2_WDENABLE 0x0004
311 #define S626_MISC2_WDPERIOD_MASK 0x0003
312
313
314 #define S626_A2_RUN 0x40000000
315 #define S626_A1_RUN 0x20000000
316 #define S626_A1_SWAP 0x00200000
317 #define S626_A2_SWAP 0x00100000
318 #define S626_WS_MODES 0x00019999
319
320
321
322
323 #if (S626_PLATFORM == S626_INTEL)
324
325
326
327 #define S626_ACON1_BASE (S626_WS_MODES | S626_A1_RUN)
328 #elif S626_PLATFORM == S626_MOTOROLA
329 #define S626_ACON1_BASE \
330 (S626_WS_MODES | S626_A1_RUN | S626_A1_SWAP | S626_A2_SWAP)
331 #endif
332
333 #define S626_ACON1_ADCSTART S626_ACON1_BASE
334
335
336
337 #define S626_ACON1_DACSTART (S626_ACON1_BASE | S626_A2_RUN)
338
339 #define S626_ACON1_DACSTOP S626_ACON1_BASE
340
341
342 #define S626_A1_CLKSRC_BCLK1 0x00000000
343 #define S626_A2_CLKSRC_X1 0x00800000
344
345
346
347 #define S626_A2_CLKSRC_X2 0x00C00000
348
349
350
351 #define S626_A2_CLKSRC_X4 0x01400000
352
353
354
355 #define S626_INVERT_BCLK2 0x00100000
356 #define S626_BCLK2_OE 0x00040000
357 #define S626_ACON2_XORMASK 0x000C0000
358
359
360
361
362 #define S626_ACON2_INIT (S626_ACON2_XORMASK ^ \
363 (S626_A1_CLKSRC_BCLK1 | S626_A2_CLKSRC_X2 | \
364 S626_INVERT_BCLK2 | S626_BCLK2_OE))
365
366
367 #define S626_WS1 0x40000000
368 #define S626_WS2 0x20000000
369 #define S626_WS3 0x10000000
370 #define S626_WS4 0x08000000
371 #define S626_RSD1 0x01000000
372 #define S626_SDW_A1 0x00800000
373
374
375
376 #define S626_SIB_A1 0x00400000
377
378
379
380 #define S626_SF_A1 0x00200000
381
382
383
384
385
386 #define S626_XFIFO_0 0x00000000
387 #define S626_XFIFO_1 0x00000010
388 #define S626_XFIFO_2 0x00000020
389 #define S626_XFIFO_3 0x00000030
390 #define S626_XFB0 0x00000040
391 #define S626_XFB1 0x00000050
392 #define S626_XFB2 0x00000060
393 #define S626_XFB3 0x00000070
394 #define S626_SIB_A2 0x00000200
395
396
397
398
399 #define S626_SF_A2 0x00000100
400
401
402
403
404 #define S626_LF_A2 0x00000080
405
406
407
408
409 #define S626_XSD2 0x00000008
410 #define S626_RSD3 0x00001800
411 #define S626_RSD2 0x00001000
412 #define S626_LOW_A2 0x00000002
413
414
415
416 #define S626_EOS 0x00000001
417
418
419 #define S626_I2C_CLKSEL 0x0400
420
421
422
423 #define S626_I2C_BITRATE 68.75
424
425
426
427
428 #define S626_I2C_WRTIME 15.0
429
430
431
432
433
434
435
436
437 #define S626_I2C_RETRIES (S626_I2C_WRTIME * S626_I2C_BITRATE / 9.0)
438 #define S626_I2C_ERR 0x0002
439 #define S626_I2C_BUSY 0x0001
440 #define S626_I2C_ABORT 0x0080
441 #define S626_I2C_ATTRSTART 0x3
442 #define S626_I2C_ATTRCONT 0x2
443 #define S626_I2C_ATTRSTOP 0x1
444 #define S626_I2C_ATTRNOP 0x0
445
446
447 #define S626_I2C_B2(ATTR, VAL) (((ATTR) << 6) | ((VAL) << 24))
448 #define S626_I2C_B1(ATTR, VAL) (((ATTR) << 4) | ((VAL) << 16))
449 #define S626_I2C_B0(ATTR, VAL) (((ATTR) << 2) | ((VAL) << 8))
450
451
452 #define S626_DEBI_CMD_SIZE16 (2 << 17)
453
454
455
456 #define S626_DEBI_CMD_READ 0x00010000
457 #define S626_DEBI_CMD_WRITE 0x00000000
458
459
460 #define S626_DEBI_CMD_RDWORD (S626_DEBI_CMD_READ | S626_DEBI_CMD_SIZE16)
461
462
463 #define S626_DEBI_CMD_WRWORD (S626_DEBI_CMD_WRITE | S626_DEBI_CMD_SIZE16)
464
465
466 #define S626_DEBI_CFG_XIRQ_EN 0x80000000
467
468
469
470 #define S626_DEBI_CFG_XRESUME 0x40000000
471
472
473
474
475 #define S626_DEBI_CFG_TOQ 0x03C00000
476 #define S626_DEBI_CFG_FAST 0x10000000
477
478
479 #define S626_DEBI_CFG_TOUT_BIT 22
480
481
482
483
484
485 #define S626_DEBI_CFG_SWAP_NONE 0x00000000
486
487
488
489 #define S626_DEBI_CFG_SWAP_2 0x00100000
490 #define S626_DEBI_CFG_SWAP_4 0x00200000
491 #define S626_DEBI_CFG_SLAVE16 0x00080000
492
493
494
495 #define S626_DEBI_CFG_INC 0x00040000
496
497
498
499 #define S626_DEBI_CFG_INTEL 0x00020000
500 #define S626_DEBI_CFG_TIMEROFF 0x00010000
501
502 #if S626_PLATFORM == S626_INTEL
503
504 #define S626_DEBI_TOUT 7
505
506
507
508
509
510 #define S626_DEBI_SWAP S626_DEBI_CFG_SWAP_NONE
511
512 #elif S626_PLATFORM == S626_MOTOROLA
513
514 #define S626_DEBI_TOUT 15
515
516
517
518
519
520 #define S626_DEBI_SWAP S626_DEBI_CFG_SWAP_2
521
522 #endif
523
524
525 #define S626_DEBI_PAGE_DISABLE 0x00000000
526
527
528
529
530 #define S626_LOADSRC_INDX 0
531 #define S626_LOADSRC_OVER 1
532
533
534
535 #define S626_LOADSRCB_OVERA 2
536
537
538
539 #define S626_LOADSRC_NONE 3
540
541
542 #define S626_INTSRC_NONE 0
543 #define S626_INTSRC_OVER 1
544 #define S626_INTSRC_INDX 2
545 #define S626_INTSRC_BOTH 3
546
547
548 #define S626_LATCHSRC_AB_READ 0
549 #define S626_LATCHSRC_A_INDXA 1
550 #define S626_LATCHSRC_B_INDXB 2
551 #define S626_LATCHSRC_B_OVERA 3
552
553
554 #define S626_INDXSRC_ENCODER 0
555 #define S626_INDXSRC_DIGIN 1
556 #define S626_INDXSRC_SOFT 2
557 #define S626_INDXSRC_DISABLED 3
558
559
560 #define S626_INDXPOL_POS 0
561 #define S626_INDXPOL_NEG 1
562
563
564 #define S626_ENCMODE_COUNTER 0
565 #define S626_ENCMODE_TIMER 2
566 #define S626_ENCMODE_EXTENDER 3
567
568
569 #define S626_CNTSRC_ENCODER 0
570 #define S626_CNTSRC_DIGIN 1
571 #define S626_CNTSRC_SYSCLK 2
572 #define S626_CNTSRC_SYSCLK_DOWN 3
573
574
575 #define S626_CLKPOL_POS 0
576
577
578
579 #define S626_CLKPOL_NEG 1
580
581
582
583 #define S626_CNTDIR_UP 0
584 #define S626_CNTDIR_DOWN 1
585
586
587 #define S626_CLKENAB_ALWAYS 0
588 #define S626_CLKENAB_INDEX 1
589
590
591 #define S626_CLKMULT_4X 0
592 #define S626_CLKMULT_2X 1
593 #define S626_CLKMULT_1X 2
594 #define S626_CLKMULT_SPECIAL 3
595
596
597
598 #define S626_NUM_COUNTERS 6
599
600
601
602 #define S626_NUM_INTSOURCES 4
603 #define S626_NUM_LATCHSOURCES 4
604 #define S626_NUM_CLKMULTS 4
605 #define S626_NUM_CLKSOURCES 4
606 #define S626_NUM_CLKPOLS 2
607 #define S626_NUM_INDEXPOLS 2
608 #define S626_NUM_INDEXSOURCES 2
609 #define S626_NUM_LOADTRIGS 4
610
611
612 #define S626_MAKE(x, w, p) (((x) & ((1 << (w)) - 1)) << (p))
613 #define S626_UNMAKE(v, w, p) (((v) >> (p)) & ((1 << (w)) - 1))
614
615
616 #define S626_CRABIT_INDXSRC_B 14
617 #define S626_CRABIT_CNTSRC_B 12
618 #define S626_CRABIT_INDXPOL_A 11
619 #define S626_CRABIT_LOADSRC_A 9
620 #define S626_CRABIT_CLKMULT_A 7
621 #define S626_CRABIT_INTSRC_A 5
622 #define S626_CRABIT_CLKPOL_A 4
623 #define S626_CRABIT_INDXSRC_A 2
624 #define S626_CRABIT_CNTSRC_A 0
625
626
627 #define S626_CRAWID_INDXSRC_B 2
628 #define S626_CRAWID_CNTSRC_B 2
629 #define S626_CRAWID_INDXPOL_A 1
630 #define S626_CRAWID_LOADSRC_A 2
631 #define S626_CRAWID_CLKMULT_A 2
632 #define S626_CRAWID_INTSRC_A 2
633 #define S626_CRAWID_CLKPOL_A 1
634 #define S626_CRAWID_INDXSRC_A 2
635 #define S626_CRAWID_CNTSRC_A 2
636
637
638 #define S626_CRAMSK_INDXSRC_B S626_SET_CRA_INDXSRC_B(~0)
639 #define S626_CRAMSK_CNTSRC_B S626_SET_CRA_CNTSRC_B(~0)
640 #define S626_CRAMSK_INDXPOL_A S626_SET_CRA_INDXPOL_A(~0)
641 #define S626_CRAMSK_LOADSRC_A S626_SET_CRA_LOADSRC_A(~0)
642 #define S626_CRAMSK_CLKMULT_A S626_SET_CRA_CLKMULT_A(~0)
643 #define S626_CRAMSK_INTSRC_A S626_SET_CRA_INTSRC_A(~0)
644 #define S626_CRAMSK_CLKPOL_A S626_SET_CRA_CLKPOL_A(~0)
645 #define S626_CRAMSK_INDXSRC_A S626_SET_CRA_INDXSRC_A(~0)
646 #define S626_CRAMSK_CNTSRC_A S626_SET_CRA_CNTSRC_A(~0)
647
648
649 #define S626_SET_CRA_INDXSRC_B(x) \
650 S626_MAKE((x), S626_CRAWID_INDXSRC_B, S626_CRABIT_INDXSRC_B)
651 #define S626_SET_CRA_CNTSRC_B(x) \
652 S626_MAKE((x), S626_CRAWID_CNTSRC_B, S626_CRABIT_CNTSRC_B)
653 #define S626_SET_CRA_INDXPOL_A(x) \
654 S626_MAKE((x), S626_CRAWID_INDXPOL_A, S626_CRABIT_INDXPOL_A)
655 #define S626_SET_CRA_LOADSRC_A(x) \
656 S626_MAKE((x), S626_CRAWID_LOADSRC_A, S626_CRABIT_LOADSRC_A)
657 #define S626_SET_CRA_CLKMULT_A(x) \
658 S626_MAKE((x), S626_CRAWID_CLKMULT_A, S626_CRABIT_CLKMULT_A)
659 #define S626_SET_CRA_INTSRC_A(x) \
660 S626_MAKE((x), S626_CRAWID_INTSRC_A, S626_CRABIT_INTSRC_A)
661 #define S626_SET_CRA_CLKPOL_A(x) \
662 S626_MAKE((x), S626_CRAWID_CLKPOL_A, S626_CRABIT_CLKPOL_A)
663 #define S626_SET_CRA_INDXSRC_A(x) \
664 S626_MAKE((x), S626_CRAWID_INDXSRC_A, S626_CRABIT_INDXSRC_A)
665 #define S626_SET_CRA_CNTSRC_A(x) \
666 S626_MAKE((x), S626_CRAWID_CNTSRC_A, S626_CRABIT_CNTSRC_A)
667
668
669 #define S626_GET_CRA_INDXSRC_B(v) \
670 S626_UNMAKE((v), S626_CRAWID_INDXSRC_B, S626_CRABIT_INDXSRC_B)
671 #define S626_GET_CRA_CNTSRC_B(v) \
672 S626_UNMAKE((v), S626_CRAWID_CNTSRC_B, S626_CRABIT_CNTSRC_B)
673 #define S626_GET_CRA_INDXPOL_A(v) \
674 S626_UNMAKE((v), S626_CRAWID_INDXPOL_A, S626_CRABIT_INDXPOL_A)
675 #define S626_GET_CRA_LOADSRC_A(v) \
676 S626_UNMAKE((v), S626_CRAWID_LOADSRC_A, S626_CRABIT_LOADSRC_A)
677 #define S626_GET_CRA_CLKMULT_A(v) \
678 S626_UNMAKE((v), S626_CRAWID_CLKMULT_A, S626_CRABIT_CLKMULT_A)
679 #define S626_GET_CRA_INTSRC_A(v) \
680 S626_UNMAKE((v), S626_CRAWID_INTSRC_A, S626_CRABIT_INTSRC_A)
681 #define S626_GET_CRA_CLKPOL_A(v) \
682 S626_UNMAKE((v), S626_CRAWID_CLKPOL_A, S626_CRABIT_CLKPOL_A)
683 #define S626_GET_CRA_INDXSRC_A(v) \
684 S626_UNMAKE((v), S626_CRAWID_INDXSRC_A, S626_CRABIT_INDXSRC_A)
685 #define S626_GET_CRA_CNTSRC_A(v) \
686 S626_UNMAKE((v), S626_CRAWID_CNTSRC_A, S626_CRABIT_CNTSRC_A)
687
688
689 #define S626_CRBBIT_INTRESETCMD 15
690 #define S626_CRBBIT_CNTDIR_B 15
691 #define S626_CRBBIT_INTRESET_B 14
692 #define S626_CRBBIT_OVERDO_A 14
693 #define S626_CRBBIT_INTRESET_A 13
694 #define S626_CRBBIT_OVERDO_B 13
695 #define S626_CRBBIT_CLKENAB_A 12
696 #define S626_CRBBIT_INTSRC_B 10
697 #define S626_CRBBIT_LATCHSRC 8
698 #define S626_CRBBIT_LOADSRC_B 6
699 #define S626_CRBBIT_CLEAR_B 7
700 #define S626_CRBBIT_CLKMULT_B 3
701 #define S626_CRBBIT_CLKENAB_B 2
702 #define S626_CRBBIT_INDXPOL_B 1
703 #define S626_CRBBIT_CLKPOL_B 0
704
705
706 #define S626_CRBWID_INTRESETCMD 1
707 #define S626_CRBWID_CNTDIR_B 1
708 #define S626_CRBWID_INTRESET_B 1
709 #define S626_CRBWID_OVERDO_A 1
710 #define S626_CRBWID_INTRESET_A 1
711 #define S626_CRBWID_OVERDO_B 1
712 #define S626_CRBWID_CLKENAB_A 1
713 #define S626_CRBWID_INTSRC_B 2
714 #define S626_CRBWID_LATCHSRC 2
715 #define S626_CRBWID_LOADSRC_B 2
716 #define S626_CRBWID_CLEAR_B 1
717 #define S626_CRBWID_CLKMULT_B 2
718 #define S626_CRBWID_CLKENAB_B 1
719 #define S626_CRBWID_INDXPOL_B 1
720 #define S626_CRBWID_CLKPOL_B 1
721
722
723 #define S626_CRBMSK_INTRESETCMD S626_SET_CRB_INTRESETCMD(~0)
724 #define S626_CRBMSK_CNTDIR_B S626_CRBMSK_INTRESETCMD
725 #define S626_CRBMSK_INTRESET_B S626_SET_CRB_INTRESET_B(~0)
726 #define S626_CRBMSK_OVERDO_A S626_CRBMSK_INTRESET_B
727 #define S626_CRBMSK_INTRESET_A S626_SET_CRB_INTRESET_A(~0)
728 #define S626_CRBMSK_OVERDO_B S626_CRBMSK_INTRESET_A
729 #define S626_CRBMSK_CLKENAB_A S626_SET_CRB_CLKENAB_A(~0)
730 #define S626_CRBMSK_INTSRC_B S626_SET_CRB_INTSRC_B(~0)
731 #define S626_CRBMSK_LATCHSRC S626_SET_CRB_LATCHSRC(~0)
732 #define S626_CRBMSK_LOADSRC_B S626_SET_CRB_LOADSRC_B(~0)
733 #define S626_CRBMSK_CLEAR_B S626_SET_CRB_CLEAR_B(~0)
734 #define S626_CRBMSK_CLKMULT_B S626_SET_CRB_CLKMULT_B(~0)
735 #define S626_CRBMSK_CLKENAB_B S626_SET_CRB_CLKENAB_B(~0)
736 #define S626_CRBMSK_INDXPOL_B S626_SET_CRB_INDXPOL_B(~0)
737 #define S626_CRBMSK_CLKPOL_B S626_SET_CRB_CLKPOL_B(~0)
738
739
740 #define S626_CRBMSK_INTCTRL (S626_CRBMSK_INTRESETCMD | \
741 S626_CRBMSK_INTRESET_A | \
742 S626_CRBMSK_INTRESET_B)
743
744
745 #define S626_SET_CRB_INTRESETCMD(x) \
746 S626_MAKE((x), S626_CRBWID_INTRESETCMD, S626_CRBBIT_INTRESETCMD)
747 #define S626_SET_CRB_INTRESET_B(x) \
748 S626_MAKE((x), S626_CRBWID_INTRESET_B, S626_CRBBIT_INTRESET_B)
749 #define S626_SET_CRB_INTRESET_A(x) \
750 S626_MAKE((x), S626_CRBWID_INTRESET_A, S626_CRBBIT_INTRESET_A)
751 #define S626_SET_CRB_CLKENAB_A(x) \
752 S626_MAKE((x), S626_CRBWID_CLKENAB_A, S626_CRBBIT_CLKENAB_A)
753 #define S626_SET_CRB_INTSRC_B(x) \
754 S626_MAKE((x), S626_CRBWID_INTSRC_B, S626_CRBBIT_INTSRC_B)
755 #define S626_SET_CRB_LATCHSRC(x) \
756 S626_MAKE((x), S626_CRBWID_LATCHSRC, S626_CRBBIT_LATCHSRC)
757 #define S626_SET_CRB_LOADSRC_B(x) \
758 S626_MAKE((x), S626_CRBWID_LOADSRC_B, S626_CRBBIT_LOADSRC_B)
759 #define S626_SET_CRB_CLEAR_B(x) \
760 S626_MAKE((x), S626_CRBWID_CLEAR_B, S626_CRBBIT_CLEAR_B)
761 #define S626_SET_CRB_CLKMULT_B(x) \
762 S626_MAKE((x), S626_CRBWID_CLKMULT_B, S626_CRBBIT_CLKMULT_B)
763 #define S626_SET_CRB_CLKENAB_B(x) \
764 S626_MAKE((x), S626_CRBWID_CLKENAB_B, S626_CRBBIT_CLKENAB_B)
765 #define S626_SET_CRB_INDXPOL_B(x) \
766 S626_MAKE((x), S626_CRBWID_INDXPOL_B, S626_CRBBIT_INDXPOL_B)
767 #define S626_SET_CRB_CLKPOL_B(x) \
768 S626_MAKE((x), S626_CRBWID_CLKPOL_B, S626_CRBBIT_CLKPOL_B)
769
770
771 #define S626_GET_CRB_CNTDIR_B(v) \
772 S626_UNMAKE((v), S626_CRBWID_CNTDIR_B, S626_CRBBIT_CNTDIR_B)
773 #define S626_GET_CRB_OVERDO_A(v) \
774 S626_UNMAKE((v), S626_CRBWID_OVERDO_A, S626_CRBBIT_OVERDO_A)
775 #define S626_GET_CRB_OVERDO_B(v) \
776 S626_UNMAKE((v), S626_CRBWID_OVERDO_B, S626_CRBBIT_OVERDO_B)
777 #define S626_GET_CRB_CLKENAB_A(v) \
778 S626_UNMAKE((v), S626_CRBWID_CLKENAB_A, S626_CRBBIT_CLKENAB_A)
779 #define S626_GET_CRB_INTSRC_B(v) \
780 S626_UNMAKE((v), S626_CRBWID_INTSRC_B, S626_CRBBIT_INTSRC_B)
781 #define S626_GET_CRB_LATCHSRC(v) \
782 S626_UNMAKE((v), S626_CRBWID_LATCHSRC, S626_CRBBIT_LATCHSRC)
783 #define S626_GET_CRB_LOADSRC_B(v) \
784 S626_UNMAKE((v), S626_CRBWID_LOADSRC_B, S626_CRBBIT_LOADSRC_B)
785 #define S626_GET_CRB_CLEAR_B(v) \
786 S626_UNMAKE((v), S626_CRBWID_CLEAR_B, S626_CRBBIT_CLEAR_B)
787 #define S626_GET_CRB_CLKMULT_B(v) \
788 S626_UNMAKE((v), S626_CRBWID_CLKMULT_B, S626_CRBBIT_CLKMULT_B)
789 #define S626_GET_CRB_CLKENAB_B(v) \
790 S626_UNMAKE((v), S626_CRBWID_CLKENAB_B, S626_CRBBIT_CLKENAB_B)
791 #define S626_GET_CRB_INDXPOL_B(v) \
792 S626_UNMAKE((v), S626_CRBWID_INDXPOL_B, S626_CRBBIT_INDXPOL_B)
793 #define S626_GET_CRB_CLKPOL_B(v) \
794 S626_UNMAKE((v), S626_CRBWID_CLKPOL_B, S626_CRBBIT_CLKPOL_B)
795
796
797 #define S626_STDBIT_INTSRC 13
798 #define S626_STDBIT_LATCHSRC 11
799 #define S626_STDBIT_LOADSRC 9
800 #define S626_STDBIT_INDXSRC 7
801 #define S626_STDBIT_INDXPOL 6
802 #define S626_STDBIT_ENCMODE 4
803 #define S626_STDBIT_CLKPOL 3
804 #define S626_STDBIT_CLKMULT 1
805 #define S626_STDBIT_CLKENAB 0
806
807
808 #define S626_STDWID_INTSRC 2
809 #define S626_STDWID_LATCHSRC 2
810 #define S626_STDWID_LOADSRC 2
811 #define S626_STDWID_INDXSRC 2
812 #define S626_STDWID_INDXPOL 1
813 #define S626_STDWID_ENCMODE 2
814 #define S626_STDWID_CLKPOL 1
815 #define S626_STDWID_CLKMULT 2
816 #define S626_STDWID_CLKENAB 1
817
818
819 #define S626_STDMSK_INTSRC S626_SET_STD_INTSRC(~0)
820 #define S626_STDMSK_LATCHSRC S626_SET_STD_LATCHSRC(~0)
821 #define S626_STDMSK_LOADSRC S626_SET_STD_LOADSRC(~0)
822 #define S626_STDMSK_INDXSRC S626_SET_STD_INDXSRC(~0)
823 #define S626_STDMSK_INDXPOL S626_SET_STD_INDXPOL(~0)
824 #define S626_STDMSK_ENCMODE S626_SET_STD_ENCMODE(~0)
825 #define S626_STDMSK_CLKPOL S626_SET_STD_CLKPOL(~0)
826 #define S626_STDMSK_CLKMULT S626_SET_STD_CLKMULT(~0)
827 #define S626_STDMSK_CLKENAB S626_SET_STD_CLKENAB(~0)
828
829
830 #define S626_SET_STD_INTSRC(x) \
831 S626_MAKE((x), S626_STDWID_INTSRC, S626_STDBIT_INTSRC)
832 #define S626_SET_STD_LATCHSRC(x) \
833 S626_MAKE((x), S626_STDWID_LATCHSRC, S626_STDBIT_LATCHSRC)
834 #define S626_SET_STD_LOADSRC(x) \
835 S626_MAKE((x), S626_STDWID_LOADSRC, S626_STDBIT_LOADSRC)
836 #define S626_SET_STD_INDXSRC(x) \
837 S626_MAKE((x), S626_STDWID_INDXSRC, S626_STDBIT_INDXSRC)
838 #define S626_SET_STD_INDXPOL(x) \
839 S626_MAKE((x), S626_STDWID_INDXPOL, S626_STDBIT_INDXPOL)
840 #define S626_SET_STD_ENCMODE(x) \
841 S626_MAKE((x), S626_STDWID_ENCMODE, S626_STDBIT_ENCMODE)
842 #define S626_SET_STD_CLKPOL(x) \
843 S626_MAKE((x), S626_STDWID_CLKPOL, S626_STDBIT_CLKPOL)
844 #define S626_SET_STD_CLKMULT(x) \
845 S626_MAKE((x), S626_STDWID_CLKMULT, S626_STDBIT_CLKMULT)
846 #define S626_SET_STD_CLKENAB(x) \
847 S626_MAKE((x), S626_STDWID_CLKENAB, S626_STDBIT_CLKENAB)
848
849
850 #define S626_GET_STD_INTSRC(v) \
851 S626_UNMAKE((v), S626_STDWID_INTSRC, S626_STDBIT_INTSRC)
852 #define S626_GET_STD_LATCHSRC(v) \
853 S626_UNMAKE((v), S626_STDWID_LATCHSRC, S626_STDBIT_LATCHSRC)
854 #define S626_GET_STD_LOADSRC(v) \
855 S626_UNMAKE((v), S626_STDWID_LOADSRC, S626_STDBIT_LOADSRC)
856 #define S626_GET_STD_INDXSRC(v) \
857 S626_UNMAKE((v), S626_STDWID_INDXSRC, S626_STDBIT_INDXSRC)
858 #define S626_GET_STD_INDXPOL(v) \
859 S626_UNMAKE((v), S626_STDWID_INDXPOL, S626_STDBIT_INDXPOL)
860 #define S626_GET_STD_ENCMODE(v) \
861 S626_UNMAKE((v), S626_STDWID_ENCMODE, S626_STDBIT_ENCMODE)
862 #define S626_GET_STD_CLKPOL(v) \
863 S626_UNMAKE((v), S626_STDWID_CLKPOL, S626_STDBIT_CLKPOL)
864 #define S626_GET_STD_CLKMULT(v) \
865 S626_UNMAKE((v), S626_STDWID_CLKMULT, S626_STDBIT_CLKMULT)
866 #define S626_GET_STD_CLKENAB(v) \
867 S626_UNMAKE((v), S626_STDWID_CLKENAB, S626_STDBIT_CLKENAB)
868
869 #endif