📄 xllp_ac97.cod
字号:
00008 |$M1474|
00008 e1a04000 mov r4, r0
; 74 : XLLP_AC97_ERROR_T status ;
; 75 : P_XLLP_GPIO_T pGPIO = pAc97ctxt->pGpioReg;
; 76 : P_XLLP_INTC_T pINTC = pAc97ctxt->pIntcReg;
; 77 : P_XLLP_CLKMGR_T pCLKMGR = pAc97ctxt->pClockReg;
; 78 : XLLP_UINT32_T pins[6], fn[6];
; 79 :
; 80 : // Set bitclk, sdata_in_0
; 81 : pins[0] = 2;
; 82 : pins[1] = XLLP_GPIO_AC97BITCLK;
; 83 : pins[2] = XLLP_GPIO_AC97_SDATA_IN_0;
; 84 : fn[0] = 2;
; 85 : fn[1] = XLLP_GPIO_ALT_FN_1;
; 86 : fn[2] = XLLP_GPIO_ALT_FN_1;
; 87 : if (XLLP_TRUE == pAc97ctxt->useSecondaryCodec)
0000c e5943018 ldr r3, [r4, #0x18]
00010 e3a0101c mov r1, #0x1C
00014 e3a0001d mov r0, #0x1D
00018 e5945000 ldr r5, [r4]
0001c e3530001 cmp r3, #1
00020 e3a02002 mov r2, #2
00024 e3a0e002 mov lr, #2
00028 e58d1004 str r1, [sp, #4]
0002c e58d0008 str r0, [sp, #8]
; 88 : {
; 89 : pins[0] = 3;
; 90 : pins[3] = XLLP_GPIO_KP_MKIN5; // use this pin as AC97_SDATA_IN_1
; 91 : fn[0] = 3;
00030 03a01003 moveq r1, #3
; 92 : fn[3] = XLLP_GPIO_ALT_FN_2;
00034 03a00002 moveq r0, #2
00038 e58d2000 str r2, [sp]
0003c e58de018 str lr, [sp, #0x18]
00040 058d1018 streq r1, [sp, #0x18]
00044 058d0024 streq r0, [sp, #0x24]
00048 e3a08001 mov r8, #1
0004c e3a09001 mov r9, #1
00050 e5946010 ldr r6, [r4, #0x10]
00054 e5947004 ldr r7, [r4, #4]
00058 03a03003 moveq r3, #3
0005c 03a02063 moveq r2, #0x63
; 93 : }
; 94 : XllpGpioSetDirectionIn(pGPIO, pins);
00060 e28d1000 add r1, sp, #0
00064 e1a00005 mov r0, r5
00068 e58d801c str r8, [sp, #0x1C]
0006c e58d9020 str r9, [sp, #0x20]
00070 058d3000 streq r3, [sp]
00074 058d200c streq r2, [sp, #0xC]
00078 eb000000 bl XllpGpioSetDirectionIn
; 95 : XllpGpioSetAlternateFn(pGPIO, pins, fn);
0007c e28d2018 add r2, sp, #0x18
00080 e28d1000 add r1, sp, #0
00084 e1a00005 mov r0, r5
00088 eb000000 bl XllpGpioSetAlternateFn
; 96 :
; 97 : // Set sdata_out, sync, sysclock
; 98 : pins[0] = 2;
; 99 : pins[1] = XLLP_GPIO_AC97_SDATA_OUT;
; 100 : pins[2] = XLLP_GPIO_AC97_SYNC;
0008c e3a0101f mov r1, #0x1F
; 101 : // pins[3] = XLLP_GPIO_KP_MKIN4; // use this pin as AC97_SYSCLK
; 102 : fn[0] = 2;
00090 e3a00002 mov r0, #2
; 103 : fn[1] = XLLP_GPIO_ALT_FN_2;
; 104 : fn[2] = XLLP_GPIO_ALT_FN_2;
00094 e58d1008 str r1, [sp, #8]
00098 e58d0018 str r0, [sp, #0x18]
0009c e3a03002 mov r3, #2
000a0 e3a0201e mov r2, #0x1E
000a4 e3a0e002 mov lr, #2
000a8 e3a08002 mov r8, #2
; 105 : // fn[3] = XLLP_GPIO_ALT_FN_1;
; 106 : XllpGpioSetOutputState1(pGPIO, pins);
000ac e28d1000 add r1, sp, #0
000b0 e1a00005 mov r0, r5
000b4 e58d3000 str r3, [sp]
000b8 e58d2004 str r2, [sp, #4]
000bc e58de01c str lr, [sp, #0x1C]
000c0 e58d8020 str r8, [sp, #0x20]
000c4 eb000000 bl XllpGpioSetOutputState1
; 107 : XllpGpioSetDirectionOut(pGPIO, pins);
000c8 e28d1000 add r1, sp, #0
000cc e1a00005 mov r0, r5
000d0 eb000000 bl XllpGpioSetDirectionOut
; 108 : XllpGpioSetAlternateFn(pGPIO, pins, fn);
000d4 e28d2018 add r2, sp, #0x18
000d8 e28d1000 add r1, sp, #0
000dc e1a00005 mov r0, r5
000e0 eb000000 bl XllpGpioSetAlternateFn
; 109 :
; 110 : // Set sdata_reset_n
; 111 : pins[0] = 1;
; 112 : pins[1] = XLLP_GPIO_AC97_RESET_n;
; 113 : fn[0] = 1;
000e4 e3a01001 mov r1, #1
; 114 : fn[1] = XLLP_GPIO_ALT_FN_0;
000e8 e3a00000 mov r0, #0
000ec e58d1018 str r1, [sp, #0x18]
000f0 e58d001c str r0, [sp, #0x1C]
000f4 e3a03001 mov r3, #1
000f8 e3a02071 mov r2, #0x71
; 115 : XllpGpioSetOutput0(pGPIO, pins);
000fc e28d1000 add r1, sp, #0
00100 e1a00005 mov r0, r5
00104 e58d3000 str r3, [sp]
00108 e58d2004 str r2, [sp, #4]
0010c eb000000 bl XllpGpioSetOutput0
; 116 : XllpGpioSetDirectionOut(pGPIO, pins);
00110 e28d1000 add r1, sp, #0
00114 e1a00005 mov r0, r5
00118 eb000000 bl XllpGpioSetDirectionOut
; 117 : XllpGpioSetAlternateFn(pGPIO, pins, fn);
0011c e28d2018 add r2, sp, #0x18
00120 e28d1000 add r1, sp, #0
00124 e1a00005 mov r0, r5
00128 eb000000 bl XllpGpioSetAlternateFn
; 118 :
; 119 : // Disable of ACUNIT interrupt.
; 120 : pINTC->icmr &= ~XLLP_INTC_AC97;
0012c e5963004 ldr r3, [r6, #4]
; 121 :
; 122 : // Enable clocking of AC '97 controller device in processor
; 123 : pCLKMGR->cken |= XLLP_CLKEN_AC97;
; 124 :
; 125 : // Perform the cold reset.
; 126 : // Also enables the codec(s), control unit and the control unit's FIFOs
; 127 : status = XllpAc97ColdReset(pAc97ctxt);
00130 e1a00004 mov r0, r4
00134 e3c33901 bic r3, r3, #1, 18
00138 e5863004 str r3, [r6, #4]
0013c e5973004 ldr r3, [r7, #4]
00140 e3833004 orr r3, r3, #4
00144 e5873004 str r3, [r7, #4]
00148 eb000000 bl XllpAc97ColdReset
; 128 :
; 129 : return (status);
; 130 :
; 131 : } // End XllpAc97Init ()
0014c e28dd030 add sp, sp, #0x30
00150 e8bd43f0 ldmia sp!, {r4 - r9, lr}
00154 e12fff1e bx lr
00158 |$M1475|
ENDP ; |XllpAc97Init|
EXPORT |XllpAc97DeInit|
IMPORT |XllpGpioClearAlternateFn|
00000 AREA |.text| { |XllpAc97DeInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$XllpAc97DeInit|, PDATA, SELECTION=5, ASSOC=|.text| { |XllpAc97DeInit| } ; comdat associative
|$T1491| DCD |$L1490|
DCD 0x40002f02
; Function compile flags: /Ogsy
00000 AREA |.text| { |XllpAc97DeInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |XllpAc97DeInit| PROC
; 158 : {
00000 |$L1490|
00000 e92d43f0 stmdb sp!, {r4 - r9, lr}
00004 e24dd020 sub sp, sp, #0x20
00008 |$M1488|
00008 e1a04000 mov r4, r0
; 159 : XLLP_AC97_ERROR_T status ;
; 160 : P_XLLP_GPIO_T pGPIO = pAc97ctxt->pGpioReg;
; 161 : P_XLLP_INTC_T pINTC = pAc97ctxt->pIntcReg;
; 162 : P_XLLP_CLKMGR_T pCLKMGR = pAc97ctxt->pClockReg;
; 163 : XLLP_UINT32_T pins[8];
; 164 :
; 165 : status = XllpAc97ShutdownAclink(pAc97ctxt->pAc97Reg, pAc97ctxt->pOstRegs);
0000c e594100c ldr r1, [r4, #0xC]
00010 e5940008 ldr r0, [r4, #8]
00014 e5945000 ldr r5, [r4]
00018 e5947010 ldr r7, [r4, #0x10]
0001c e5948004 ldr r8, [r4, #4]
00020 eb000000 bl XllpAc97ShutdownAclink
00024 e1b06000 movs r6, r0
; 166 :
; 167 : if (XLLP_AC97_NO_ERROR == status)
00028 1a00001f bne |$L1255|
; 168 : {
; 169 : // Disable of ACUNIT interrupt.
; 170 : pINTC->icmr &= ~XLLP_INTC_AC97;
0002c e5973004 ldr r3, [r7, #4]
; 171 :
; 172 : // Disable clocking of AC '97 controller device in processor
; 173 : pCLKMGR->cken &= ~XLLP_CLKEN_AC97;
; 174 :
; 175 : // Set all pins to default general input configuration.
; 176 : pins[0] = 6;
; 177 : pins[1] = XLLP_GPIO_AC97BITCLK;
; 178 : pins[2] = XLLP_GPIO_AC97_SDATA_IN_0;
; 179 : pins[3] = XLLP_GPIO_AC97_SDATA_OUT;
; 180 : pins[4] = XLLP_GPIO_AC97_SYNC;
; 181 : pins[5] = XLLP_GPIO_KP_MKIN4; // use this pin as AC97_SYSCLK
; 182 : pins[6] = XLLP_GPIO_AC97_RESET_n;
; 183 :
; 184 : if (XLLP_TRUE == pAc97ctxt->useSecondaryCodec)
00030 e3a0201c mov r2, #0x1C
00034 e3a0101d mov r1, #0x1D
00038 e3c33901 bic r3, r3, #1, 18
0003c e5873004 str r3, [r7, #4]
00040 e5983004 ldr r3, [r8, #4]
00044 e3a0001e mov r0, #0x1E
00048 e3a09006 mov r9, #6
0004c e3c33004 bic r3, r3, #4
00050 e5883004 str r3, [r8, #4]
00054 e5943018 ldr r3, [r4, #0x18]
00058 e58d2004 str r2, [sp, #4]
0005c e3a0e01f mov lr, #0x1F
00060 e3530001 cmp r3, #1
; 185 : {
; 186 : pins[0] = 7;
00064 03a03007 moveq r3, #7
; 187 : pins[7] = XLLP_GPIO_KP_MKIN5; // use this pin as AC97_SDATA_IN_1
00068 03a02063 moveq r2, #0x63
0006c e3a04062 mov r4, #0x62
00070 e3a07071 mov r7, #0x71
00074 e58d1008 str r1, [sp, #8]
00078 e58d000c str r0, [sp, #0xC]
0007c e58d9000 str r9, [sp]
; 188 : }
; 189 : XllpGpioSetDirectionIn(pGPIO, pins);
00080 e28d1000 add r1, sp, #0
00084 e1a00005 mov r0, r5
00088 058d3000 streq r3, [sp]
0008c 058d201c streq r2, [sp, #0x1C]
00090 e58de010 str lr, [sp, #0x10]
00094 e58d4014 str r4, [sp, #0x14]
00098 e58d7018 str r7, [sp, #0x18]
0009c eb000000 bl XllpGpioSetDirectionIn
; 190 : XllpGpioClearAlternateFn(pGPIO, pins);
000a0 e28d1000 add r1, sp, #0
000a4 e1a00005 mov r0, r5
000a8 eb000000 bl XllpGpioClearAlternateFn
000ac |$L1255|
; 191 : }
; 192 :
; 193 : return (status);
000ac e1a00006 mov r0, r6
; 194 : }
000b0 e28dd020 add sp, sp, #0x20
000b4 e8bd43f0 ldmia sp!, {r4 - r9, lr}
000b8 e12fff1e bx lr
000bc |$M1489|
ENDP ; |XllpAc97DeInit|
EXPORT |XllpAc97Write|
00000 AREA |.text| { |XllpAc97Write| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$XllpAc97Write|, PDATA, SELECTION=5, ASSOC=|.text| { |XllpAc97Write| } ; comdat associative
|$T1519| DCD |$L1518|
DCD 0x40003b02
; Function compile flags: /Ogsy
00000 AREA |.text| { |XllpAc97Write| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |XllpAc97Write| PROC
; 279 : {
00000 |$L1518|
00000 e92d47f0 stmdb sp!, {r4 - r10, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M1516|
00008 e1a0a003 mov r10, r3
0000c e1a04002 mov r4, r2
00010 e1a08001 mov r8, r1
; 280 : XLLP_AC97_ERROR_T status = XLLP_AC97_NO_ERROR;
; 281 : XLLP_BOOL_T gotLink;
; 282 : XLLP_UINT32_T timeRemaining;
; 283 : P_XLLP_VUINT32_T pCodecReg;
; 284 :
; 285 : // Point to specified register within area mapped to target codec regs
; 286 :
; 287 : // Check for special case register 54h the GPIO status register
; 288 :
; 289 : if(offset == XLLP_AC97_CR_E_MDM_GPIO_PIN_STAT)
; 290 : {
; 291 : #ifdef WM9712
; 292 :
; 293 : // This is a work around for the WM9712 GPIO status issue.
; 294 : // Note that the WM9712 can only be used as a primary
; 295 : // AC97 device.
; 296 :
; 297 : XLLP_UINT16_T offsetdata = data << 1;
; 298 :
; 299 : pCodecReg = &(pAc97Reg->CodecRegsPrimaryAud[0]);
; 300 :
; 301 : pCodecReg += offset / XLLP_AC97_CODEC_REGS_PER_WORD;
; 302 :
; 303 : // The data will be sent out on slots 1&2 to register 54h.
; 304 : *pCodecReg = (XLLP_VUINT32_T)data;
; 305 :
; 306 : pCodecReg = &(pAc97Reg->CodecRegsPrimaryMdm[0]);
; 307 :
; 308 : pCodecReg += offset / XLLP_AC97_CODEC_REGS_PER_WORD;
; 309 :
; 310 : // The data will be sent out on slot 12.
; 311 : *pCodecReg = (XLLP_VUINT32_T)offsetdata;
; 312 :
; 313 : #else
; 314 : // Select the Primary or Secondary modem IO address space
; 315 : if (XLLP_AC97_CODEC_PRIMARY == codecSel)
00014 e59d3028 ldr r3, [sp, #0x28]
00018 e3a05000 mov r5, #0
0001c e3500054 cmp r0, #0x54
00020 1a000006 bne |$L1283|
00024 e3530000 cmp r3, #0
; 316 : pCodecReg = &(pAc97Reg->CodecRegsPrimaryMdm[0]);
00028 02843b01 addeq r3, r4, #1, 22
; 317 : else
; 318 : pCodecReg = &(pAc97Reg->CodecRegsSecondaryMdm[0]);
; 319 :
; 320 : pCodecReg += offset / XLLP_AC97_CODEC_REGS_PER_WORD;
; 321 :
; 322 : // The data will be sent out on slot 12.
; 323 : *pCodecReg = data;
0002c 058380a8 streq r8, [r3, #0xA8]
00030 0a000029 beq |$done$1286|
00034 e2843c05 add r3, r4, #5, 24
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -