[ACPI] linux-acpi@vger.kernel.org replaces acpi-devel@lists.sourceforge.net
[firewire-audio.git] / include / sound / cs46xx_dsp_scb_types.h
blob3f990a3a6903addc7b431a25a0adbf4ab1779f86
1 /*
2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * NOTE: comments are copy/paste from cwcemb80.lst
22 * provided by Tom Woller at Cirrus (my only
23 * documentation about the SP OS running inside
24 * the DSP)
27 #ifndef __CS46XX_DSP_SCB_TYPES_H__
28 #define __CS46XX_DSP_SCB_TYPES_H__
30 #include <asm/byteorder.h>
32 #ifndef ___DSP_DUAL_16BIT_ALLOC
33 #if defined(__LITTLE_ENDIAN)
34 #define ___DSP_DUAL_16BIT_ALLOC(a,b) u16 a; u16 b;
35 #elif defined(__BIG_ENDIAN)
36 #define ___DSP_DUAL_16BIT_ALLOC(a,b) u16 b; u16 a;
37 #else
38 #error Not __LITTLE_ENDIAN and not __BIG_ENDIAN, then what ???
39 #endif
40 #endif
42 /* This structs are used internally by the SP */
44 typedef struct _basic_dma_req_t {
45 /* DMA Requestor Word 0 (DCW) fields:
47 31 [30-28]27 [26:24] 23 22 21 20 [19:18] [17:16] 15 14 13 12 11 10 9 8 7 6 [5:0]
48 _______________________________________________________________________________________
49 |S| SBT |D| DBT |wb|wb| | | LS | SS |Opt|Do|SSG|DSG| | | | | | | Dword |
50 |H|_____ |H|_________|S_|D |__|__|______|_______|___|ne|__ |__ |__|__|_|_|_|_|_Count -1|
52 u32 dcw; /* DMA Control Word */
53 u32 dmw; /* DMA Mode Word */
54 u32 saw; /* Source Address Word */
55 u32 daw; /* Destination Address Word */
56 } basic_dma_req_t;
58 typedef struct _scatter_gather_ext_t {
59 u32 npaw; /* Next-Page Address Word */
61 /* DMA Requestor Word 5 (NPCW) fields:
63 31-30 29 28 [27:16] [15:12] [11:3] [2:0]
64 _________________________________________________________________________________________
65 |SV |LE|SE| Sample-end byte offset | | Page-map entry offset for next | |
66 |page|__|__| ___________________________|_________|__page, if !sample-end___________|____|
68 u32 npcw; /* Next-Page Control Word */
69 u32 lbaw; /* Loop-Begin Address Word */
70 u32 nplbaw; /* Next-Page after Loop-Begin Address Word */
71 u32 sgaw; /* Scatter/Gather Address Word */
72 } scatter_gather_ext_t;
74 typedef struct _volume_control_t {
75 ___DSP_DUAL_16BIT_ALLOC(
76 rightTarg, /* Target volume for left & right channels */
77 leftTarg
79 ___DSP_DUAL_16BIT_ALLOC(
80 rightVol, /* Current left & right channel volumes */
81 leftVol
83 } volume_control_t;
85 /* Generic stream control block (SCB) structure definition */
86 typedef struct _generic_scb_t {
87 /* For streaming I/O, the DSP should never alter any words in the DMA
88 requestor or the scatter/gather extension. Only ad hoc DMA request
89 streams are free to alter the requestor (currently only occur in the
90 DOS-based MIDI controller and in debugger-inserted code).
92 If an SCB does not have any associated DMA requestor, these 9 ints
93 may be freed for use by other tasks, but the pointer to the SCB must
94 still be such that the insOrd:nextSCB appear at offset 9 from the
95 SCB pointer.
97 Basic (non scatter/gather) DMA requestor (4 ints)
100 /* Initialized by the host, only modified by DMA
101 R/O for the DSP task */
102 basic_dma_req_t basic_req; /* Optional */
104 /* Scatter/gather DMA requestor extension (5 ints)
105 Initialized by the host, only modified by DMA
106 DSP task never needs to even read these.
108 scatter_gather_ext_t sg_ext; /* Optional */
110 /* Sublist pointer & next stream control block (SCB) link.
111 Initialized & modified by the host R/O for the DSP task
113 ___DSP_DUAL_16BIT_ALLOC(
114 next_scb, /* REQUIRED */
115 sub_list_ptr /* REQUIRED */
118 /* Pointer to this tasks parameter block & stream function pointer
119 Initialized by the host R/O for the DSP task */
120 ___DSP_DUAL_16BIT_ALLOC(
121 entry_point, /* REQUIRED */
122 this_spb /* REQUIRED */
125 /* rsConfig register for stream buffer (rsDMA reg.
126 is loaded from basicReq.daw for incoming streams, or
127 basicReq.saw, for outgoing streams)
129 31 30 29 [28:24] [23:16] 15 14 13 12 11 10 9 8 7 6 5 4 [3:0]
130 ______________________________________________________________________________
131 |DMA |D|maxDMAsize| streamNum|dir|p| | | | | | |ds |shr 1|rev Cy | mod |
132 |prio |_|__________|__________|___|_|__|__|__|__|_|_|___|_____|_______|_______|
133 31 30 29 [28:24] [23:16] 15 14 13 12 11 10 9 8 7 6 5 4 [3:0]
136 Initialized by the host R/O for the DSP task
138 u32 strm_rs_config; /* REQUIRED */
140 /* On mixer input streams: indicates mixer input stream configuration
141 On Tees, this is copied from the stream being snooped
143 Stream sample pointer & MAC-unit mode for this stream
145 Initialized by the host Updated by the DSP task
147 u32 strm_buf_ptr; /* REQUIRED */
149 /* On mixer input streams: points to next mixer input and is updated by the
150 mixer subroutine in the "parent" DSP task
151 (least-significant 16 bits are preserved, unused)
153 On Tees, the pointer is copied from the stream being snooped on
154 initialization, and, subsequently, it is copied into the
155 stream being snooped.
157 On wavetable/3D voices: the strmBufPtr will use all 32 bits to allow for
158 fractional phase accumulation
160 Fractional increment per output sample in the input sample buffer
162 (Not used on mixer input streams & redefined on Tees)
163 On wavetable/3D voices: this 32-bit word specifies the integer.fractional
164 increment per output sample.
166 u32 strmPhiIncr;
169 /* Standard stereo volume control
170 Initialized by the host (host updates target volumes)
172 Current volumes update by the DSP task
173 On mixer input streams: required & updated by the mixer subroutine in the
174 "parent" DSP task
176 On Tees, both current & target volumes are copied up on initialization,
177 and, subsequently, the target volume is copied up while the current
178 volume is copied down.
180 These two 32-bit words are redefined for wavetable & 3-D voices.
182 volume_control_t vol_ctrl_t; /* Optional */
183 } generic_scb_t;
186 typedef struct _spos_control_block_t {
187 /* WARNING: Certain items in this structure are modified by the host
188 Any dword that can be modified by the host, must not be
189 modified by the SP as the host can only do atomic dword
190 writes, and to do otherwise, even a read modify write,
191 may lead to corrupted data on the SP.
193 This rule does not apply to one off boot time initialisation prior to starting the SP
197 ___DSP_DUAL_16BIT_ALLOC(
198 /* First element on the Hyper forground task tree */
199 hfg_tree_root_ptr, /* HOST */
200 /* First 3 dwords are written by the host and read-only on the DSP */
201 hfg_stack_base /* HOST */
204 ___DSP_DUAL_16BIT_ALLOC(
205 /* Point to this data structure to enable easy access */
206 spos_cb_ptr, /* SP */
207 prev_task_tree_ptr /* SP && HOST */
210 ___DSP_DUAL_16BIT_ALLOC(
211 /* Currently Unused */
212 xxinterval_timer_period,
213 /* Enable extension of SPOS data structure */
214 HFGSPB_ptr
218 ___DSP_DUAL_16BIT_ALLOC(
219 xxnum_HFG_ticks_thisInterval,
220 /* Modified by the DSP */
221 xxnum_tntervals
225 /* Set by DSP upon encountering a trap (breakpoint) or a spurious
226 interrupt. The host must clear this dword after reading it
227 upon receiving spInt1. */
228 ___DSP_DUAL_16BIT_ALLOC(
229 spurious_int_flag, /* (Host & SP) Nature of the spurious interrupt */
230 trap_flag /* (Host & SP) Nature of detected Trap */
233 ___DSP_DUAL_16BIT_ALLOC(
234 unused2,
235 invalid_IP_flag /* (Host & SP ) Indicate detection of invalid instruction pointer */
238 ___DSP_DUAL_16BIT_ALLOC(
239 /* pointer to forground task tree header for use in next task search */
240 fg_task_tree_hdr_ptr, /* HOST */
241 /* Data structure for controlling synchronous link update */
242 hfg_sync_update_ptr /* HOST */
245 ___DSP_DUAL_16BIT_ALLOC(
246 begin_foreground_FCNT, /* SP */
247 /* Place holder for holding sleep timing */
248 last_FCNT_before_sleep /* SP */
251 ___DSP_DUAL_16BIT_ALLOC(
252 unused7, /* SP */
253 next_task_treePtr /* SP */
256 u32 unused5;
258 ___DSP_DUAL_16BIT_ALLOC(
259 active_flags, /* SP */
260 /* State flags, used to assist control of execution of Hyper Forground */
261 HFG_flags /* SP */
264 ___DSP_DUAL_16BIT_ALLOC(
265 unused9,
266 unused8
269 /* Space for saving enough context so that we can set up enough
270 to save some more context.
272 u32 rFE_save_for_invalid_IP;
273 u32 r32_save_for_spurious_int;
274 u32 r32_save_for_trap;
275 u32 r32_save_for_HFG;
276 } spos_control_block_t;
278 /* SPB for MIX_TO_OSTREAM algorithm family */
279 typedef struct _mix2_ostream_spb_t
281 /* 16b.16b integer.frac approximation to the
282 number of 3 sample triplets to output each
283 frame. (approximation must be floor, to
284 insure that the fractional error is always
285 positive)
287 u32 outTripletsPerFrame;
289 /* 16b.16b integer.frac accumulated number of
290 output triplets since the start of group
292 u32 accumOutTriplets;
293 } mix2_ostream_spb_t;
295 /* SCB for Timing master algorithm */
296 typedef struct _timing_master_scb_t {
297 /* First 12 dwords from generic_scb_t */
298 basic_dma_req_t basic_req; /* Optional */
299 scatter_gather_ext_t sg_ext; /* Optional */
300 ___DSP_DUAL_16BIT_ALLOC(
301 next_scb, /* REQUIRED */
302 sub_list_ptr /* REQUIRED */
305 ___DSP_DUAL_16BIT_ALLOC(
306 entry_point, /* REQUIRED */
307 this_spb /* REQUIRED */
310 ___DSP_DUAL_16BIT_ALLOC(
311 /* Initial values are 0000:xxxx */
312 reserved,
313 extra_sample_accum
317 /* Initial values are xxxx:0000
318 hi: Current CODEC output FIFO pointer
319 (0 to 0x0f)
320 lo: Flag indicating that the CODEC
321 FIFO is sync'd (host clears to
322 resynchronize the FIFO pointer
323 upon start/restart)
325 ___DSP_DUAL_16BIT_ALLOC(
326 codec_FIFO_syncd,
327 codec_FIFO_ptr
330 /* Init. 8000:0005 for 44.1k
331 8000:0001 for 48k
332 hi: Fractional sample accumulator 0.16b
333 lo: Number of frames remaining to be
334 processed in the current group of
335 frames
337 ___DSP_DUAL_16BIT_ALLOC(
338 frac_samp_accum_qm1,
339 TM_frms_left_in_group
342 /* Init. 0001:0005 for 44.1k
343 0000:0001 for 48k
344 hi: Fractional sample correction factor 0.16b
345 to be added every frameGroupLength frames
346 to correct for truncation error in
347 nsamp_per_frm_q15
348 lo: Number of frames in the group
350 ___DSP_DUAL_16BIT_ALLOC(
351 frac_samp_correction_qm1,
352 TM_frm_group_length
355 /* Init. 44.1k*65536/8k = 0x00058333 for 44.1k
356 48k*65536/8k = 0x00060000 for 48k
357 16b.16b integer.frac approximation to the
358 number of samples to output each frame.
359 (approximation must be floor, to insure */
360 u32 nsamp_per_frm_q15;
361 } timing_master_scb_t;
363 /* SCB for CODEC output algorithm */
364 typedef struct _codec_output_scb_t {
365 /* First 13 dwords from generic_scb_t */
366 basic_dma_req_t basic_req; /* Optional */
367 scatter_gather_ext_t sg_ext; /* Optional */
368 ___DSP_DUAL_16BIT_ALLOC(
369 next_scb, /* REQUIRED */
370 sub_list_ptr /* REQUIRED */
373 ___DSP_DUAL_16BIT_ALLOC(
374 entry_point, /* REQUIRED */
375 this_spb /* REQUIRED */
378 u32 strm_rs_config; /* REQUIRED */
380 u32 strm_buf_ptr; /* REQUIRED */
382 /* NOTE: The CODEC output task reads samples from the first task on its
383 sublist at the stream buffer pointer (init. to lag DMA destination
384 address word). After the required number of samples is transferred,
385 the CODEC output task advances sub_list_ptr->strm_buf_ptr past the samples
386 consumed.
389 /* Init. 0000:0010 for SDout
390 0060:0010 for SDout2
391 0080:0010 for SDout3
392 hi: Base IO address of FIFO to which
393 the left-channel samples are to
394 be written.
395 lo: Displacement for the base IO
396 address for left-channel to obtain
397 the base IO address for the FIFO
398 to which the right-channel samples
399 are to be written.
401 ___DSP_DUAL_16BIT_ALLOC(
402 left_chan_base_IO_addr,
403 right_chan_IO_disp
407 /* Init: 0x0080:0004 for non-AC-97
408 Init: 0x0080:0000 for AC-97
409 hi: Exponential volume change rate
410 for input stream
411 lo: Positive shift count to shift the
412 16-bit input sample to obtain the
413 32-bit output word
415 ___DSP_DUAL_16BIT_ALLOC(
416 CO_scale_shift_count,
417 CO_exp_vol_change_rate
420 /* Pointer to SCB at end of input chain */
421 ___DSP_DUAL_16BIT_ALLOC(
422 reserved,
423 last_sub_ptr
425 } codec_output_scb_t;
427 /* SCB for CODEC input algorithm */
428 typedef struct _codec_input_scb_t {
429 /* First 13 dwords from generic_scb_t */
430 basic_dma_req_t basic_req; /* Optional */
431 scatter_gather_ext_t sg_ext; /* Optional */
432 ___DSP_DUAL_16BIT_ALLOC(
433 next_scb, /* REQUIRED */
434 sub_list_ptr /* REQUIRED */
437 ___DSP_DUAL_16BIT_ALLOC(
438 entry_point, /* REQUIRED */
439 this_spb /* REQUIRED */
442 u32 strm_rs_config; /* REQUIRED */
443 u32 strm_buf_ptr; /* REQUIRED */
445 /* NOTE: The CODEC input task reads samples from the hardware FIFO
446 sublist at the DMA source address word (sub_list_ptr->basic_req.saw).
447 After the required number of samples is transferred, the CODEC
448 output task advances sub_list_ptr->basic_req.saw past the samples
449 consumed. SPuD must initialize the sub_list_ptr->basic_req.saw
450 to point half-way around from the initial sub_list_ptr->strm_nuf_ptr
451 to allow for lag/lead.
454 /* Init. 0000:0010 for SDout
455 0060:0010 for SDout2
456 0080:0010 for SDout3
457 hi: Base IO address of FIFO to which
458 the left-channel samples are to
459 be written.
460 lo: Displacement for the base IO
461 address for left-channel to obtain
462 the base IO address for the FIFO
463 to which the right-channel samples
464 are to be written.
466 ___DSP_DUAL_16BIT_ALLOC(
467 rightChanINdisp,
468 left_chan_base_IN_addr
470 /* Init. ?:fffc
471 lo: Negative shift count to shift the
472 32-bit input dword to obtain the
473 16-bit sample msb-aligned (count
474 is negative to shift left)
476 ___DSP_DUAL_16BIT_ALLOC(
477 scaleShiftCount,
478 reserver1
481 u32 reserved2;
482 } codec_input_scb_t;
485 typedef struct _pcm_serial_input_scb_t {
486 /* First 13 dwords from generic_scb_t */
487 basic_dma_req_t basic_req; /* Optional */
488 scatter_gather_ext_t sg_ext; /* Optional */
489 ___DSP_DUAL_16BIT_ALLOC(
490 next_scb, /* REQUIRED */
491 sub_list_ptr /* REQUIRED */
494 ___DSP_DUAL_16BIT_ALLOC(
495 entry_point, /* REQUIRED */
496 this_spb /* REQUIRED */
499 u32 strm_buf_ptr; /* REQUIRED */
500 u32 strm_rs_config; /* REQUIRED */
502 /* Init. Ptr to CODEC input SCB
503 hi: Pointer to the SCB containing the
504 input buffer to which CODEC input
505 samples are written
506 lo: Flag indicating the link to the CODEC
507 input task is to be initialized
509 ___DSP_DUAL_16BIT_ALLOC(
510 init_codec_input_link,
511 codec_input_buf_scb
514 /* Initialized by the host (host updates target volumes) */
515 volume_control_t psi_vol_ctrl;
517 } pcm_serial_input_scb_t;
519 typedef struct _src_task_scb_t {
520 ___DSP_DUAL_16BIT_ALLOC(
521 frames_left_in_gof,
522 gofs_left_in_sec
525 ___DSP_DUAL_16BIT_ALLOC(
526 const2_thirds,
527 num_extra_tnput_samples
530 ___DSP_DUAL_16BIT_ALLOC(
531 cor_per_gof,
532 correction_per_sec
535 ___DSP_DUAL_16BIT_ALLOC(
536 output_buf_producer_ptr,
537 junk_DMA_MID
540 ___DSP_DUAL_16BIT_ALLOC(
541 gof_length,
542 gofs_per_sec
545 u32 input_buf_strm_config;
547 ___DSP_DUAL_16BIT_ALLOC(
548 reserved_for_SRC_use,
549 input_buf_consumer_ptr
552 u32 accum_phi;
554 ___DSP_DUAL_16BIT_ALLOC(
555 exp_src_vol_change_rate,
556 input_buf_producer_ptr
559 ___DSP_DUAL_16BIT_ALLOC(
560 src_next_scb,
561 src_sub_list_ptr
564 ___DSP_DUAL_16BIT_ALLOC(
565 src_entry_point,
566 src_this_sbp
569 u32 src_strm_rs_config;
570 u32 src_strm_buf_ptr;
572 u32 phiIncr6int_26frac;
574 volume_control_t src_vol_ctrl;
575 } src_task_scb_t;
577 typedef struct _decimate_by_pow2_scb_t {
578 /* decimationFactor = 2, 4, or 8 (larger factors waste too much memory
579 when compared to cascading decimators)
581 ___DSP_DUAL_16BIT_ALLOC(
582 dec2_coef_base_ptr,
583 dec2_coef_increment
586 /* coefIncrement = 128 / decimationFactor (for our ROM filter)
587 coefBasePtr = 0x8000 (for our ROM filter)
589 ___DSP_DUAL_16BIT_ALLOC(
590 dec2_in_samples_per_out_triplet,
591 dec2_extra_in_samples
593 /* extraInSamples: # of accumulated, unused input samples (init. to 0)
594 inSamplesPerOutTriplet = 3 * decimationFactor
597 ___DSP_DUAL_16BIT_ALLOC(
598 dec2_const2_thirds,
599 dec2_half_num_taps_mp5
601 /* halfNumTapsM5: (1/2 number of taps in decimation filter) minus 5
602 const2thirds: constant 2/3 in 16Q0 format (sign.15)
605 ___DSP_DUAL_16BIT_ALLOC(
606 dec2_output_buf_producer_ptr,
607 dec2_junkdma_mid
610 u32 dec2_reserved2;
612 u32 dec2_input_nuf_strm_config;
613 /* inputBufStrmConfig: rsConfig for the input buffer to the decimator
614 (buffer size = decimationFactor * 32 dwords)
617 ___DSP_DUAL_16BIT_ALLOC(
618 dec2_phi_incr,
619 dec2_input_buf_consumer_ptr
621 /* inputBufConsumerPtr: Input buffer read pointer (into SRC filter)
622 phiIncr = decimationFactor * 4
625 u32 dec2_reserved3;
627 ___DSP_DUAL_16BIT_ALLOC(
628 dec2_exp_vol_change_rate,
629 dec2_input_buf_producer_ptr
631 /* inputBufProducerPtr: Input buffer write pointer
632 expVolChangeRate: Exponential volume change rate for possible
633 future mixer on input streams
636 ___DSP_DUAL_16BIT_ALLOC(
637 dec2_next_scb,
638 dec2_sub_list_ptr
641 ___DSP_DUAL_16BIT_ALLOC(
642 dec2_entry_point,
643 dec2_this_spb
646 u32 dec2_strm_rs_config;
647 u32 dec2_strm_buf_ptr;
649 u32 dec2_reserved4;
651 volume_control_t dec2_vol_ctrl; /* Not used! */
652 } decimate_by_pow2_scb_t;
654 typedef struct _vari_decimate_scb_t {
655 ___DSP_DUAL_16BIT_ALLOC(
656 vdec_frames_left_in_gof,
657 vdec_gofs_left_in_sec
660 ___DSP_DUAL_16BIT_ALLOC(
661 vdec_const2_thirds,
662 vdec_extra_in_samples
664 /* extraInSamples: # of accumulated, unused input samples (init. to 0)
665 const2thirds: constant 2/3 in 16Q0 format (sign.15) */
667 ___DSP_DUAL_16BIT_ALLOC(
668 vdec_cor_per_gof,
669 vdec_correction_per_sec
672 ___DSP_DUAL_16BIT_ALLOC(
673 vdec_output_buf_producer_ptr,
674 vdec_input_buf_consumer_ptr
676 /* inputBufConsumerPtr: Input buffer read pointer (into SRC filter) */
677 ___DSP_DUAL_16BIT_ALLOC(
678 vdec_gof_length,
679 vdec_gofs_per_sec
682 u32 vdec_input_buf_strm_config;
683 /* inputBufStrmConfig: rsConfig for the input buffer to the decimator
684 (buffer size = 64 dwords) */
685 u32 vdec_coef_increment;
686 /* coefIncrement = - 128.0 / decimationFactor (as a 32Q15 number) */
688 u32 vdec_accumphi;
689 /* accumPhi: accumulated fractional phase increment (6.26) */
691 ___DSP_DUAL_16BIT_ALLOC(
692 vdec_exp_vol_change_rate,
693 vdec_input_buf_producer_ptr
695 /* inputBufProducerPtr: Input buffer write pointer
696 expVolChangeRate: Exponential volume change rate for possible
697 future mixer on input streams */
699 ___DSP_DUAL_16BIT_ALLOC(
700 vdec_next_scb,
701 vdec_sub_list_ptr
704 ___DSP_DUAL_16BIT_ALLOC(
705 vdec_entry_point,
706 vdec_this_spb
709 u32 vdec_strm_rs_config;
710 u32 vdec_strm_buf_ptr;
712 u32 vdec_phi_incr_6int_26frac;
714 volume_control_t vdec_vol_ctrl;
715 } vari_decimate_scb_t;
718 /* SCB for MIX_TO_OSTREAM algorithm family */
719 typedef struct _mix2_ostream_scb_t {
720 /* First 13 dwords from generic_scb_t */
721 basic_dma_req_t basic_req; /* Optional */
722 scatter_gather_ext_t sg_ext; /* Optional */
723 ___DSP_DUAL_16BIT_ALLOC(
724 next_scb, /* REQUIRED */
725 sub_list_ptr /* REQUIRED */
728 ___DSP_DUAL_16BIT_ALLOC(
729 entry_point, /* REQUIRED */
730 this_spb /* REQUIRED */
733 u32 strm_rs_config; /* REQUIRED */
734 u32 strm_buf_ptr; /* REQUIRED */
737 /* hi: Number of mixed-down input triplets
738 computed since start of group
739 lo: Number of frames remaining to be
740 processed in the current group of
741 frames
743 ___DSP_DUAL_16BIT_ALLOC(
744 frames_left_in_group,
745 accum_input_triplets
748 /* hi: Exponential volume change rate
749 for mixer on input streams
750 lo: Number of frames in the group
752 ___DSP_DUAL_16BIT_ALLOC(
753 frame_group_length,
754 exp_vol_change_rate
757 ___DSP_DUAL_16BIT_ALLOC(
758 const_FFFF,
759 const_zero
761 } mix2_ostream_scb_t;
764 /* SCB for S16_MIX algorithm */
765 typedef struct _mix_only_scb_t {
766 /* First 13 dwords from generic_scb_t */
767 basic_dma_req_t basic_req; /* Optional */
768 scatter_gather_ext_t sg_ext; /* Optional */
769 ___DSP_DUAL_16BIT_ALLOC(
770 next_scb, /* REQUIRED */
771 sub_list_ptr /* REQUIRED */
774 ___DSP_DUAL_16BIT_ALLOC(
775 entry_point, /* REQUIRED */
776 this_spb /* REQUIRED */
779 u32 strm_rs_config; /* REQUIRED */
780 u32 strm_buf_ptr; /* REQUIRED */
782 u32 reserved;
783 volume_control_t vol_ctrl;
784 } mix_only_scb_t;
786 /* SCB for the async. CODEC input algorithm */
787 typedef struct _async_codec_input_scb_t {
788 u32 io_free2;
790 u32 io_current_total;
791 u32 io_previous_total;
793 u16 io_count;
794 u16 io_count_limit;
796 u16 o_fifo_base_addr;
797 u16 ost_mo_format;
798 /* 1 = stereo; 0 = mono
799 xxx for ASER 1 (not allowed); 118 for ASER2 */
801 u32 ostrm_rs_config;
802 u32 ostrm_buf_ptr;
804 ___DSP_DUAL_16BIT_ALLOC(
805 io_sclks_per_lr_clk,
806 io_io_enable
809 u32 io_free4;
811 ___DSP_DUAL_16BIT_ALLOC(
812 io_next_scb,
813 io_sub_list_ptr
816 ___DSP_DUAL_16BIT_ALLOC(
817 io_entry_point,
818 io_this_spb
821 u32 istrm_rs_config;
822 u32 istrm_buf_ptr;
824 /* Init. 0000:8042: for ASER1
825 0000:8044: for ASER2 */
826 ___DSP_DUAL_16BIT_ALLOC(
827 io_stat_reg_addr,
828 iofifo_pointer
831 /* Init 1 stero:100 ASER1
832 Init 0 mono:110 ASER2
834 ___DSP_DUAL_16BIT_ALLOC(
835 ififo_base_addr,
836 ist_mo_format
839 u32 i_free;
840 } async_codec_input_scb_t;
843 /* SCB for the SP/DIF CODEC input and output */
844 typedef struct _spdifiscb_t {
845 ___DSP_DUAL_16BIT_ALLOC(
846 status_ptr,
847 status_start_ptr
850 u32 current_total;
851 u32 previous_total;
853 ___DSP_DUAL_16BIT_ALLOC(
854 count,
855 count_limit
858 u32 status_data;
860 ___DSP_DUAL_16BIT_ALLOC(
861 status,
862 free4
865 u32 free3;
867 ___DSP_DUAL_16BIT_ALLOC(
868 free2,
869 bit_count
872 u32 temp_status;
874 ___DSP_DUAL_16BIT_ALLOC(
875 next_SCB,
876 sub_list_ptr
879 ___DSP_DUAL_16BIT_ALLOC(
880 entry_point,
881 this_spb
884 u32 strm_rs_config;
885 u32 strm_buf_ptr;
887 ___DSP_DUAL_16BIT_ALLOC(
888 stat_reg_addr,
889 fifo_pointer
892 ___DSP_DUAL_16BIT_ALLOC(
893 fifo_base_addr,
894 st_mo_format
897 u32 free1;
898 } spdifiscb_t;
901 /* SCB for the SP/DIF CODEC input and output */
902 typedef struct _spdifoscb_t {
905 u32 free2;
907 u32 free3[4];
909 /* Need to be here for compatibility with AsynchFGTxCode */
910 u32 strm_rs_config;
912 u32 strm_buf_ptr;
914 ___DSP_DUAL_16BIT_ALLOC(
915 status,
916 free5
919 u32 free4;
921 ___DSP_DUAL_16BIT_ALLOC(
922 next_scb,
923 sub_list_ptr
926 ___DSP_DUAL_16BIT_ALLOC(
927 entry_point,
928 this_spb
931 u32 free6[2];
933 ___DSP_DUAL_16BIT_ALLOC(
934 stat_reg_addr,
935 fifo_pointer
938 ___DSP_DUAL_16BIT_ALLOC(
939 fifo_base_addr,
940 st_mo_format
943 u32 free1;
944 } spdifoscb_t;
948 typedef struct _asynch_fg_rx_scb_t {
949 ___DSP_DUAL_16BIT_ALLOC(
950 bot_buf_mask,
951 buf_Mask
954 ___DSP_DUAL_16BIT_ALLOC(
955 max,
959 ___DSP_DUAL_16BIT_ALLOC(
960 old_producer_pointer,
961 hfg_scb_ptr
964 ___DSP_DUAL_16BIT_ALLOC(
965 delta,
966 adjust_count
969 u32 unused2[5];
971 ___DSP_DUAL_16BIT_ALLOC(
972 sibling_ptr,
973 child_ptr
976 ___DSP_DUAL_16BIT_ALLOC(
977 code_ptr,
978 this_ptr
981 u32 strm_rs_config;
983 u32 strm_buf_ptr;
985 u32 unused_phi_incr;
987 ___DSP_DUAL_16BIT_ALLOC(
988 right_targ,
989 left_targ
992 ___DSP_DUAL_16BIT_ALLOC(
993 right_vol,
994 left_vol
996 } asynch_fg_rx_scb_t;
1000 typedef struct _asynch_fg_tx_scb_t {
1001 ___DSP_DUAL_16BIT_ALLOC(
1002 not_buf_mask,
1003 buf_mask
1006 ___DSP_DUAL_16BIT_ALLOC(
1007 max,
1011 ___DSP_DUAL_16BIT_ALLOC(
1012 unused1,
1013 hfg_scb_ptr
1016 ___DSP_DUAL_16BIT_ALLOC(
1017 delta,
1018 adjust_count
1021 u32 accum_phi;
1023 ___DSP_DUAL_16BIT_ALLOC(
1024 unused2,
1025 const_one_third
1028 u32 unused3[3];
1030 ___DSP_DUAL_16BIT_ALLOC(
1031 sibling_ptr,
1032 child_ptr
1035 ___DSP_DUAL_16BIT_ALLOC(
1036 codePtr,
1037 this_ptr
1040 u32 strm_rs_config;
1042 u32 strm_buf_ptr;
1044 u32 phi_incr;
1046 ___DSP_DUAL_16BIT_ALLOC(
1047 unused_right_targ,
1048 unused_left_targ
1051 ___DSP_DUAL_16BIT_ALLOC(
1052 unused_right_vol,
1053 unused_left_vol
1055 } asynch_fg_tx_scb_t;
1058 typedef struct _output_snoop_scb_t {
1059 /* First 13 dwords from generic_scb_t */
1060 basic_dma_req_t basic_req; /* Optional */
1061 scatter_gather_ext_t sg_ext; /* Optional */
1062 ___DSP_DUAL_16BIT_ALLOC(
1063 next_scb, /* REQUIRED */
1064 sub_list_ptr /* REQUIRED */
1067 ___DSP_DUAL_16BIT_ALLOC(
1068 entry_point, /* REQUIRED */
1069 this_spb /* REQUIRED */
1072 u32 strm_rs_config; /* REQUIRED */
1073 u32 strm_buf_ptr; /* REQUIRED */
1075 ___DSP_DUAL_16BIT_ALLOC(
1076 init_snoop_input_link,
1077 snoop_child_input_scb
1080 u32 snoop_input_buf_ptr;
1082 ___DSP_DUAL_16BIT_ALLOC(
1083 reserved,
1084 input_scb
1086 } output_snoop_scb_t;
1088 typedef struct _spio_write_scb_t {
1089 ___DSP_DUAL_16BIT_ALLOC(
1090 address1,
1091 address2
1094 u32 data1;
1096 u32 data2;
1098 ___DSP_DUAL_16BIT_ALLOC(
1099 address3,
1100 address4
1103 u32 data3;
1105 u32 data4;
1107 ___DSP_DUAL_16BIT_ALLOC(
1108 unused1,
1109 data_ptr
1112 u32 unused2[2];
1114 ___DSP_DUAL_16BIT_ALLOC(
1115 sibling_ptr,
1116 child_ptr
1119 ___DSP_DUAL_16BIT_ALLOC(
1120 entry_point,
1121 this_ptr
1124 u32 unused3[5];
1125 } spio_write_scb_t;
1127 typedef struct _magic_snoop_task_t {
1128 u32 i0;
1129 u32 i1;
1131 u32 strm_buf_ptr1;
1133 u16 i2;
1134 u16 snoop_scb;
1136 u32 i3;
1137 u32 i4;
1138 u32 i5;
1139 u32 i6;
1141 u32 i7;
1143 ___DSP_DUAL_16BIT_ALLOC(
1144 next_scb,
1145 sub_list_ptr
1148 ___DSP_DUAL_16BIT_ALLOC(
1149 entry_point,
1150 this_ptr
1153 u32 strm_buf_config;
1154 u32 strm_buf_ptr2;
1156 u32 i8;
1158 volume_control_t vdec_vol_ctrl;
1159 } magic_snoop_task_t;
1162 typedef struct _filter_scb_t {
1163 ___DSP_DUAL_16BIT_ALLOC(
1164 a0_right, /* 0x00 */
1165 a0_left
1167 ___DSP_DUAL_16BIT_ALLOC(
1168 a1_right, /* 0x01 */
1169 a1_left
1171 ___DSP_DUAL_16BIT_ALLOC(
1172 a2_right, /* 0x02 */
1173 a2_left
1175 ___DSP_DUAL_16BIT_ALLOC(
1176 output_buf_ptr, /* 0x03 */
1177 init
1180 ___DSP_DUAL_16BIT_ALLOC(
1181 filter_unused3, /* 0x04 */
1182 filter_unused2
1185 u32 prev_sample_output1; /* 0x05 */
1186 u32 prev_sample_output2; /* 0x06 */
1187 u32 prev_sample_input1; /* 0x07 */
1188 u32 prev_sample_input2; /* 0x08 */
1190 ___DSP_DUAL_16BIT_ALLOC(
1191 next_scb_ptr, /* 0x09 */
1192 sub_list_ptr
1195 ___DSP_DUAL_16BIT_ALLOC(
1196 entry_point, /* 0x0A */
1197 spb_ptr
1200 u32 strm_rs_config; /* 0x0B */
1201 u32 strm_buf_ptr; /* 0x0C */
1203 ___DSP_DUAL_16BIT_ALLOC(
1204 b0_right, /* 0x0D */
1205 b0_left
1207 ___DSP_DUAL_16BIT_ALLOC(
1208 b1_right, /* 0x0E */
1209 b1_left
1211 ___DSP_DUAL_16BIT_ALLOC(
1212 b2_right, /* 0x0F */
1213 b2_left
1215 } filter_scb_t;
1216 #endif /* __DSP_SCB_TYPES_H__ */