/* SPDX-License-Identifier: GPL-2.0-only */ /* * Audio support for PS3 * Copyright (C) 2007 Sony Computer Entertainment Inc. * Copyright 2006, 2007 Sony Corporation * All rights reserved.
*/
/* PS3_AUDIO_INTR_0 register tells an interrupt handler which audio DMA channel triggered the interrupt. The interrupt status for a channel can be cleared by writing a '1' to the corresponding bit. A new interrupt cannot be generated until the previous interrupt has been cleared.
Note that the status reported by PS3_AUDIO_INTR_0 is independent of the value of PS3_AUDIO_INTR_EN_0.
/* The PS3_AUDIO_INTR_EN_0 register specifies which DMA channels can generate an interrupt to the PU. Each bit of PS3_AUDIO_INTR_EN_0 is ANDed with the corresponding bit in PS3_AUDIO_INTR_0. The resulting bits are OR'd together to generate the Audio interrupt.
/* The CLEAR field cancels all pending transfers, and stops any running DMA transfers. Any interrupts associated with the canceled transfers will occur as if the transfer had finished. Since this bit is designed to recover from DMA related issues which are caused by unpredictable situations, it is preferred to wait for normal DMA transfer end without using this bit.
*/ #define PS3_AUDIO_CONFIG_CLEAR (1 << 8) /* RWIVF */
/* PS3_AUDIO_AX_MCTRL: Audio Port Mute Control Register
*/ /* S/PDIF Output Channel Read Buffer Numbers Buffer number is value of field. Indicates current read access buffer ID from Audio Data Transfer controller of S/PDIF Output
*/
/* Audio Port Interrupt Condition Register For the fields in this register, the following values apply: 0 = Interrupt is generated every interrupt event. 1 = Interrupt is generated every 2 interrupt events. 2 = Interrupt is generated every 4 interrupt events. 3 = Reserved
/* Audio Port Interrupt Status Register Indicates Interrupt status, which interrupt has occurred, and can clear each interrupt in this register. Writing 1b to a field containing 1b clears field and de-asserts interrupt. Writing 0b to a field has no effect. Field values are the following: 0 - Interrupt hasn't occurred. 1 - Interrupt has occurred.
/* 3-Wire Audio Output Master Control Register Configures clock, 3-Wire Audio Serial Output Enable, and other 3-Wire Audio Serial Output Master Settings
/* 3-Wire Audio Serial Output Channel 0-3 Operational Status. Each bit becomes 1 after each 3-Wire Audio Serial Output Channel N is in action by setting 1 to asoen. Each bit becomes 0 after each 3-Wire Audio Serial Output Channel N is out of action by setting 0 to asoen.
*/ #define PS3_AUDIO_AO_3WMCTRL_ASORUN(n) (1 << (15 - (n))) /* R-IVF */ #define PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(n) (0 << (15 - (n))) /* R-I-V */ #define PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(n) (1 << (15 - (n))) /* R---V */ #define PS3_AUDIO_AO_3WMCTRL_ASORUN0 \
PS3_AUDIO_AO_3WMCTRL_ASORUN(0) #define PS3_AUDIO_AO_3WMCTRL_ASORUN0_STOPPED \
PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(0) #define PS3_AUDIO_AO_3WMCTRL_ASORUN0_RUNNING \
PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(0) #define PS3_AUDIO_AO_3WMCTRL_ASORUN1 \
PS3_AUDIO_AO_3WMCTRL_ASORUN(1) #define PS3_AUDIO_AO_3WMCTRL_ASORUN1_STOPPED \
PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(1) #define PS3_AUDIO_AO_3WMCTRL_ASORUN1_RUNNING \
PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(1) #define PS3_AUDIO_AO_3WMCTRL_ASORUN2 \
PS3_AUDIO_AO_3WMCTRL_ASORUN(2) #define PS3_AUDIO_AO_3WMCTRL_ASORUN2_STOPPED \
PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(2) #define PS3_AUDIO_AO_3WMCTRL_ASORUN2_RUNNING \
PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(2) #define PS3_AUDIO_AO_3WMCTRL_ASORUN3 \
PS3_AUDIO_AO_3WMCTRL_ASORUN(3) #define PS3_AUDIO_AO_3WMCTRL_ASORUN3_STOPPED \
PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(3) #define PS3_AUDIO_AO_3WMCTRL_ASORUN3_RUNNING \
PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(3)
/* Sampling Rate Specifies the divide ratio of the bit clock (clock output from bclko) used by the 3-wire Audio Output Clock, which is applied to the master clock selected by mcksel. Data output is synchronized with this clock.
*/ #define PS3_AUDIO_AO_3WMCTRL_ASOSR_MASK (0xf << 20) /* RWIVF */ #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV2 (0x1 << 20) /* RWI-V */ #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV4 (0x2 << 20) /* RW--V */ #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV8 (0x4 << 20) /* RW--V */ #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV12 (0x6 << 20) /* RW--V */
/* Enables and disables 4ch 3-Wire Audio Serial Output operation. Each Bit from 0 to 3 corresponds to an output channel, which means that each output channel can be enabled or disabled individually. When multiple channels are enabled at the same time, output operations are performed in synchronization. Bit 0 - Output Channel 0 (SDOUT[0]) Bit 1 - Output Channel 1 (SDOUT[1]) Bit 2 - Output Channel 2 (SDOUT[2]) Bit 3 - Output Channel 3 (SDOUT[3])
*/ #define PS3_AUDIO_AO_3WMCTRL_ASOEN(n) (1 << (31 - (n))) /* RWIVF */ #define PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(n) (0 << (31 - (n))) /* RWI-V */ #define PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(n) (1 << (31 - (n))) /* RW--V */
*/ /* Data Bit Mode Specifies the number of data bits 0 - 16 bits 1 - reserved 2 - 20 bits 3 - 24 bits
*/ #define PS3_AUDIO_AO_3WCTRL_ASODB_MASK (0x3 << 8) /* RWIVF */ #define PS3_AUDIO_AO_3WCTRL_ASODB_16BIT (0x0 << 8) /* RWI-V */ #define PS3_AUDIO_AO_3WCTRL_ASODB_RESVD (0x1 << 8) /* RWI-V */ #define PS3_AUDIO_AO_3WCTRL_ASODB_20BIT (0x2 << 8) /* RW--V */ #define PS3_AUDIO_AO_3WCTRL_ASODB_24BIT (0x3 << 8) /* RW--V */ /* Data Format Mode Specifies the data format where (LSB side or MSB) the data(in 20 bit or 24 bit resolution mode) is put in a 32 bit field. 0 - Data put on LSB side 1 - Data put on MSB side
*/ #define PS3_AUDIO_AO_3WCTRL_ASODF (1 << 11) /* RWIVF */ #define PS3_AUDIO_AO_3WCTRL_ASODF_LSB (0 << 11) /* RWI-V */ #define PS3_AUDIO_AO_3WCTRL_ASODF_MSB (1 << 11) /* RW--V */ /* Buffer Reset Performs buffer reset. Writing 1 to this bit initializes the corresponding 3-Wire Audio Output buffers(both L and R).
*/ #define PS3_AUDIO_AO_3WCTRL_ASOBRST (1 << 16) /* CWIVF */ #define PS3_AUDIO_AO_3WCTRL_ASOBRST_IDLE (0 << 16) /* -WI-V */ #define PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET (1 << 16) /* -W--T */
/* S/PDIF Audio Output Channel 0/1 Control Register Configures settings for S/PDIF Audio Output Channel 0/1.
/* Data Bit Mode Specifies number of data bits 0 - 16 bits 1 - Reserved 2 - 20 bits 3 - 24 bits
*/ #define PS3_AUDIO_AO_SPDCTRL_SPODB_MASK (0x3 << 8) /* RWIVF */ #define PS3_AUDIO_AO_SPDCTRL_SPODB_16BIT (0x0 << 8) /* RWI-V */ #define PS3_AUDIO_AO_SPDCTRL_SPODB_RESVD (0x1 << 8) /* RW--V */ #define PS3_AUDIO_AO_SPDCTRL_SPODB_20BIT (0x2 << 8) /* RW--V */ #define PS3_AUDIO_AO_SPDCTRL_SPODB_24BIT (0x3 << 8) /* RW--V */ /* Data format Mode Specifies the data format, where (LSB side or MSB) the data(in 20 or 24 bit resolution) is put in the 32 bit field. 0 - LSB Side 1 - MSB Side
*/ #define PS3_AUDIO_AO_SPDCTRL_SPODF (1 << 11) /* RWIVF */ #define PS3_AUDIO_AO_SPDCTRL_SPODF_LSB (0 << 11) /* RWI-V */ #define PS3_AUDIO_AO_SPDCTRL_SPODF_MSB (1 << 11) /* RW--V */ /* Source Select Specifies the source of the S/PDIF output. When 0, output operation is controlled by 3wen[0] of AO_3WMCTRL register. The SR must have the same setting as the a0_3wmctrl reg. 0 - 3-Wire Audio OUT Ch0 Buffer 1 - S/PDIF buffer
*/ #define PS3_AUDIO_AO_SPDCTRL_SPOSS_MASK (0x3 << 16) /* RWIVF */ #define PS3_AUDIO_AO_SPDCTRL_SPOSS_3WEN (0x0 << 16) /* RWI-V */ #define PS3_AUDIO_AO_SPDCTRL_SPOSS_SPDIF (0x1 << 16) /* RW--V */ /* Sampling Rate Specifies the divide ratio of the bit clock (clock output from bclko) used by the S/PDIF Output Clock, which is applied to the master clock selected by mcksel.
*/ #define PS3_AUDIO_AO_SPDCTRL_SPOSR (0xf << 20) /* RWIVF */ #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV2 (0x1 << 20) /* RWI-V */ #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV4 (0x2 << 20) /* RW--V */ #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV8 (0x4 << 20) /* RW--V */ #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV12 (0x6 << 20) /* RW--V */ /* Master Clock Select 0 - Master Clock 0 1 - Master Clock 1
*/ #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL (1 << 24) /* RWIVF */ #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK0 (0 << 24) /* RWI-V */ #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK1 (1 << 24) /* RW--V */
/* S/PDIF Output Channel Operational Status This bit becomes 1 after S/PDIF Output Channel is in action by setting 1 to spoen. This bit becomes 0 after S/PDIF Output Channel is out of action by setting 0 to spoen.
*/ #define PS3_AUDIO_AO_SPDCTRL_SPORUN (1 << 27) /* R-IVF */ #define PS3_AUDIO_AO_SPDCTRL_SPORUN_STOPPED (0 << 27) /* R-I-V */ #define PS3_AUDIO_AO_SPDCTRL_SPORUN_RUNNING (1 << 27) /* R---V */
/* S/PDIF Audio Output Channel Output Enable Enables and disables output operation. This bit is used only when sposs = 1
*/ #define PS3_AUDIO_AO_SPDCTRL_SPOEN (1 << 31) /* RWIVF */ #define PS3_AUDIO_AO_SPDCTRL_SPOEN_DISABLED (0 << 31) /* RWI-V */ #define PS3_AUDIO_AO_SPDCTRL_SPOEN_ENABLED (1 << 31) /* RW--V */
/* S/PDIF Audio Output Channel Channel Status Setting Registers. Configures channel status bit settings for each block (192 bits). Output is performed from the MSB(AO_SPDCS0 register bit 31). The same value is added for subframes within the same frame. 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ | SPOCS | AO_SPDCS +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
S/PDIF Audio Output Channel User Bit Setting Configures user bit settings for each block (384 bits). Output is performed from the MSB(ao_spdub0 register bit 31).
31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ | SPOUB | AO_SPDUB +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
*/ /***************************************************************************** * * DMAC register *
*****************************************************************************/ /* The PS3_AUDIO_KICK register is used to initiate a DMA transfer and monitor its status
31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |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 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
*/ /* The REQUEST field is written to ACTIVE to initiate a DMA request when EVENT occurs. It will return to the DONE state when the request is completed. The registers for a DMA channel should only be written if REQUEST is IDLE.
*/
/* The STATUS field can be used to monitor the progress of a DMA request. DONE indicates the previous request has completed. EVENT indicates that the DMA engine is waiting for the EVENT to occur. PENDING indicates that the DMA engine has not started processing this request, but the EVENT has occurred. DMA indicates that the data transfer is in progress. NOTIFY indicates that the notifier signalling end of transfer is being written. CLEAR indicated that the previous transfer was cleared. ERROR indicates the previous transfer requested an unsupported source/destination combination.
*/
/* * field attiribute * * Read * ' ' = Other Information * '-' = Field is part of a write-only register * 'C' = Value read is always the same, constant value line follows (C) * 'R' = Value is read * * Write * ' ' = Other Information * '-' = Must not be written (D), value ignored when written (R,A,F) * 'W' = Can be written * * Internal State * ' ' = Other Information * '-' = No internal state * 'X' = Internal state, initial value is unknown * 'I' = Internal state, initial value is known and follows (I) * * Declaration/Size * ' ' = Other Information * '-' = Does Not Apply * 'V' = Type is void * 'U' = Type is unsigned integer * 'S' = Type is signed integer * 'F' = Type is IEEE floating point * '1' = Byte size (008) * '2' = Short size (016) * '3' = Three byte size (024) * '4' = Word size (032) * '8' = Double size (064) * * Define Indicator * ' ' = Other Information * 'D' = Device * 'M' = Memory * 'R' = Register * 'A' = Array of Registers * 'F' = Field * 'V' = Value * 'T' = Task
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.