xref: /linux/sound/ppc/snd_ps3_reg.h (revision c454fd4e888dc2b1423b6a65106a619e99a2deb4)
1*c454fd4eSMasakazu Mokuno /*
2*c454fd4eSMasakazu Mokuno  * Audio support for PS3
3*c454fd4eSMasakazu Mokuno  * Copyright (C) 2007 Sony Computer Entertainment Inc.
4*c454fd4eSMasakazu Mokuno  * Copyright 2006, 2007 Sony Corporation
5*c454fd4eSMasakazu Mokuno  * All rights reserved.
6*c454fd4eSMasakazu Mokuno  *
7*c454fd4eSMasakazu Mokuno  * This program is free software; you can redistribute it and/or modify
8*c454fd4eSMasakazu Mokuno  * it under the terms of the GNU General Public License
9*c454fd4eSMasakazu Mokuno  * as published by the Free Software Foundation; version 2 of the License.
10*c454fd4eSMasakazu Mokuno  *
11*c454fd4eSMasakazu Mokuno  * This program is distributed in the hope that it will be useful,
12*c454fd4eSMasakazu Mokuno  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*c454fd4eSMasakazu Mokuno  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*c454fd4eSMasakazu Mokuno  * GNU General Public License for more details.
15*c454fd4eSMasakazu Mokuno  *
16*c454fd4eSMasakazu Mokuno  * You should have received a copy of the GNU General Public License
17*c454fd4eSMasakazu Mokuno  * along with this program; if not, write to the Free Software
18*c454fd4eSMasakazu Mokuno  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19*c454fd4eSMasakazu Mokuno  */
20*c454fd4eSMasakazu Mokuno 
21*c454fd4eSMasakazu Mokuno /*
22*c454fd4eSMasakazu Mokuno  * interrupt / configure registers
23*c454fd4eSMasakazu Mokuno  */
24*c454fd4eSMasakazu Mokuno 
25*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0                 (0x00000100)
26*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_EN_0              (0x00000140)
27*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_CONFIG                 (0x00000200)
28*c454fd4eSMasakazu Mokuno 
29*c454fd4eSMasakazu Mokuno /*
30*c454fd4eSMasakazu Mokuno  * DMAC registers
31*c454fd4eSMasakazu Mokuno  * n:0..9
32*c454fd4eSMasakazu Mokuno  */
33*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DMAC_REGBASE(x)         (0x0000210 + 0x20 * (x))
34*c454fd4eSMasakazu Mokuno 
35*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK(n)                 (PS3_AUDIO_DMAC_REGBASE(n) + 0x00)
36*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_SOURCE(n)               (PS3_AUDIO_DMAC_REGBASE(n) + 0x04)
37*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DEST(n)                 (PS3_AUDIO_DMAC_REGBASE(n) + 0x08)
38*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DMASIZE(n)              (PS3_AUDIO_DMAC_REGBASE(n) + 0x0C)
39*c454fd4eSMasakazu Mokuno 
40*c454fd4eSMasakazu Mokuno /*
41*c454fd4eSMasakazu Mokuno  * mute control
42*c454fd4eSMasakazu Mokuno  */
43*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL                (0x00004000)
44*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP                 (0x00004004)
45*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP                 (0x00004008)
46*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC                   (0x00004010)
47*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE                   (0x00004014)
48*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IS                   (0x00004018)
49*c454fd4eSMasakazu Mokuno 
50*c454fd4eSMasakazu Mokuno /*
51*c454fd4eSMasakazu Mokuno  * three wire serial
52*c454fd4eSMasakazu Mokuno  * n:0..3
53*c454fd4eSMasakazu Mokuno  */
54*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL                (0x00006000)
55*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL              (0x00006004)
56*c454fd4eSMasakazu Mokuno 
57*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL(n)            (0x00006200 + 0x200 * (n))
58*c454fd4eSMasakazu Mokuno 
59*c454fd4eSMasakazu Mokuno /*
60*c454fd4eSMasakazu Mokuno  * S/PDIF
61*c454fd4eSMasakazu Mokuno  * n:0..1
62*c454fd4eSMasakazu Mokuno  * x:0..11
63*c454fd4eSMasakazu Mokuno  * y:0..5
64*c454fd4eSMasakazu Mokuno  */
65*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPD_REGBASE(n)       (0x00007200 + 0x200 * (n))
66*c454fd4eSMasakazu Mokuno 
67*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL(n) \
68*c454fd4eSMasakazu Mokuno 	(PS3_AUDIO_AO_SPD_REGBASE(n) + 0x00)
69*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDUB(n, x) \
70*c454fd4eSMasakazu Mokuno 	(PS3_AUDIO_AO_SPD_REGBASE(n) + 0x04 + 0x04 * (x))
71*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCS(n, y) \
72*c454fd4eSMasakazu Mokuno 	(PS3_AUDIO_AO_SPD_REGBASE(n) + 0x34 + 0x04 * (y))
73*c454fd4eSMasakazu Mokuno 
74*c454fd4eSMasakazu Mokuno 
75*c454fd4eSMasakazu Mokuno /*
76*c454fd4eSMasakazu Mokuno   PS3_AUDIO_INTR_0 register tells an interrupt handler which audio
77*c454fd4eSMasakazu Mokuno   DMA channel triggered the interrupt.  The interrupt status for a channel
78*c454fd4eSMasakazu Mokuno   can be cleared by writing a '1' to the corresponding bit.  A new interrupt
79*c454fd4eSMasakazu Mokuno   cannot be generated until the previous interrupt has been cleared.
80*c454fd4eSMasakazu Mokuno 
81*c454fd4eSMasakazu Mokuno   Note that the status reported by PS3_AUDIO_INTR_0 is independent of the
82*c454fd4eSMasakazu Mokuno   value of PS3_AUDIO_INTR_EN_0.
83*c454fd4eSMasakazu Mokuno 
84*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
85*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
86*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_0
87*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
88*c454fd4eSMasakazu Mokuno */
89*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN(n)	(1 << ((n) * 2))
90*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN9     PS3_AUDIO_INTR_0_CHAN(9)
91*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN8     PS3_AUDIO_INTR_0_CHAN(8)
92*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN7     PS3_AUDIO_INTR_0_CHAN(7)
93*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN6     PS3_AUDIO_INTR_0_CHAN(6)
94*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN5     PS3_AUDIO_INTR_0_CHAN(5)
95*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN4     PS3_AUDIO_INTR_0_CHAN(4)
96*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN3     PS3_AUDIO_INTR_0_CHAN(3)
97*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN2     PS3_AUDIO_INTR_0_CHAN(2)
98*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN1     PS3_AUDIO_INTR_0_CHAN(1)
99*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_INTR_0_CHAN0     PS3_AUDIO_INTR_0_CHAN(0)
100*c454fd4eSMasakazu Mokuno 
101*c454fd4eSMasakazu Mokuno /*
102*c454fd4eSMasakazu Mokuno   The PS3_AUDIO_INTR_EN_0 register specifies which DMA channels can generate
103*c454fd4eSMasakazu Mokuno   an interrupt to the PU.  Each bit of PS3_AUDIO_INTR_EN_0 is ANDed with the
104*c454fd4eSMasakazu Mokuno   corresponding bit in PS3_AUDIO_INTR_0.  The resulting bits are OR'd together
105*c454fd4eSMasakazu Mokuno   to generate the Audio interrupt.
106*c454fd4eSMasakazu Mokuno 
107*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
108*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
109*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_EN_0
110*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
111*c454fd4eSMasakazu Mokuno 
112*c454fd4eSMasakazu Mokuno   Bit assignments are same as PS3_AUDIO_INTR_0
113*c454fd4eSMasakazu Mokuno */
114*c454fd4eSMasakazu Mokuno 
115*c454fd4eSMasakazu Mokuno /*
116*c454fd4eSMasakazu Mokuno   PS3_AUDIO_CONFIG
117*c454fd4eSMasakazu Mokuno   31            24 23           16 15            8 7             0
118*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
119*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 C|0 0 0 0 0 0 0 0| CONFIG
120*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
121*c454fd4eSMasakazu Mokuno 
122*c454fd4eSMasakazu Mokuno */
123*c454fd4eSMasakazu Mokuno 
124*c454fd4eSMasakazu Mokuno /* The CLEAR field cancels all pending transfers, and stops any running DMA
125*c454fd4eSMasakazu Mokuno    transfers.  Any interrupts associated with the canceled transfers
126*c454fd4eSMasakazu Mokuno    will occur as if the transfer had finished.
127*c454fd4eSMasakazu Mokuno    Since this bit is designed to recover from DMA related issues
128*c454fd4eSMasakazu Mokuno    which are caused by unpredictable situations, it is prefered to wait
129*c454fd4eSMasakazu Mokuno    for normal DMA transfer end without using this bit.
130*c454fd4eSMasakazu Mokuno */
131*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_CONFIG_CLEAR          (1 << 8)  /* RWIVF */
132*c454fd4eSMasakazu Mokuno 
133*c454fd4eSMasakazu Mokuno /*
134*c454fd4eSMasakazu Mokuno   PS3_AUDIO_AX_MCTRL: Audio Port Mute Control Register
135*c454fd4eSMasakazu Mokuno 
136*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
137*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
138*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|A|A|0 0 0 0 0 0 0|S|S|A|A|A|A| AX_MCTRL
139*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
140*c454fd4eSMasakazu Mokuno */
141*c454fd4eSMasakazu Mokuno 
142*c454fd4eSMasakazu Mokuno /* 3 Wire Audio Serial Output Channel Mutes (0..3)  */
143*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_ASOMT(n)     (1 << (3 - (n)))  /* RWIVF */
144*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_ASO3MT       (1 << 0)          /* RWIVF */
145*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_ASO2MT       (1 << 1)          /* RWIVF */
146*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_ASO1MT       (1 << 2)          /* RWIVF */
147*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_ASO0MT       (1 << 3)          /* RWIVF */
148*c454fd4eSMasakazu Mokuno 
149*c454fd4eSMasakazu Mokuno /* S/PDIF mutes (0,1)*/
150*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_SPOMT(n)     (1 << (5 - (n)))  /* RWIVF */
151*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_SPO1MT       (1 << 4)          /* RWIVF */
152*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_SPO0MT       (1 << 5)          /* RWIVF */
153*c454fd4eSMasakazu Mokuno 
154*c454fd4eSMasakazu Mokuno /* All 3 Wire Serial Outputs Mute */
155*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_AASOMT       (1 << 13)         /* RWIVF */
156*c454fd4eSMasakazu Mokuno 
157*c454fd4eSMasakazu Mokuno /* All S/PDIF Mute */
158*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_ASPOMT       (1 << 14)         /* RWIVF */
159*c454fd4eSMasakazu Mokuno 
160*c454fd4eSMasakazu Mokuno /* All Audio Outputs Mute */
161*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_MCTRL_AAOMT        (1 << 15)         /* RWIVF */
162*c454fd4eSMasakazu Mokuno 
163*c454fd4eSMasakazu Mokuno /*
164*c454fd4eSMasakazu Mokuno   S/PDIF Outputs Buffer Read/Write Pointer Register
165*c454fd4eSMasakazu Mokuno 
166*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
167*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
168*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B|0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B| AX_ISBP
169*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
170*c454fd4eSMasakazu Mokuno 
171*c454fd4eSMasakazu Mokuno */
172*c454fd4eSMasakazu Mokuno /*
173*c454fd4eSMasakazu Mokuno  S/PDIF Output Channel Read Buffer Numbers
174*c454fd4eSMasakazu Mokuno  Buffer number is  value of field.
175*c454fd4eSMasakazu Mokuno  Indicates current read access buffer ID from Audio Data
176*c454fd4eSMasakazu Mokuno  Transfer controller of S/PDIF Output
177*c454fd4eSMasakazu Mokuno */
178*c454fd4eSMasakazu Mokuno 
179*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP_SPOBRN_MASK(n) (0x7 << 4 * (1 - (n))) /* R-IUF */
180*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP_SPO1BRN_MASK		(0x7 << 0) /* R-IUF */
181*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP_SPO0BRN_MASK		(0x7 << 4) /* R-IUF */
182*c454fd4eSMasakazu Mokuno 
183*c454fd4eSMasakazu Mokuno /*
184*c454fd4eSMasakazu Mokuno S/PDIF Output Channel Buffer Write Numbers
185*c454fd4eSMasakazu Mokuno Indicates current write access buffer ID from bus master.
186*c454fd4eSMasakazu Mokuno */
187*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP_SPOBWN_MASK(n) (0x7 <<  4 * (5 - (n))) /* R-IUF */
188*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP_SPO1BWN_MASK		(0x7 << 16) /* R-IUF */
189*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_ISBP_SPO0BWN_MASK		(0x7 << 20) /* R-IUF */
190*c454fd4eSMasakazu Mokuno 
191*c454fd4eSMasakazu Mokuno /*
192*c454fd4eSMasakazu Mokuno   3 Wire Audio Serial Outputs Buffer Read/Write
193*c454fd4eSMasakazu Mokuno   Pointer Register
194*c454fd4eSMasakazu Mokuno   Buffer number is  value of field
195*c454fd4eSMasakazu Mokuno 
196*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
197*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
198*c454fd4eSMasakazu Mokuno  |0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B|0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B| AX_AOBP
199*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
200*c454fd4eSMasakazu Mokuno */
201*c454fd4eSMasakazu Mokuno 
202*c454fd4eSMasakazu Mokuno /*
203*c454fd4eSMasakazu Mokuno 3 Wire Audio Serial Output Channel Buffer Read Numbers
204*c454fd4eSMasakazu Mokuno Indicates current read access buffer Id from Audio Data Transfer
205*c454fd4eSMasakazu Mokuno Controller of 3 Wire Audio Serial Output Channels
206*c454fd4eSMasakazu Mokuno */
207*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASOBRN_MASK(n) (0x7 << 4 * (3 - (n))) /* R-IUF */
208*c454fd4eSMasakazu Mokuno 
209*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO3BRN_MASK	(0x7 << 0) /* R-IUF */
210*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO2BRN_MASK	(0x7 << 4) /* R-IUF */
211*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO1BRN_MASK	(0x7 << 8) /* R-IUF */
212*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO0BRN_MASK	(0x7 << 12) /* R-IUF */
213*c454fd4eSMasakazu Mokuno 
214*c454fd4eSMasakazu Mokuno /*
215*c454fd4eSMasakazu Mokuno 3 Wire Audio Serial Output Channel Buffer Write Numbers
216*c454fd4eSMasakazu Mokuno Indicates current write access buffer ID from bus master.
217*c454fd4eSMasakazu Mokuno */
218*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASOBWN_MASK(n) (0x7 << 4 * (7 - (n))) /* R-IUF */
219*c454fd4eSMasakazu Mokuno 
220*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO3BWN_MASK        (0x7 << 16) /* R-IUF */
221*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO2BWN_MASK        (0x7 << 20) /* R-IUF */
222*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO1BWN_MASK        (0x7 << 24) /* R-IUF */
223*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_AOBP_ASO0BWN_MASK        (0x7 << 28) /* R-IUF */
224*c454fd4eSMasakazu Mokuno 
225*c454fd4eSMasakazu Mokuno 
226*c454fd4eSMasakazu Mokuno 
227*c454fd4eSMasakazu Mokuno /*
228*c454fd4eSMasakazu Mokuno Audio Port Interrupt Condition Register
229*c454fd4eSMasakazu Mokuno For the fields in this register, the following values apply:
230*c454fd4eSMasakazu Mokuno 0 = Interrupt is generated every interrupt event.
231*c454fd4eSMasakazu Mokuno 1 = Interrupt is generated every 2 interrupt events.
232*c454fd4eSMasakazu Mokuno 2 = Interrupt is generated every 4 interrupt events.
233*c454fd4eSMasakazu Mokuno 3 = Reserved
234*c454fd4eSMasakazu Mokuno 
235*c454fd4eSMasakazu Mokuno 
236*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
237*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
238*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0|0 0|SPO|0 0|SPO|0 0|AAS|0 0 0 0 0 0 0 0 0 0 0 0| AX_IC
239*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
240*c454fd4eSMasakazu Mokuno */
241*c454fd4eSMasakazu Mokuno /*
242*c454fd4eSMasakazu Mokuno All 3-Wire Audio Serial Outputs Interrupt Mode
243*c454fd4eSMasakazu Mokuno Configures the Interrupt and Signal Notification
244*c454fd4eSMasakazu Mokuno condition of all 3-wire Audio Serial Outputs.
245*c454fd4eSMasakazu Mokuno */
246*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_AASOIMD_MASK          (0x3 << 12) /* RWIVF */
247*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_AASOIMD_EVERY1        (0x0 << 12) /* RWI-V */
248*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_AASOIMD_EVERY2        (0x1 << 12) /* RW--V */
249*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_AASOIMD_EVERY4        (0x2 << 12) /* RW--V */
250*c454fd4eSMasakazu Mokuno 
251*c454fd4eSMasakazu Mokuno /*
252*c454fd4eSMasakazu Mokuno S/PDIF Output Channel Interrupt Modes
253*c454fd4eSMasakazu Mokuno Configures the Interrupt and signal Notification
254*c454fd4eSMasakazu Mokuno conditions of S/PDIF output channels.
255*c454fd4eSMasakazu Mokuno */
256*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO1IMD_MASK          (0x3 << 16) /* RWIVF */
257*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO1IMD_EVERY1        (0x0 << 16) /* RWI-V */
258*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO1IMD_EVERY2        (0x1 << 16) /* RW--V */
259*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO1IMD_EVERY4        (0x2 << 16) /* RW--V */
260*c454fd4eSMasakazu Mokuno 
261*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO0IMD_MASK          (0x3 << 20) /* RWIVF */
262*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO0IMD_EVERY1        (0x0 << 20) /* RWI-V */
263*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO0IMD_EVERY2        (0x1 << 20) /* RW--V */
264*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IC_SPO0IMD_EVERY4        (0x2 << 20) /* RW--V */
265*c454fd4eSMasakazu Mokuno 
266*c454fd4eSMasakazu Mokuno /*
267*c454fd4eSMasakazu Mokuno Audio Port interrupt Enable Register
268*c454fd4eSMasakazu Mokuno Configures whether to enable or disable each Interrupt Generation.
269*c454fd4eSMasakazu Mokuno 
270*c454fd4eSMasakazu Mokuno 
271*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
272*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
273*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IE
274*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
275*c454fd4eSMasakazu Mokuno 
276*c454fd4eSMasakazu Mokuno */
277*c454fd4eSMasakazu Mokuno 
278*c454fd4eSMasakazu Mokuno /*
279*c454fd4eSMasakazu Mokuno 3 Wire Audio Serial Output Channel Buffer Underflow
280*c454fd4eSMasakazu Mokuno Interrupt Enables
281*c454fd4eSMasakazu Mokuno Select enable/disable of Buffer Underflow Interrupts for
282*c454fd4eSMasakazu Mokuno 3-Wire Audio Serial Output Channels
283*c454fd4eSMasakazu Mokuno DISABLED=Interrupt generation disabled.
284*c454fd4eSMasakazu Mokuno */
285*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASOBUIE(n)      (1 << (3 - (n))) /* RWIVF */
286*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO3BUIE        (1 << 0) /* RWIVF */
287*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO2BUIE        (1 << 1) /* RWIVF */
288*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO1BUIE        (1 << 2) /* RWIVF */
289*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO0BUIE        (1 << 3) /* RWIVF */
290*c454fd4eSMasakazu Mokuno 
291*c454fd4eSMasakazu Mokuno /* S/PDIF Output Channel Buffer Underflow Interrupt Enables */
292*c454fd4eSMasakazu Mokuno 
293*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPOBUIE(n)      (1 << (7 - (n))) /* RWIVF */
294*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPO1BUIE        (1 << 6) /* RWIVF */
295*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPO0BUIE        (1 << 7) /* RWIVF */
296*c454fd4eSMasakazu Mokuno 
297*c454fd4eSMasakazu Mokuno /* S/PDIF Output Channel One Block Transfer Completion Interrupt Enables */
298*c454fd4eSMasakazu Mokuno 
299*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPOBTCIE(n)     (1 << (11 - (n))) /* RWIVF */
300*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPO1BTCIE       (1 << 10) /* RWIVF */
301*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPO0BTCIE       (1 << 11) /* RWIVF */
302*c454fd4eSMasakazu Mokuno 
303*c454fd4eSMasakazu Mokuno /* 3-Wire Audio Serial Output Channel Buffer Empty Interrupt Enables */
304*c454fd4eSMasakazu Mokuno 
305*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASOBEIE(n)      (1 << (19 - (n))) /* RWIVF */
306*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO3BEIE        (1 << 16) /* RWIVF */
307*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO2BEIE        (1 << 17) /* RWIVF */
308*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO1BEIE        (1 << 18) /* RWIVF */
309*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_ASO0BEIE        (1 << 19) /* RWIVF */
310*c454fd4eSMasakazu Mokuno 
311*c454fd4eSMasakazu Mokuno /* S/PDIF Output Channel Buffer Empty Interrupt Enables */
312*c454fd4eSMasakazu Mokuno 
313*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPOBEIE(n)      (1 << (23 - (n))) /* RWIVF */
314*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPO1BEIE        (1 << 22) /* RWIVF */
315*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AX_IE_SPO0BEIE        (1 << 23) /* RWIVF */
316*c454fd4eSMasakazu Mokuno 
317*c454fd4eSMasakazu Mokuno /*
318*c454fd4eSMasakazu Mokuno Audio Port Interrupt Status Register
319*c454fd4eSMasakazu Mokuno Indicates Interrupt status, which interrupt has occured, and can clear
320*c454fd4eSMasakazu Mokuno each interrupt in this register.
321*c454fd4eSMasakazu Mokuno Writing 1b to a field containing 1b clears field and de-asserts interrupt.
322*c454fd4eSMasakazu Mokuno Writing 0b to a field has no effect.
323*c454fd4eSMasakazu Mokuno Field vaules are the following:
324*c454fd4eSMasakazu Mokuno 0 - Interrupt hasn't occured.
325*c454fd4eSMasakazu Mokuno 1 - Interrupt has occured.
326*c454fd4eSMasakazu Mokuno 
327*c454fd4eSMasakazu Mokuno 
328*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
329*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
330*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IS
331*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
332*c454fd4eSMasakazu Mokuno 
333*c454fd4eSMasakazu Mokuno  Bit assignment are same as AX_IE
334*c454fd4eSMasakazu Mokuno */
335*c454fd4eSMasakazu Mokuno 
336*c454fd4eSMasakazu Mokuno /*
337*c454fd4eSMasakazu Mokuno Audio Output Master Control Register
338*c454fd4eSMasakazu Mokuno Configures Master Clock and other master Audio Output Settings
339*c454fd4eSMasakazu Mokuno 
340*c454fd4eSMasakazu Mokuno 
341*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
342*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
343*c454fd4eSMasakazu Mokuno  |0|SCKSE|0|SCKSE|  MR0  |  MR1  |MCL|MCL|0 0 0 0|0 0 0 0 0 0 0 0| AO_MCTRL
344*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
345*c454fd4eSMasakazu Mokuno */
346*c454fd4eSMasakazu Mokuno 
347*c454fd4eSMasakazu Mokuno /*
348*c454fd4eSMasakazu Mokuno MCLK Output Control
349*c454fd4eSMasakazu Mokuno Controls mclko[1] output.
350*c454fd4eSMasakazu Mokuno 0 - Disable output (fixed at High)
351*c454fd4eSMasakazu Mokuno 1 - Output clock produced by clock selected
352*c454fd4eSMasakazu Mokuno with scksel1 by mr1
353*c454fd4eSMasakazu Mokuno 2 - Reserved
354*c454fd4eSMasakazu Mokuno 3 - Reserved
355*c454fd4eSMasakazu Mokuno */
356*c454fd4eSMasakazu Mokuno 
357*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC1_MASK		(0x3 << 12) /* RWIVF */
358*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC1_DISABLED	(0x0 << 12) /* RWI-V */
359*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC1_ENABLED	(0x1 << 12) /* RW--V */
360*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC1_RESVD2	(0x2 << 12) /* RW--V */
361*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC1_RESVD3	(0x3 << 12) /* RW--V */
362*c454fd4eSMasakazu Mokuno 
363*c454fd4eSMasakazu Mokuno /*
364*c454fd4eSMasakazu Mokuno MCLK Output Control
365*c454fd4eSMasakazu Mokuno Controls mclko[0] output.
366*c454fd4eSMasakazu Mokuno 0 - Disable output (fixed at High)
367*c454fd4eSMasakazu Mokuno 1 - Output clock produced by clock selected
368*c454fd4eSMasakazu Mokuno with SCKSEL0 by MR0
369*c454fd4eSMasakazu Mokuno 2 - Reserved
370*c454fd4eSMasakazu Mokuno 3 - Reserved
371*c454fd4eSMasakazu Mokuno */
372*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC0_MASK		(0x3 << 14) /* RWIVF */
373*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC0_DISABLED	(0x0 << 14) /* RWI-V */
374*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC0_ENABLED	(0x1 << 14) /* RW--V */
375*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC0_RESVD2	(0x2 << 14) /* RW--V */
376*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MCLKC0_RESVD3	(0x3 << 14) /* RW--V */
377*c454fd4eSMasakazu Mokuno /*
378*c454fd4eSMasakazu Mokuno Master Clock Rate 1
379*c454fd4eSMasakazu Mokuno Sets the divide ration of Master Clock1 (clock output from
380*c454fd4eSMasakazu Mokuno mclko[1] for the input clock selected by scksel1.
381*c454fd4eSMasakazu Mokuno */
382*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MR1_MASK	(0xf << 16)
383*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MR1_DEFAULT	(0x0 << 16) /* RWI-V */
384*c454fd4eSMasakazu Mokuno /*
385*c454fd4eSMasakazu Mokuno Master Clock Rate 0
386*c454fd4eSMasakazu Mokuno Sets the divide ratio of Master Clock0 (clock output from
387*c454fd4eSMasakazu Mokuno mclko[0] for the input clock selected by scksel0).
388*c454fd4eSMasakazu Mokuno */
389*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MR0_MASK	(0xf << 20) /* RWIVF */
390*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_MR0_DEFAULT	(0x0 << 20) /* RWI-V */
391*c454fd4eSMasakazu Mokuno /*
392*c454fd4eSMasakazu Mokuno System Clock Select 0/1
393*c454fd4eSMasakazu Mokuno Selects the system clock to be used as Master Clock 0/1
394*c454fd4eSMasakazu Mokuno Input the system clock that is appropriate for the sampling
395*c454fd4eSMasakazu Mokuno rate.
396*c454fd4eSMasakazu Mokuno */
397*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_SCKSEL1_MASK		(0x7 << 24) /* RWIVF */
398*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_SCKSEL1_DEFAULT	(0x2 << 24) /* RWI-V */
399*c454fd4eSMasakazu Mokuno 
400*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_SCKSEL0_MASK		(0x7 << 28) /* RWIVF */
401*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_MCTRL_SCKSEL0_DEFAULT	(0x2 << 28) /* RWI-V */
402*c454fd4eSMasakazu Mokuno 
403*c454fd4eSMasakazu Mokuno 
404*c454fd4eSMasakazu Mokuno /*
405*c454fd4eSMasakazu Mokuno 3-Wire Audio Output Master Control Register
406*c454fd4eSMasakazu Mokuno Configures clock, 3-Wire Audio Serial Output Enable, and
407*c454fd4eSMasakazu Mokuno other 3-Wire Audio Serial Output Master Settings
408*c454fd4eSMasakazu Mokuno 
409*c454fd4eSMasakazu Mokuno 
410*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
411*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
412*c454fd4eSMasakazu Mokuno  |A|A|A|A|0 0 0|A| ASOSR |0 0 0 0|A|A|A|A|A|A|0|1|0 0 0 0 0 0 0 0| AO_3WMCTRL
413*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
414*c454fd4eSMasakazu Mokuno */
415*c454fd4eSMasakazu Mokuno 
416*c454fd4eSMasakazu Mokuno 
417*c454fd4eSMasakazu Mokuno /*
418*c454fd4eSMasakazu Mokuno LRCKO Polarity
419*c454fd4eSMasakazu Mokuno 0 - Reserved
420*c454fd4eSMasakazu Mokuno 1 - default
421*c454fd4eSMasakazu Mokuno */
422*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOPLRCK 		(1 << 8) /* RWIVF */
423*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT	(1 << 8) /* RW--V */
424*c454fd4eSMasakazu Mokuno 
425*c454fd4eSMasakazu Mokuno /* LRCK Output Disable */
426*c454fd4eSMasakazu Mokuno 
427*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD		(1 << 10) /* RWIVF */
428*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_ENABLED	(0 << 10) /* RW--V */
429*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_DISABLED	(1 << 10) /* RWI-V */
430*c454fd4eSMasakazu Mokuno 
431*c454fd4eSMasakazu Mokuno /* Bit Clock Output Disable */
432*c454fd4eSMasakazu Mokuno 
433*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD		(1 << 11) /* RWIVF */
434*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_ENABLED	(0 << 11) /* RW--V */
435*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_DISABLED	(1 << 11) /* RWI-V */
436*c454fd4eSMasakazu Mokuno 
437*c454fd4eSMasakazu Mokuno /*
438*c454fd4eSMasakazu Mokuno 3-Wire Audio Serial Output Channel 0-3 Operational
439*c454fd4eSMasakazu Mokuno Status.  Each bit becomes 1 after each 3-Wire Audio
440*c454fd4eSMasakazu Mokuno Serial Output Channel N is in action by setting 1 to
441*c454fd4eSMasakazu Mokuno asoen.
442*c454fd4eSMasakazu Mokuno Each bit becomes 0 after each 3-Wire Audio Serial Output
443*c454fd4eSMasakazu Mokuno Channel N is out of action by setting 0 to asoen.
444*c454fd4eSMasakazu Mokuno */
445*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN(n)		(1 << (15 - (n))) /* R-IVF */
446*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(n)	(0 << (15 - (n))) /* R-I-V */
447*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(n)	(1 << (15 - (n))) /* R---V */
448*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN0		\
449*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN(0)
450*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN0_STOPPED	\
451*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(0)
452*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN0_RUNNING	\
453*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(0)
454*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN1		\
455*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN(1)
456*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN1_STOPPED	\
457*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(1)
458*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN1_RUNNING	\
459*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(1)
460*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN2		\
461*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN(2)
462*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN2_STOPPED	\
463*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(2)
464*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN2_RUNNING	\
465*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(2)
466*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN3		\
467*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN(3)
468*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN3_STOPPED	\
469*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(3)
470*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASORUN3_RUNNING	\
471*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(3)
472*c454fd4eSMasakazu Mokuno 
473*c454fd4eSMasakazu Mokuno /*
474*c454fd4eSMasakazu Mokuno Sampling Rate
475*c454fd4eSMasakazu Mokuno Specifies the divide ratio of the bit clock (clock output
476*c454fd4eSMasakazu Mokuno from bclko) used by the 3-wire Audio Output Clock, whcih
477*c454fd4eSMasakazu Mokuno is applied to the master clock selected by mcksel.
478*c454fd4eSMasakazu Mokuno Data output is synchronized with this clock.
479*c454fd4eSMasakazu Mokuno */
480*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOSR_MASK		(0xf << 20) /* RWIVF */
481*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV2		(0x1 << 20) /* RWI-V */
482*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV4		(0x2 << 20) /* RW--V */
483*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV8		(0x4 << 20) /* RW--V */
484*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV12	(0x6 << 20) /* RW--V */
485*c454fd4eSMasakazu Mokuno 
486*c454fd4eSMasakazu Mokuno /*
487*c454fd4eSMasakazu Mokuno Master Clock Select
488*c454fd4eSMasakazu Mokuno 0 - Master Clock 0
489*c454fd4eSMasakazu Mokuno 1 - Master Clock 1
490*c454fd4eSMasakazu Mokuno */
491*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL		(1 << 24) /* RWIVF */
492*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL_CLK0	(0 << 24) /* RWI-V */
493*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL_CLK1	(1 << 24) /* RW--V */
494*c454fd4eSMasakazu Mokuno 
495*c454fd4eSMasakazu Mokuno /*
496*c454fd4eSMasakazu Mokuno Enables and disables 4ch 3-Wire Audio Serial Output
497*c454fd4eSMasakazu Mokuno operation.  Each Bit from 0 to 3 corresponds to an
498*c454fd4eSMasakazu Mokuno output channel, which means that each output channel
499*c454fd4eSMasakazu Mokuno can be enabled or disabled individually.  When
500*c454fd4eSMasakazu Mokuno multiple channels are enabled at the same time, output
501*c454fd4eSMasakazu Mokuno operations are performed in synchronization.
502*c454fd4eSMasakazu Mokuno Bit 0 - Output Channel 0 (SDOUT[0])
503*c454fd4eSMasakazu Mokuno Bit 1 - Output Channel 1 (SDOUT[1])
504*c454fd4eSMasakazu Mokuno Bit 2 - Output Channel 2 (SDOUT[2])
505*c454fd4eSMasakazu Mokuno Bit 3 - Output Channel 3 (SDOUT[3])
506*c454fd4eSMasakazu Mokuno */
507*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOEN(n)		(1 << (31 - (n))) /* RWIVF */
508*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(n)	(0 << (31 - (n))) /* RWI-V */
509*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(n)	(1 << (31 - (n))) /* RW--V */
510*c454fd4eSMasakazu Mokuno 
511*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOEN0 \
512*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN(0) /* RWIVF */
513*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOEN0_DISABLED \
514*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(0) /* RWI-V */
515*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WMCTRL_ASOEN0_ENABLED \
516*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(0) /* RW--V */
517*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A1_3WMCTRL_ASOEN0 \
518*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN(1) /* RWIVF */
519*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A1_3WMCTRL_ASOEN0_DISABLED \
520*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(1) /* RWI-V */
521*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A1_3WMCTRL_ASOEN0_ENABLED \
522*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(1) /* RW--V */
523*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A2_3WMCTRL_ASOEN0 \
524*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN(2) /* RWIVF */
525*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A2_3WMCTRL_ASOEN0_DISABLED \
526*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(2) /* RWI-V */
527*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A2_3WMCTRL_ASOEN0_ENABLED \
528*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(2) /* RW--V */
529*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A3_3WMCTRL_ASOEN0 \
530*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN(3) /* RWIVF */
531*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A3_3WMCTRL_ASOEN0_DISABLED \
532*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(3) /* RWI-V */
533*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_A3_3WMCTRL_ASOEN0_ENABLED \
534*c454fd4eSMasakazu Mokuno 	PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(3) /* RW--V */
535*c454fd4eSMasakazu Mokuno 
536*c454fd4eSMasakazu Mokuno /*
537*c454fd4eSMasakazu Mokuno 3-Wire Audio Serial output Channel 0-3 Control Register
538*c454fd4eSMasakazu Mokuno Configures settings for 3-Wire Serial Audio Output Channel 0-3
539*c454fd4eSMasakazu Mokuno 
540*c454fd4eSMasakazu Mokuno 
541*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
542*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
543*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|0 0 0 0|A|0|ASO|0 0 0|0|0|0|0|0| AO_3WCTRL
544*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
545*c454fd4eSMasakazu Mokuno 
546*c454fd4eSMasakazu Mokuno */
547*c454fd4eSMasakazu Mokuno /*
548*c454fd4eSMasakazu Mokuno Data Bit Mode
549*c454fd4eSMasakazu Mokuno Specifies the number of data bits
550*c454fd4eSMasakazu Mokuno 0 - 16 bits
551*c454fd4eSMasakazu Mokuno 1 - reserved
552*c454fd4eSMasakazu Mokuno 2 - 20 bits
553*c454fd4eSMasakazu Mokuno 3 - 24 bits
554*c454fd4eSMasakazu Mokuno */
555*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODB_MASK	(0x3 << 8) /* RWIVF */
556*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODB_16BIT	(0x0 << 8) /* RWI-V */
557*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODB_RESVD	(0x1 << 8) /* RWI-V */
558*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODB_20BIT	(0x2 << 8) /* RW--V */
559*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODB_24BIT	(0x3 << 8) /* RW--V */
560*c454fd4eSMasakazu Mokuno /*
561*c454fd4eSMasakazu Mokuno Data Format Mode
562*c454fd4eSMasakazu Mokuno Specifies the data format where (LSB side or MSB) the data(in 20 bit
563*c454fd4eSMasakazu Mokuno or 24 bit resolution mode) is put in a 32 bit field.
564*c454fd4eSMasakazu Mokuno 0 - Data put on LSB side
565*c454fd4eSMasakazu Mokuno 1 - Data put on MSB side
566*c454fd4eSMasakazu Mokuno */
567*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODF 	(1 << 11) /* RWIVF */
568*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODF_LSB	(0 << 11) /* RWI-V */
569*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASODF_MSB	(1 << 11) /* RW--V */
570*c454fd4eSMasakazu Mokuno /*
571*c454fd4eSMasakazu Mokuno Buffer Reset
572*c454fd4eSMasakazu Mokuno Performs buffer reset.  Writing 1 to this bit initializes the
573*c454fd4eSMasakazu Mokuno corresponding 3-Wire Audio Output buffers(both L and R).
574*c454fd4eSMasakazu Mokuno */
575*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASOBRST 		(1 << 16) /* CWIVF */
576*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASOBRST_IDLE	(0 << 16) /* -WI-V */
577*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET	(1 << 16) /* -W--T */
578*c454fd4eSMasakazu Mokuno 
579*c454fd4eSMasakazu Mokuno /*
580*c454fd4eSMasakazu Mokuno S/PDIF Audio Output Channel 0/1 Control Register
581*c454fd4eSMasakazu Mokuno Configures settings for S/PDIF Audio Output Channel 0/1.
582*c454fd4eSMasakazu Mokuno 
583*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
584*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
585*c454fd4eSMasakazu Mokuno  |S|0 0 0|S|0 0|S| SPOSR |0 0|SPO|0 0 0 0|S|0|SPO|0 0 0 0 0 0 0|S| AO_SPDCTRL
586*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
587*c454fd4eSMasakazu Mokuno */
588*c454fd4eSMasakazu Mokuno /*
589*c454fd4eSMasakazu Mokuno Buffer reset.  Writing 1 to this bit initializes the
590*c454fd4eSMasakazu Mokuno corresponding S/PDIF output buffer pointer.
591*c454fd4eSMasakazu Mokuno */
592*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOBRST		(1 << 0) /* CWIVF */
593*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOBRST_IDLE	(0 << 0) /* -WI-V */
594*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOBRST_RESET	(1 << 0) /* -W--T */
595*c454fd4eSMasakazu Mokuno 
596*c454fd4eSMasakazu Mokuno /*
597*c454fd4eSMasakazu Mokuno Data Bit Mode
598*c454fd4eSMasakazu Mokuno Specifies number of data bits
599*c454fd4eSMasakazu Mokuno 0 - 16 bits
600*c454fd4eSMasakazu Mokuno 1 - Reserved
601*c454fd4eSMasakazu Mokuno 2 - 20 bits
602*c454fd4eSMasakazu Mokuno 3 - 24 bits
603*c454fd4eSMasakazu Mokuno */
604*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODB_MASK		(0x3 << 8) /* RWIVF */
605*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODB_16BIT	(0x0 << 8) /* RWI-V */
606*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODB_RESVD	(0x1 << 8) /* RW--V */
607*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODB_20BIT	(0x2 << 8) /* RW--V */
608*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODB_24BIT	(0x3 << 8) /* RW--V */
609*c454fd4eSMasakazu Mokuno /*
610*c454fd4eSMasakazu Mokuno Data format Mode
611*c454fd4eSMasakazu Mokuno Specifies the data format, where (LSB side or MSB)
612*c454fd4eSMasakazu Mokuno the data(in 20 or 24 bit resolution) is put in the
613*c454fd4eSMasakazu Mokuno 32 bit field.
614*c454fd4eSMasakazu Mokuno 0 - LSB Side
615*c454fd4eSMasakazu Mokuno 1 - MSB Side
616*c454fd4eSMasakazu Mokuno */
617*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODF	(1 << 11) /* RWIVF */
618*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODF_LSB	(0 << 11) /* RWI-V */
619*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPODF_MSB	(1 << 11) /* RW--V */
620*c454fd4eSMasakazu Mokuno /*
621*c454fd4eSMasakazu Mokuno Source Select
622*c454fd4eSMasakazu Mokuno Specifies the source of the S/PDIF output.  When 0, output
623*c454fd4eSMasakazu Mokuno operation is controlled by 3wen[0] of AO_3WMCTRL register.
624*c454fd4eSMasakazu Mokuno The SR must have the same setting as the a0_3wmctrl reg.
625*c454fd4eSMasakazu Mokuno 0 - 3-Wire Audio OUT Ch0 Buffer
626*c454fd4eSMasakazu Mokuno 1 - S/PDIF buffer
627*c454fd4eSMasakazu Mokuno */
628*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSS_MASK		(0x3 << 16) /* RWIVF */
629*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSS_3WEN		(0x0 << 16) /* RWI-V */
630*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSS_SPDIF	(0x1 << 16) /* RW--V */
631*c454fd4eSMasakazu Mokuno /*
632*c454fd4eSMasakazu Mokuno Sampling Rate
633*c454fd4eSMasakazu Mokuno Specifies the divide ratio of the bit clock (clock output
634*c454fd4eSMasakazu Mokuno from bclko) used by the S/PDIF Output Clock, which
635*c454fd4eSMasakazu Mokuno is applied to the master clock selected by mcksel.
636*c454fd4eSMasakazu Mokuno */
637*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSR		(0xf << 20) /* RWIVF */
638*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV2		(0x1 << 20) /* RWI-V */
639*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV4		(0x2 << 20) /* RW--V */
640*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV8		(0x4 << 20) /* RW--V */
641*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV12	(0x6 << 20) /* RW--V */
642*c454fd4eSMasakazu Mokuno /*
643*c454fd4eSMasakazu Mokuno Master Clock Select
644*c454fd4eSMasakazu Mokuno 0 - Master Clock 0
645*c454fd4eSMasakazu Mokuno 1 - Master Clock 1
646*c454fd4eSMasakazu Mokuno */
647*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL		(1 << 24) /* RWIVF */
648*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK0	(0 << 24) /* RWI-V */
649*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK1	(1 << 24) /* RW--V */
650*c454fd4eSMasakazu Mokuno 
651*c454fd4eSMasakazu Mokuno /*
652*c454fd4eSMasakazu Mokuno S/PDIF Output Channel Operational Status
653*c454fd4eSMasakazu Mokuno This bit becomes 1 after S/PDIF Output Channel is in
654*c454fd4eSMasakazu Mokuno action by setting 1 to spoen.  This bit becomes 0
655*c454fd4eSMasakazu Mokuno after S/PDIF Output Channel is out of action by setting
656*c454fd4eSMasakazu Mokuno 0 to spoen.
657*c454fd4eSMasakazu Mokuno */
658*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPORUN		(1 << 27) /* R-IVF */
659*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPORUN_STOPPED	(0 << 27) /* R-I-V */
660*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPORUN_RUNNING	(1 << 27) /* R---V */
661*c454fd4eSMasakazu Mokuno 
662*c454fd4eSMasakazu Mokuno /*
663*c454fd4eSMasakazu Mokuno S/PDIF Audio Output Channel Output Enable
664*c454fd4eSMasakazu Mokuno Enables and disables output operation.  This bit is used
665*c454fd4eSMasakazu Mokuno only when sposs = 1
666*c454fd4eSMasakazu Mokuno */
667*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOEN		(1 << 31) /* RWIVF */
668*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOEN_DISABLED	(0 << 31) /* RWI-V */
669*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPDCTRL_SPOEN_ENABLED	(1 << 31) /* RW--V */
670*c454fd4eSMasakazu Mokuno 
671*c454fd4eSMasakazu Mokuno /*
672*c454fd4eSMasakazu Mokuno S/PDIF Audio Output Channel Channel Status
673*c454fd4eSMasakazu Mokuno Setting Registers.
674*c454fd4eSMasakazu Mokuno Configures channel status bit settings for each block
675*c454fd4eSMasakazu Mokuno (192 bits).
676*c454fd4eSMasakazu Mokuno Output is performed from the MSB(AO_SPDCS0 register bit 31).
677*c454fd4eSMasakazu Mokuno The same value is added for subframes within the same frame.
678*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
679*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
680*c454fd4eSMasakazu Mokuno  |                             SPOCS                             | AO_SPDCS
681*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
682*c454fd4eSMasakazu Mokuno 
683*c454fd4eSMasakazu Mokuno S/PDIF Audio Output Channel User Bit Setting
684*c454fd4eSMasakazu Mokuno Configures user bit settings for each block (384 bits).
685*c454fd4eSMasakazu Mokuno Output is performed from the MSB(ao_spdub0 register bit 31).
686*c454fd4eSMasakazu Mokuno 
687*c454fd4eSMasakazu Mokuno 
688*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
689*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
690*c454fd4eSMasakazu Mokuno  |                             SPOUB                             | AO_SPDUB
691*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
692*c454fd4eSMasakazu Mokuno */
693*c454fd4eSMasakazu Mokuno /*****************************************************************************
694*c454fd4eSMasakazu Mokuno  *
695*c454fd4eSMasakazu Mokuno  * DMAC register
696*c454fd4eSMasakazu Mokuno  *
697*c454fd4eSMasakazu Mokuno  *****************************************************************************/
698*c454fd4eSMasakazu Mokuno /*
699*c454fd4eSMasakazu Mokuno The PS3_AUDIO_KICK register is used to initiate a DMA transfer and monitor
700*c454fd4eSMasakazu Mokuno its status
701*c454fd4eSMasakazu Mokuno 
702*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
703*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
704*c454fd4eSMasakazu Mokuno  |0 0 0 0 0|STATU|0 0 0|  EVENT  |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|R| KICK
705*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
706*c454fd4eSMasakazu Mokuno */
707*c454fd4eSMasakazu Mokuno /*
708*c454fd4eSMasakazu Mokuno The REQUEST field is written to ACTIVE to initiate a DMA request when EVENT
709*c454fd4eSMasakazu Mokuno occurs.
710*c454fd4eSMasakazu Mokuno It will return to the DONE state when the request is completed.
711*c454fd4eSMasakazu Mokuno The registers for a DMA channel should only be written if REQUEST is IDLE.
712*c454fd4eSMasakazu Mokuno */
713*c454fd4eSMasakazu Mokuno 
714*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_REQUEST                (1 << 0) /* RWIVF */
715*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_REQUEST_IDLE           (0 << 0) /* RWI-V */
716*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_REQUEST_ACTIVE         (1 << 0) /* -W--T */
717*c454fd4eSMasakazu Mokuno 
718*c454fd4eSMasakazu Mokuno /*
719*c454fd4eSMasakazu Mokuno  *The EVENT field is used to set the event in which
720*c454fd4eSMasakazu Mokuno  *the DMA request becomes active.
721*c454fd4eSMasakazu Mokuno  */
722*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_MASK             (0x1f << 16) /* RWIVF */
723*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_ALWAYS           (0x00 << 16) /* RWI-V */
724*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT0_EMPTY (0x01 << 16) /* RW--V */
725*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT0_UNDERFLOW	(0x02 << 16) /* RW--V */
726*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT1_EMPTY		(0x03 << 16) /* RW--V */
727*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT1_UNDERFLOW	(0x04 << 16) /* RW--V */
728*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT2_EMPTY		(0x05 << 16) /* RW--V */
729*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT2_UNDERFLOW	(0x06 << 16) /* RW--V */
730*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT3_EMPTY		(0x07 << 16) /* RW--V */
731*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SERIALOUT3_UNDERFLOW	(0x08 << 16) /* RW--V */
732*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SPDIF0_BLOCKTRANSFERCOMPLETE \
733*c454fd4eSMasakazu Mokuno 	(0x09 << 16) /* RW--V */
734*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SPDIF0_UNDERFLOW		(0x0A << 16) /* RW--V */
735*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SPDIF0_EMPTY		(0x0B << 16) /* RW--V */
736*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SPDIF1_BLOCKTRANSFERCOMPLETE \
737*c454fd4eSMasakazu Mokuno 	(0x0C << 16) /* RW--V */
738*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SPDIF1_UNDERFLOW		(0x0D << 16) /* RW--V */
739*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_SPDIF1_EMPTY		(0x0E << 16) /* RW--V */
740*c454fd4eSMasakazu Mokuno 
741*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA(n) \
742*c454fd4eSMasakazu Mokuno 	((0x13 + (n)) << 16) /* RW--V */
743*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA0         (0x13 << 16) /* RW--V */
744*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA1         (0x14 << 16) /* RW--V */
745*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA2         (0x15 << 16) /* RW--V */
746*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA3         (0x16 << 16) /* RW--V */
747*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA4         (0x17 << 16) /* RW--V */
748*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA5         (0x18 << 16) /* RW--V */
749*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA6         (0x19 << 16) /* RW--V */
750*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA7         (0x1A << 16) /* RW--V */
751*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA8         (0x1B << 16) /* RW--V */
752*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA9         (0x1C << 16) /* RW--V */
753*c454fd4eSMasakazu Mokuno 
754*c454fd4eSMasakazu Mokuno /*
755*c454fd4eSMasakazu Mokuno The STATUS field can be used to monitor the progress of a DMA request.
756*c454fd4eSMasakazu Mokuno DONE indicates the previous request has completed.
757*c454fd4eSMasakazu Mokuno EVENT indicates that the DMA engine is waiting for the EVENT to occur.
758*c454fd4eSMasakazu Mokuno PENDING indicates that the DMA engine has not started processing this
759*c454fd4eSMasakazu Mokuno request, but the EVENT has occured.
760*c454fd4eSMasakazu Mokuno DMA indicates that the data transfer is in progress.
761*c454fd4eSMasakazu Mokuno NOTIFY indicates that the notifier signalling end of transfer is being written.
762*c454fd4eSMasakazu Mokuno CLEAR indicated that the previous transfer was cleared.
763*c454fd4eSMasakazu Mokuno ERROR indicates the previous transfer requested an unsupported
764*c454fd4eSMasakazu Mokuno source/destination combination.
765*c454fd4eSMasakazu Mokuno */
766*c454fd4eSMasakazu Mokuno 
767*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_MASK	(0x7 << 24) /* R-IVF */
768*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_DONE	(0x0 << 24) /* R-I-V */
769*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_EVENT	(0x1 << 24) /* R---V */
770*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_PENDING	(0x2 << 24) /* R---V */
771*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_DMA	(0x3 << 24) /* R---V */
772*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_NOTIFY	(0x4 << 24) /* R---V */
773*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_CLEAR	(0x5 << 24) /* R---V */
774*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_KICK_STATUS_ERROR	(0x6 << 24) /* R---V */
775*c454fd4eSMasakazu Mokuno 
776*c454fd4eSMasakazu Mokuno /*
777*c454fd4eSMasakazu Mokuno The PS3_AUDIO_SOURCE register specifies the source address for transfers.
778*c454fd4eSMasakazu Mokuno 
779*c454fd4eSMasakazu Mokuno 
780*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
781*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
782*c454fd4eSMasakazu Mokuno  |                      START                      |0 0 0 0 0|TAR| SOURCE
783*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
784*c454fd4eSMasakazu Mokuno */
785*c454fd4eSMasakazu Mokuno 
786*c454fd4eSMasakazu Mokuno /*
787*c454fd4eSMasakazu Mokuno The Audio DMA engine uses 128-byte transfers, thus the address must be aligned
788*c454fd4eSMasakazu Mokuno to a 128 byte boundary.  The low seven bits are assumed to be 0.
789*c454fd4eSMasakazu Mokuno */
790*c454fd4eSMasakazu Mokuno 
791*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_SOURCE_START_MASK	(0x01FFFFFF << 7) /* RWIUF */
792*c454fd4eSMasakazu Mokuno 
793*c454fd4eSMasakazu Mokuno /*
794*c454fd4eSMasakazu Mokuno The TARGET field specifies the memory space containing the source address.
795*c454fd4eSMasakazu Mokuno */
796*c454fd4eSMasakazu Mokuno 
797*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_SOURCE_TARGET_MASK 		(3 << 0) /* RWIVF */
798*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_SOURCE_TARGET_SYSTEM_MEMORY	(2 << 0) /* RW--V */
799*c454fd4eSMasakazu Mokuno 
800*c454fd4eSMasakazu Mokuno /*
801*c454fd4eSMasakazu Mokuno The PS3_AUDIO_DEST register specifies the destination address for transfers.
802*c454fd4eSMasakazu Mokuno 
803*c454fd4eSMasakazu Mokuno 
804*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
805*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
806*c454fd4eSMasakazu Mokuno  |                      START                      |0 0 0 0 0|TAR| DEST
807*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
808*c454fd4eSMasakazu Mokuno */
809*c454fd4eSMasakazu Mokuno 
810*c454fd4eSMasakazu Mokuno /*
811*c454fd4eSMasakazu Mokuno The Audio DMA engine uses 128-byte transfers, thus the address must be aligned
812*c454fd4eSMasakazu Mokuno to a 128 byte boundary.  The low seven bits are assumed to be 0.
813*c454fd4eSMasakazu Mokuno */
814*c454fd4eSMasakazu Mokuno 
815*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DEST_START_MASK	(0x01FFFFFF << 7) /* RWIUF */
816*c454fd4eSMasakazu Mokuno 
817*c454fd4eSMasakazu Mokuno /*
818*c454fd4eSMasakazu Mokuno The TARGET field specifies the memory space containing the destination address
819*c454fd4eSMasakazu Mokuno AUDIOFIFO = Audio WriteData FIFO,
820*c454fd4eSMasakazu Mokuno */
821*c454fd4eSMasakazu Mokuno 
822*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DEST_TARGET_MASK		(3 << 0) /* RWIVF */
823*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DEST_TARGET_AUDIOFIFO		(1 << 0) /* RW--V */
824*c454fd4eSMasakazu Mokuno 
825*c454fd4eSMasakazu Mokuno /*
826*c454fd4eSMasakazu Mokuno PS3_AUDIO_DMASIZE specifies the number of 128-byte blocks + 1 to transfer.
827*c454fd4eSMasakazu Mokuno So a value of 0 means 128-bytes will get transfered.
828*c454fd4eSMasakazu Mokuno 
829*c454fd4eSMasakazu Mokuno 
830*c454fd4eSMasakazu Mokuno  31            24 23           16 15            8 7             0
831*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
832*c454fd4eSMasakazu Mokuno  |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|   BLOCKS    | DMASIZE
833*c454fd4eSMasakazu Mokuno  +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
834*c454fd4eSMasakazu Mokuno */
835*c454fd4eSMasakazu Mokuno 
836*c454fd4eSMasakazu Mokuno 
837*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_DMASIZE_BLOCKS_MASK 	(0x7f << 0) /* RWIUF */
838*c454fd4eSMasakazu Mokuno 
839*c454fd4eSMasakazu Mokuno /*
840*c454fd4eSMasakazu Mokuno  * source/destination address for internal fifos
841*c454fd4eSMasakazu Mokuno  */
842*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3W_LDATA(n)	(0x1000 + (0x100 * (n)))
843*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_3W_RDATA(n)	(0x1080 + (0x100 * (n)))
844*c454fd4eSMasakazu Mokuno 
845*c454fd4eSMasakazu Mokuno #define PS3_AUDIO_AO_SPD_DATA(n)	(0x2000 + (0x400 * (n)))
846*c454fd4eSMasakazu Mokuno 
847*c454fd4eSMasakazu Mokuno 
848*c454fd4eSMasakazu Mokuno /*
849*c454fd4eSMasakazu Mokuno  * field attiribute
850*c454fd4eSMasakazu Mokuno  *
851*c454fd4eSMasakazu Mokuno  *	Read
852*c454fd4eSMasakazu Mokuno  *	  ' ' = Other Information
853*c454fd4eSMasakazu Mokuno  *	  '-' = Field is part of a write-only register
854*c454fd4eSMasakazu Mokuno  *	  'C' = Value read is always the same, constant value line follows (C)
855*c454fd4eSMasakazu Mokuno  *	  'R' = Value is read
856*c454fd4eSMasakazu Mokuno  *
857*c454fd4eSMasakazu Mokuno  *	Write
858*c454fd4eSMasakazu Mokuno  *	  ' ' = Other Information
859*c454fd4eSMasakazu Mokuno  *	  '-' = Must not be written (D), value ignored when written (R,A,F)
860*c454fd4eSMasakazu Mokuno  *	  'W' = Can be written
861*c454fd4eSMasakazu Mokuno  *
862*c454fd4eSMasakazu Mokuno  *	Internal State
863*c454fd4eSMasakazu Mokuno  *	  ' ' = Other Information
864*c454fd4eSMasakazu Mokuno  *	  '-' = No internal state
865*c454fd4eSMasakazu Mokuno  *	  'X' = Internal state, initial value is unknown
866*c454fd4eSMasakazu Mokuno  *	  'I' = Internal state, initial value is known and follows (I)
867*c454fd4eSMasakazu Mokuno  *
868*c454fd4eSMasakazu Mokuno  *	Declaration/Size
869*c454fd4eSMasakazu Mokuno  *	  ' ' = Other Information
870*c454fd4eSMasakazu Mokuno  *	  '-' = Does Not Apply
871*c454fd4eSMasakazu Mokuno  *	  'V' = Type is void
872*c454fd4eSMasakazu Mokuno  *	  'U' = Type is unsigned integer
873*c454fd4eSMasakazu Mokuno  *	  'S' = Type is signed integer
874*c454fd4eSMasakazu Mokuno  *	  'F' = Type is IEEE floating point
875*c454fd4eSMasakazu Mokuno  *	  '1' = Byte size (008)
876*c454fd4eSMasakazu Mokuno  *	  '2' = Short size (016)
877*c454fd4eSMasakazu Mokuno  *	  '3' = Three byte size (024)
878*c454fd4eSMasakazu Mokuno  *	  '4' = Word size (032)
879*c454fd4eSMasakazu Mokuno  *	  '8' = Double size (064)
880*c454fd4eSMasakazu Mokuno  *
881*c454fd4eSMasakazu Mokuno  *	Define Indicator
882*c454fd4eSMasakazu Mokuno  *	  ' ' = Other Information
883*c454fd4eSMasakazu Mokuno  *	  'D' = Device
884*c454fd4eSMasakazu Mokuno  *	  'M' = Memory
885*c454fd4eSMasakazu Mokuno  *	  'R' = Register
886*c454fd4eSMasakazu Mokuno  *	  'A' = Array of Registers
887*c454fd4eSMasakazu Mokuno  *	  'F' = Field
888*c454fd4eSMasakazu Mokuno  *	  'V' = Value
889*c454fd4eSMasakazu Mokuno  *	  'T' = Task
890*c454fd4eSMasakazu Mokuno  */
891*c454fd4eSMasakazu Mokuno 
892