1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 #ifndef _ECHO_DSP_
32 #define _ECHO_DSP_
33
34
35
36 #if defined(ECHOGALS_FAMILY)
37
38 #define NUM_ASIC_TESTS 5
39 #define READ_DSP_TIMEOUT 1000000L
40
41
42 #elif defined(ECHO24_FAMILY)
43
44 #define DSP_56361
45 #define READ_DSP_TIMEOUT 100000L
46
47
48 #elif defined(ECHO3G_FAMILY)
49
50 #define DSP_56361
51 #define READ_DSP_TIMEOUT 100000L
52 #define MIN_MTC_1X_RATE 32000
53
54
55 #elif defined(INDIGO_FAMILY)
56
57 #define DSP_56361
58 #define READ_DSP_TIMEOUT 100000L
59
60 #else
61
62 #error No family is defined
63
64 #endif
65
66
67
68
69
70
71
72
73
74 #define DSP_MAXAUDIOINPUTS 16
75 #define DSP_MAXAUDIOOUTPUTS 16
76 #define DSP_MAXPIPES 32
77
78
79
80
81
82
83
84
85 #define CHI32_CONTROL_REG 4
86 #define CHI32_STATUS_REG 5
87 #define CHI32_VECTOR_REG 6
88 #define CHI32_DATA_REG 7
89
90
91
92
93
94
95
96
97 #define CHI32_VECTOR_BUSY 0x00000001
98 #define CHI32_STATUS_REG_HF3 0x00000008
99 #define CHI32_STATUS_REG_HF4 0x00000010
100 #define CHI32_STATUS_REG_HF5 0x00000020
101 #define CHI32_STATUS_HOST_READ_FULL 0x00000004
102 #define CHI32_STATUS_HOST_WRITE_EMPTY 0x00000002
103 #define CHI32_STATUS_IRQ 0x00000040
104
105
106
107
108
109
110
111
112 #define DSP_FNC_SET_COMMPAGE_ADDR 0x02
113 #define DSP_FNC_LOAD_LAYLA_ASIC 0xa0
114 #define DSP_FNC_LOAD_GINA24_ASIC 0xa0
115 #define DSP_FNC_LOAD_MONA_PCI_CARD_ASIC 0xa0
116 #define DSP_FNC_LOAD_LAYLA24_PCI_CARD_ASIC 0xa0
117 #define DSP_FNC_LOAD_MONA_EXTERNAL_ASIC 0xa1
118 #define DSP_FNC_LOAD_LAYLA24_EXTERNAL_ASIC 0xa1
119 #define DSP_FNC_LOAD_3G_ASIC 0xa0
120
121
122
123
124
125
126
127
128
129 #define MIDI_IN_STATE_NORMAL 0
130 #define MIDI_IN_STATE_TS_HIGH 1
131 #define MIDI_IN_STATE_TS_LOW 2
132 #define MIDI_IN_STATE_F1_DATA 3
133 #define MIDI_IN_SKIP_DATA (-1)
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 #define LAYLA24_MAGIC_NUMBER 677376000
178 #define LAYLA24_CONTINUOUS_CLOCK 0x000e
179
180
181
182
183
184
185
186
187 #define DSP_VC_RESET 0x80ff
188
189 #ifndef DSP_56361
190
191 #define DSP_VC_ACK_INT 0x8073
192 #define DSP_VC_SET_VMIXER_GAIN 0x0000
193 #define DSP_VC_START_TRANSFER 0x0075
194 #define DSP_VC_METERS_ON 0x0079
195 #define DSP_VC_METERS_OFF 0x007b
196 #define DSP_VC_UPDATE_OUTVOL 0x007d
197 #define DSP_VC_UPDATE_INGAIN 0x007f
198 #define DSP_VC_ADD_AUDIO_BUFFER 0x0081
199 #define DSP_VC_TEST_ASIC 0x00eb
200 #define DSP_VC_UPDATE_CLOCKS 0x00ef
201 #define DSP_VC_SET_LAYLA_SAMPLE_RATE 0x00f1
202 #define DSP_VC_SET_GD_AUDIO_STATE 0x00f1
203 #define DSP_VC_WRITE_CONTROL_REG 0x00f1
204 #define DSP_VC_MIDI_WRITE 0x00f5
205 #define DSP_VC_STOP_TRANSFER 0x00f7
206 #define DSP_VC_UPDATE_FLAGS 0x00fd
207 #define DSP_VC_GO_COMATOSE 0x00f9
208
209 #else
210
211
212 #define DSP_VC_ACK_INT 0x80F5
213 #define DSP_VC_SET_VMIXER_GAIN 0x00DB
214 #define DSP_VC_START_TRANSFER 0x00DD
215 #define DSP_VC_METERS_ON 0x00EF
216 #define DSP_VC_METERS_OFF 0x00F1
217 #define DSP_VC_UPDATE_OUTVOL 0x00E3
218 #define DSP_VC_UPDATE_INGAIN 0x00E5
219 #define DSP_VC_ADD_AUDIO_BUFFER 0x00E1
220 #define DSP_VC_TEST_ASIC 0x00ED
221 #define DSP_VC_UPDATE_CLOCKS 0x00E9
222 #define DSP_VC_SET_LAYLA24_FREQUENCY_REG 0x00E9
223 #define DSP_VC_SET_LAYLA_SAMPLE_RATE 0x00EB
224 #define DSP_VC_SET_GD_AUDIO_STATE 0x00EB
225 #define DSP_VC_WRITE_CONTROL_REG 0x00EB
226 #define DSP_VC_MIDI_WRITE 0x00E7
227 #define DSP_VC_STOP_TRANSFER 0x00DF
228 #define DSP_VC_UPDATE_FLAGS 0x00FB
229 #define DSP_VC_GO_COMATOSE 0x00d9
230
231 #endif
232
233
234
235
236
237
238
239
240 #define HANDSHAKE_TIMEOUT 20000
241 #define VECTOR_BUSY_TIMEOUT 100000
242 #define MIDI_OUT_DELAY_USEC 2000
243
244
245
246
247
248
249
250
251 #define DSP_FLAG_MIDI_INPUT 0x0001
252 #define DSP_FLAG_SPDIF_NONAUDIO 0x0002
253
254
255
256
257
258 #define DSP_FLAG_PROFESSIONAL_SPDIF 0x0008
259
260
261
262
263
264
265
266
267 #define GLDM_CLOCK_DETECT_BIT_WORD 0x0002
268 #define GLDM_CLOCK_DETECT_BIT_SUPER 0x0004
269 #define GLDM_CLOCK_DETECT_BIT_SPDIF 0x0008
270 #define GLDM_CLOCK_DETECT_BIT_ESYNC 0x0010
271
272
273
274
275
276
277
278
279 #define GML_CLOCK_DETECT_BIT_WORD96 0x0002
280 #define GML_CLOCK_DETECT_BIT_WORD48 0x0004
281 #define GML_CLOCK_DETECT_BIT_SPDIF48 0x0008
282 #define GML_CLOCK_DETECT_BIT_SPDIF96 0x0010
283 #define GML_CLOCK_DETECT_BIT_WORD (GML_CLOCK_DETECT_BIT_WORD96 | GML_CLOCK_DETECT_BIT_WORD48)
284 #define GML_CLOCK_DETECT_BIT_SPDIF (GML_CLOCK_DETECT_BIT_SPDIF48 | GML_CLOCK_DETECT_BIT_SPDIF96)
285 #define GML_CLOCK_DETECT_BIT_ESYNC 0x0020
286 #define GML_CLOCK_DETECT_BIT_ADAT 0x0040
287
288
289
290
291
292
293
294
295 #define LAYLA20_CLOCK_INTERNAL 0
296 #define LAYLA20_CLOCK_SPDIF 1
297 #define LAYLA20_CLOCK_WORD 2
298 #define LAYLA20_CLOCK_SUPER 3
299
300
301
302
303
304
305
306
307 #define GD_CLOCK_NOCHANGE 0
308 #define GD_CLOCK_44 1
309 #define GD_CLOCK_48 2
310 #define GD_CLOCK_SPDIFIN 3
311 #define GD_CLOCK_UNDEF 0xff
312
313
314
315
316
317
318
319
320 #define GD_SPDIF_STATUS_NOCHANGE 0
321 #define GD_SPDIF_STATUS_44 1
322 #define GD_SPDIF_STATUS_48 2
323 #define GD_SPDIF_STATUS_UNDEF 0xff
324
325
326
327
328
329
330
331
332 #define LAYLA20_OUTPUT_CLOCK_SUPER 0
333 #define LAYLA20_OUTPUT_CLOCK_WORD 1
334
335
336
337
338
339
340
341
342 #define GD24_96000 0x0
343 #define GD24_48000 0x1
344 #define GD24_44100 0x2
345 #define GD24_32000 0x3
346 #define GD24_22050 0x4
347 #define GD24_16000 0x5
348 #define GD24_11025 0x6
349 #define GD24_8000 0x7
350 #define GD24_88200 0x8
351 #define GD24_EXT_SYNC 0x9
352
353
354
355
356
357
358
359
360 #define ASIC_ALREADY_LOADED 0x1
361 #define ASIC_NOT_LOADED 0x0
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419 #define DSP_AUDIOFORM_MS_8 0
420 #define DSP_AUDIOFORM_MS_16LE 1
421 #define DSP_AUDIOFORM_MS_24LE 2
422 #define DSP_AUDIOFORM_MS_32LE 3
423 #define DSP_AUDIOFORM_SS_8 4
424 #define DSP_AUDIOFORM_SS_16LE 5
425 #define DSP_AUDIOFORM_SS_24LE 6
426 #define DSP_AUDIOFORM_SS_32LE 7
427 #define DSP_AUDIOFORM_MM_32LE 8
428 #define DSP_AUDIOFORM_MM_32BE 9
429 #define DSP_AUDIOFORM_SS_32BE 10
430 #define DSP_AUDIOFORM_INVALID 0xFF
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448 #define DSP_AUDIOFORM_SUPER_INTERLEAVE_16LE 0x40
449 #define DSP_AUDIOFORM_SUPER_INTERLEAVE_24LE 0xc0
450 #define DSP_AUDIOFORM_SUPER_INTERLEAVE_32LE 0x80
451
452
453
454
455
456
457
458
459 #define GML_CONVERTER_ENABLE 0x0010
460 #define GML_SPDIF_PRO_MODE 0x0020
461
462 #define GML_SPDIF_SAMPLE_RATE0 0x0040
463 #define GML_SPDIF_SAMPLE_RATE1 0x0080
464 #define GML_SPDIF_TWO_CHANNEL 0x0100
465
466 #define GML_SPDIF_NOT_AUDIO 0x0200
467 #define GML_SPDIF_COPY_PERMIT 0x0400
468 #define GML_SPDIF_24_BIT 0x0800
469 #define GML_ADAT_MODE 0x1000
470 #define GML_SPDIF_OPTICAL_MODE 0x2000
471 #define GML_SPDIF_CDROM_MODE 0x3000
472
473 #define GML_DOUBLE_SPEED_MODE 0x4000
474
475
476 #define GML_DIGITAL_IN_AUTO_MUTE 0x800000
477
478 #define GML_96KHZ (0x0 | GML_DOUBLE_SPEED_MODE)
479 #define GML_88KHZ (0x1 | GML_DOUBLE_SPEED_MODE)
480 #define GML_48KHZ 0x2
481 #define GML_44KHZ 0x3
482 #define GML_32KHZ 0x4
483 #define GML_22KHZ 0x5
484 #define GML_16KHZ 0x6
485 #define GML_11KHZ 0x7
486 #define GML_8KHZ 0x8
487 #define GML_SPDIF_CLOCK 0x9
488 #define GML_ADAT_CLOCK 0xA
489 #define GML_WORD_CLOCK 0xB
490 #define GML_ESYNC_CLOCK 0xC
491 #define GML_ESYNCx2_CLOCK 0xD
492
493 #define GML_CLOCK_CLEAR_MASK 0xffffbff0
494 #define GML_SPDIF_RATE_CLEAR_MASK (~(GML_SPDIF_SAMPLE_RATE0|GML_SPDIF_SAMPLE_RATE1))
495 #define GML_DIGITAL_MODE_CLEAR_MASK 0xffffcfff
496 #define GML_SPDIF_FORMAT_CLEAR_MASK 0xfffff01f
497
498
499
500
501
502
503
504
505 #define MIA_32000 0x0040
506 #define MIA_44100 0x0042
507 #define MIA_48000 0x0041
508 #define MIA_88200 0x0142
509 #define MIA_96000 0x0141
510
511 #define MIA_SPDIF 0x00000044
512 #define MIA_SPDIF96 0x00000144
513
514 #define MIA_MIDI_REV 1
515
516
517
518
519
520
521
522
523 #define E3G_CONVERTER_ENABLE 0x0010
524 #define E3G_SPDIF_PRO_MODE 0x0020
525
526 #define E3G_SPDIF_SAMPLE_RATE0 0x0040
527 #define E3G_SPDIF_SAMPLE_RATE1 0x0080
528 #define E3G_SPDIF_TWO_CHANNEL 0x0100
529
530 #define E3G_SPDIF_NOT_AUDIO 0x0200
531 #define E3G_SPDIF_COPY_PERMIT 0x0400
532 #define E3G_SPDIF_24_BIT 0x0800
533 #define E3G_DOUBLE_SPEED_MODE 0x4000
534
535 #define E3G_PHANTOM_POWER 0x8000
536
537
538 #define E3G_96KHZ (0x0 | E3G_DOUBLE_SPEED_MODE)
539 #define E3G_88KHZ (0x1 | E3G_DOUBLE_SPEED_MODE)
540 #define E3G_48KHZ 0x2
541 #define E3G_44KHZ 0x3
542 #define E3G_32KHZ 0x4
543 #define E3G_22KHZ 0x5
544 #define E3G_16KHZ 0x6
545 #define E3G_11KHZ 0x7
546 #define E3G_8KHZ 0x8
547 #define E3G_SPDIF_CLOCK 0x9
548 #define E3G_ADAT_CLOCK 0xA
549 #define E3G_WORD_CLOCK 0xB
550 #define E3G_CONTINUOUS_CLOCK 0xE
551
552 #define E3G_ADAT_MODE 0x1000
553 #define E3G_SPDIF_OPTICAL_MODE 0x2000
554
555 #define E3G_CLOCK_CLEAR_MASK 0xbfffbff0
556 #define E3G_DIGITAL_MODE_CLEAR_MASK 0xffffcfff
557 #define E3G_SPDIF_FORMAT_CLEAR_MASK 0xfffff01f
558
559
560 #define E3G_CLOCK_DETECT_BIT_WORD96 0x0001
561 #define E3G_CLOCK_DETECT_BIT_WORD48 0x0002
562 #define E3G_CLOCK_DETECT_BIT_SPDIF48 0x0004
563 #define E3G_CLOCK_DETECT_BIT_ADAT 0x0004
564 #define E3G_CLOCK_DETECT_BIT_SPDIF96 0x0008
565 #define E3G_CLOCK_DETECT_BIT_WORD (E3G_CLOCK_DETECT_BIT_WORD96|E3G_CLOCK_DETECT_BIT_WORD48)
566 #define E3G_CLOCK_DETECT_BIT_SPDIF (E3G_CLOCK_DETECT_BIT_SPDIF48|E3G_CLOCK_DETECT_BIT_SPDIF96)
567
568
569 #define E3G_MAGIC_NUMBER 677376000
570 #define E3G_FREQ_REG_DEFAULT (E3G_MAGIC_NUMBER / 48000 - 2)
571 #define E3G_FREQ_REG_MAX 0xffff
572
573
574 #define E3G_GINA3G_BOX_TYPE 0x00
575 #define E3G_LAYLA3G_BOX_TYPE 0x10
576 #define E3G_ASIC_NOT_LOADED 0xffff
577 #define E3G_BOX_TYPE_MASK 0xf0
578
579
580 #define INDIGO_EXPRESS_32000 0x02
581 #define INDIGO_EXPRESS_44100 0x01
582 #define INDIGO_EXPRESS_48000 0x00
583 #define INDIGO_EXPRESS_DOUBLE_SPEED 0x10
584 #define INDIGO_EXPRESS_QUAD_SPEED 0x04
585 #define INDIGO_EXPRESS_CLOCK_MASK 0x17
586
587
588
589
590
591
592
593
594
595 #define GL20_INPUT_GAIN_MAGIC_NUMBER 0xC8
596
597
598
599
600
601
602
603
604 #define DSP_LOAD_ATTEMPT_PERIOD 1000000L
605
606
607
608
609
610
611
612
613
614
615 #define MONITOR_ARRAY_SIZE 0x180
616 #define VMIXER_ARRAY_SIZE 0x40
617 #define MIDI_OUT_BUFFER_SIZE 32
618 #define MIDI_IN_BUFFER_SIZE 256
619 #define MAX_PLAY_TAPS 168
620 #define MAX_REC_TAPS 192
621 #define DSP_MIDI_OUT_FIFO_SIZE 64
622
623
624
625
626
627 #define MAX_SGLIST_ENTRIES 512
628
629 struct sg_entry {
630 __le32 addr;
631 __le32 size;
632 };
633
634
635
636
637
638
639
640
641
642
643
644
645 struct comm_page {
646 __le32 comm_size;
647 __le32 flags;
648 __le32 unused;
649 __le32 sample_rate;
650 __le32 handshake;
651 __le32 cmd_start;
652 __le32 cmd_stop;
653 __le32 cmd_reset;
654 __le16 audio_format[DSP_MAXPIPES];
655 struct sg_entry sglist_addr[DSP_MAXPIPES];
656
657 __le32 position[DSP_MAXPIPES];
658
659 s8 vu_meter[DSP_MAXPIPES];
660
661 s8 peak_meter[DSP_MAXPIPES];
662
663 s8 line_out_level[DSP_MAXAUDIOOUTPUTS];
664
665 s8 line_in_level[DSP_MAXAUDIOINPUTS];
666
667 s8 monitors[MONITOR_ARRAY_SIZE];
668
669 __le32 play_coeff[MAX_PLAY_TAPS];
670
671 __le32 rec_coeff[MAX_REC_TAPS];
672
673 __le16 midi_input[MIDI_IN_BUFFER_SIZE];
674
675 u8 gd_clock_state;
676 u8 gd_spdif_status;
677 u8 gd_resampler_state;
678 u8 filler2;
679 __le32 nominal_level_mask;
680 __le16 input_clock;
681 __le16 output_clock;
682 __le32 status_clocks;
683 __le32 ext_box_status;
684 __le32 cmd_add_buffer;
685 __le32 midi_out_free_count;
686
687 __le32 unused2;
688 __le32 control_register;
689
690 __le32 e3g_frq_register;
691 u8 filler[24];
692 s8 vmixer[VMIXER_ARRAY_SIZE];
693
694 u8 midi_output[MIDI_OUT_BUFFER_SIZE];
695
696 };
697
698 #endif