I ask because I havent stopped searching the code to find out what's wrong with the audio.
I found one major issue in I2S_PowerOnInit, I think connected with Scu_ClockEnable function.
Here is the code from the compiled SDK:
Code:
ROM:60009AD0 I2S_PowerOnInit ; CODE XREF: Audio_Init+8p
ROM:60009AD0 ; UHInitialiseFirst+18p
ROM:60009AD0 STMFD SP!, {R4,LR}
ROM:60009AD4 MOV R4, R0
ROM:60009AD8 LDR R0, =0x1801C018
ROM:60009ADC LDR R1, [R0]
ROM:60009AE0 MOV R2, #0x10000
ROM:60009AE4 BIC R1, R1, R2
ROM:60009AE8 STR R1, [R0]
ROM:60009AEC LDR R1, [R0]
ROM:60009AF0 MOV R2, #0x20000
ROM:60009AF4 BIC R1, R1, R2
ROM:60009AF8 STR R1, [R0]
ROM:60009AFC MOV R0, #0x64
ROM:60009B00
ROM:60009B00 loc_60009B00 ; CODE XREF: I2S_PowerOnInit+34j
ROM:60009B00 SUBS R0, R0, #1
ROM:60009B04 BNE loc_60009B00
ROM:60009B08 MOV R0, #0xF
ROM:60009B0C BL Intr_Disable
The function Scu_ClockEnable is an inline type, so no redirection in the code is performed.
But in the FW with well working audio it look like this:
Code:
ROM:60009858 I2S_PowerOnInit ; CODE XREF: Audio_Init+8p
ROM:60009858 ; UHInitialiseFirst+2Cp
ROM:60009858 STMFD SP!, {R4,LR}
ROM:6000985C MOV R4, R0
ROM:60009860 MOV R0, #0x10
ROM:60009864 BL _I2S_EnableClock
ROM:60009868 MOV R0, #0x11
ROM:6000986C BL _I2S_EnableClock
ROM:60009870 MOV R0, #0x64
ROM:60009874
ROM:60009874 loc_60009874 ; CODE XREF: I2S_PowerOnInit+20j
ROM:60009874 SUBS R0, R0, #1
ROM:60009878 BNE loc_60009874
ROM:6000987C MOV R0, #0xF
ROM:60009880 BL Intr_Disable
there is this function introduced _I2S_EnableClock (my name). The function doesn't exist in SDK at all. This is its code:
Code:
ROM:600E28BC _I2S_EnableClock ; CODE XREF: sub_600022B8+2Cp
ROM:600E28BC ; sub_600029F0+3Cp ...
ROM:600E28BC LDR R3, =0x1801C000
ROM:600E28C0 LDR R1, [R3,#0x18]
ROM:600E28C4 MOV R2, #1
ROM:600E28C8 BIC R0, R1, R2,LSL R0
ROM:600E28CC STR R0, [R3,#0x18]
ROM:600E28D0 BX LR
ROM:600E28D0 ; End of function _I2S_EnableClock
if someone know how to translate it to C or how to put this code in *.s file to add it to ADS I would be glad. Perhaps this is the reason.