📄 psc_i2c.lst
字号:
73:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 0; 74:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 75:/mnt/hgfs/boot/booter/source/psc_i2c.c **** // Write data 76:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(stop && (i == (len - 1))) 77:/mnt/hgfs/boot/booter/source/psc_i2c.c **** { 78:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(stop == 1)GAS LISTING /tmp/ccmjNVoP.s page 7 79:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->txrx = *data | PSC_SMB_TXRX_STP; 80:/mnt/hgfs/boot/booter/source/psc_i2c.c **** else 81:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->txrx = *data | PSC_SMB_TXRX_RSR; 82:/mnt/hgfs/boot/booter/source/psc_i2c.c **** } 83:/mnt/hgfs/boot/booter/source/psc_i2c.c **** else 84:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->txrx = *data++; 85:/mnt/hgfs/boot/booter/source/psc_i2c.c **** } 86:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 87:/mnt/hgfs/boot/booter/source/psc_i2c.c **** // Wait transfer 88:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(!i2c_wait_status(PSC_SMB_STS_TE, 1, I2C_CMD_TIMEOUT)) 89:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 0; 90:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 91:/mnt/hgfs/boot/booter/source/psc_i2c.c **** // Check ack 92:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if (smb->evnt & (PSC_SMB_EVNT_DN | PSC_SMB_EVNT_AN | PSC_SMB_EVNT_AL)) 93:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 0; 94:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 95:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 1; 96:/mnt/hgfs/boot/booter/source/psc_i2c.c **** } 260 .loc 1 96 0 261 .loc 1 72 0 262 01ac 2F004010 beq $2,$0,$L34 263 01b0 3400BF8F lw $31,52($sp) 264 265 .loc 1 76 0 266 01b4 0300A012 beq $21,$0,$L25 267 01b8 00000000 nop 268 269 01bc 24009112 beq $20,$17,$L36 270 01c0 00000000 nop 271 272 $L25: 273 .loc 1 84 0 274 01c4 00000392 lbu $3,0($16) 275 01c8 0000628E lw $2,%lo(smb)($19) 276 01cc 01001026 addiu $16,$16,1 277 01d0 1C0043AC sw $3,28($2) 278 .loc 1 69 0 279 01d4 01003126 addiu $17,$17,1 280 $L38: 281 01d8 2A103202 slt $2,$17,$18 282 .loc 1 72 0 283 .loc 1 69 0 284 01dc F0FF4014 bne $2,$0,$L39 285 01e0 00040424 li $4,1024 # 0x400 286 287 $L33: 288 .loc 1 88 0 289 01e4 01000524 li $5,1 # 0x1 290 01e8 00020424 li $4,512 # 0x200 291 01ec 0000000C jal i2c_wait_status 292 01f0 64000624 li $6,100 # 0x64 293 294 .loc 1 89 0 295 .loc 1 88 0 296 01f4 09004010 beq $2,$0,$L20 297 01f8 21280000 move $5,$0 298 GAS LISTING /tmp/ccmjNVoP.s page 8 299 .loc 1 92 0 300 01fc 0000023C lui $2,%hi(smb) 301 0200 0000448C lw $4,%lo(smb)($2) 302 0204 0070033C li $3,1879048192 # 0x70000000 303 0208 1800828C lw $2,24($4) 304 020c 24104300 and $2,$2,$3 305 .loc 1 96 0 306 .loc 1 92 0 307 0210 03004014 bne $2,$0,$L40 308 0214 3400BF8F lw $31,52($sp) 309 310 .loc 1 95 0 311 0218 01000524 li $5,1 # 0x1 312 $L20: 313 .loc 1 96 0 314 021c 3400BF8F lw $31,52($sp) 315 $L40: 316 0220 3000BE8F lw $fp,48($sp) 317 0224 2C00B78F lw $23,44($sp) 318 0228 2800B68F lw $22,40($sp) 319 022c 2400B58F lw $21,36($sp) 320 0230 2000B48F lw $20,32($sp) 321 0234 1C00B38F lw $19,28($sp) 322 0238 1800B28F lw $18,24($sp) 323 023c 1400B18F lw $17,20($sp) 324 0240 1000B08F lw $16,16($sp) 325 0244 2110A000 move $2,$5 326 0248 0800E003 j $31 327 024c 3800BD27 addiu $sp,$sp,56 328 329 $L36: 330 .loc 1 81 0 331 .loc 1 78 0 332 0250 1300B612 beq $21,$22,$L37 333 0254 0000638E lw $3,%lo(smb)($19) 334 335 .loc 1 81 0 336 0258 00000292 lbu $2,0($16) 337 025c 25105700 or $2,$2,$23 338 0260 1C0062AC sw $2,28($3) 339 .loc 1 69 0 340 0264 76000008 j $L38 341 0268 01003126 addiu $17,$17,1 342 343 $L34: 344 .loc 1 96 0 345 026c 3000BE8F lw $fp,48($sp) 346 0270 2C00B78F lw $23,44($sp) 347 0274 2800B68F lw $22,40($sp) 348 0278 2400B58F lw $21,36($sp) 349 027c 2000B48F lw $20,32($sp) 350 0280 1C00B38F lw $19,28($sp) 351 0284 1800B28F lw $18,24($sp) 352 0288 1400B18F lw $17,20($sp) 353 028c 1000B08F lw $16,16($sp) 354 .loc 1 73 0 355 0290 21280000 move $5,$0GAS LISTING /tmp/ccmjNVoP.s page 9 356 .loc 1 96 0 357 0294 2110A000 move $2,$5 358 0298 0800E003 j $31 359 029c 3800BD27 addiu $sp,$sp,56 360 361 $L37: 362 .loc 1 79 0 363 02a0 00000292 lbu $2,0($16) 364 02a4 25105E00 or $2,$2,$fp 365 .loc 1 81 0 366 02a8 1C0062AC sw $2,28($3) 367 .loc 1 69 0 368 02ac 76000008 j $L38 369 02b0 01003126 addiu $17,$17,1 370 371 .set macro 372 .set reorder 373 $LFE5: 374 .end i2c_write_data 375 .align 2 376 .globl i2cOpen 377 .ent i2cOpen 378 .type i2cOpen, @function 379 i2cOpen: 380 $LFB7: 97:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 98:/mnt/hgfs/boot/booter/source/psc_i2c.c **** static int i2c_read_data(uint8* data, int len) 99:/mnt/hgfs/boot/booter/source/psc_i2c.c **** { 100:/mnt/hgfs/boot/booter/source/psc_i2c.c **** int i; 101:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 102:/mnt/hgfs/boot/booter/source/psc_i2c.c **** for(i = 0; i < len; i++) 103:/mnt/hgfs/boot/booter/source/psc_i2c.c **** { 104:/mnt/hgfs/boot/booter/source/psc_i2c.c **** // Write data 105:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(i == (len - 1)) 106:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->txrx = PSC_SMB_TXRX_STP; 107:/mnt/hgfs/boot/booter/source/psc_i2c.c **** else 108:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->txrx = 0; 109:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 110:/mnt/hgfs/boot/booter/source/psc_i2c.c **** // Wait fifo not empty 111:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(!i2c_wait_status(PSC_SMB_STS_RE, 0, I2C_CMD_TIMEOUT)) 112:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 0; 113:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 114:/mnt/hgfs/boot/booter/source/psc_i2c.c **** // read data 115:/mnt/hgfs/boot/booter/source/psc_i2c.c **** *data++ = PSC_SMB_TXRX_AD_N(smb->txrx); 116:/mnt/hgfs/boot/booter/source/psc_i2c.c **** } 117:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 118:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 1; 119:/mnt/hgfs/boot/booter/source/psc_i2c.c **** } 120:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 121:/mnt/hgfs/boot/booter/source/psc_i2c.c **** /* Public Functions */ 122:/mnt/hgfs/boot/booter/source/psc_i2c.c **** int i2cOpen() 123:/mnt/hgfs/boot/booter/source/psc_i2c.c **** { 381 .loc 1 123 0 382 .frame $sp,24,$31 # vars= 0, regs= 2/0, args= 16, gp= 0 383 .mask 0x80010000,-4 384 .fmask 0x00000000,0 385 .set noreorderGAS LISTING /tmp/ccmjNVoP.s page 10 386 .set nomacro 387 388 02b4 E8FFBD27 addiu $sp,$sp,-24 389 $LCFI20: 390 02b8 1000B0AF sw $16,16($sp) 391 $LCFI21: 392 02bc 1400BFAF sw $31,20($sp) 393 $LCFI22: 124:/mnt/hgfs/boot/booter/source/psc_i2c.c **** /* Configure I2C clocks */ 125:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->freqctrl0 &= ~(SYS_FREQCTRL0_FRDIV1 | SYS_FREQCTRL0_FS1); 394 .loc 1 125 0 395 02c0 0000023C lui $2,%hi(sys) 396 02c4 0400458C lw $5,%lo(sys)($2) 397 02c8 F0FF023C li $2,-1048576 # 0xfffffffffff00000 398 02cc FF0B4234 ori $2,$2,0xbff 399 02d0 2000A38C lw $3,32($5) 126:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->freqctrl0 |= SYS_FREQCTRL0_FRDIV1_N(8) | SYS_FREQCTRL0_FE1; 127:/mnt/hgfs/boot/booter/source/psc_i2c.c **** #if (SMBUS_PSC_BASE == PSC0_PHYS_ADDR) 128:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->clksrc &= ~(SYS_CLKSRC_ME0 | SYS_CLKSRC_DE0 | SYS_CLKSRC_CE0); 129:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->clksrc |= SYS_CLKSRC_ME0_N(SYS_CLKSRC_MUX_FREQ1); 130:/mnt/hgfs/boot/booter/source/psc_i2c.c **** #else 131:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->clksrc &= ~(SYS_CLKSRC_ME1 | SYS_CLKSRC_DE1 | SYS_CLKSRC_CE1); 132:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->clksrc |= SYS_CLKSRC_ME1_N(SYS_CLKSRC_MUX_FREQ1); 133:/mnt/hgfs/boot/booter/source/psc_i2c.c **** #endif 134:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 135:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 136:/mnt/hgfs/boot/booter/source/psc_i2c.c **** /* Configure I2C signals MUXings */ 137:/mnt/hgfs/boot/booter/source/psc_i2c.c **** #if (SMBUS_PSC_BASE == PSC0_PHYS_ADDR) 138:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->pinfunc &= ~SYS_PINFUNC_P0B; 139:/mnt/hgfs/boot/booter/source/psc_i2c.c **** #else 140:/mnt/hgfs/boot/booter/source/psc_i2c.c **** sys->pinfunc = sys->pinfunc & (~SYS_PINFUNC_P1A) | SYS_PINFUNC_P1A_N(1); 141:/mnt/hgfs/boot/booter/source/psc_i2c.c **** #endif 142:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 143:/mnt/hgfs/boot/booter/source/psc_i2c.c **** /* Configure SMBus Command Connection */ 144:/mnt/hgfs/boot/booter/source/psc_i2c.c **** DPRINTF("Configuring SMBus\n"); 145:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->psc.sel = PSC_SEL_PS_SMB | PSC_SEL_CLK_TOY; // configure PSC 400 .loc 1 145 0 401 02d4 0000103C lui $16,%hi(smb) 402 02d8 0000068E lw $6,%lo(smb)($16) 403 .loc 1 125 0 404 02dc 24186200 and $3,$3,$2 405 02e0 2000A3AC sw $3,32($5) 406 .loc 1 126 0 407 02e4 2000A28C lw $2,32($5) 408 .loc 1 140 0 409 02e8 2000043C li $4,2097152 # 0x200000 410 .loc 1 126 0 411 02ec 00384234 ori $2,$2,0x3800 412 02f0 2000A2AC sw $2,32($5) 413 .loc 1 131 0 414 02f4 2800A38C lw $3,40($5) 415 02f8 FFC1023C li $2,-1040252928 # 0xffffffffc1ff0000 416 02fc FFFF4234 ori $2,$2,0xffff 417 0300 24186200 and $3,$3,$2 418 0304 2800A3AC sw $3,40($5) 419 .loc 1 132 0 420 0308 2800A28C lw $2,40($5)GAS LISTING /tmp/ccmjNVoP.s page 11 421 030c 0018033C li $3,402653184 # 0x18000000 422 0310 25104300 or $2,$2,$3 423 0314 2800A2AC sw $2,40($5) 424 .loc 1 140 0 425 0318 2C00A38C lw $3,44($5) 426 031c 9FFF023C li $2,-6356992 # 0xffffffffff9f0000 427 0320 FFFF4234 ori $2,$2,0xffff 428 0324 24186200 and $3,$3,$2 429 0328 25186400 or $3,$3,$4 430 032c 2C00A3AC sw $3,44($5) 431 .loc 1 145 0 432 0330 05000224 li $2,5 # 0x5 146:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->psc.ctl = PSC_CTL_CE | PSC_CTL_EN; // enable PSC 433 .loc 1 146 0 434 0334 03000324 li $3,3 # 0x3 435 .loc 1 145 0 436 0338 0000C2AC sw $2,0($6) 147:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(!i2c_wait_status(PSC_SMB_STS_SR, 1, I2C_OPEN_TIMEOUT)) // wait for PSC ready 437 .loc 1 147 0 438 033c 01000424 li $4,1 # 0x1 439 .loc 1 146 0 440 0340 0400C3AC sw $3,4($6) 441 .loc 1 147 0 442 0344 01000524 li $5,1 # 0x1 443 0348 0000000C jal i2c_wait_status 444 034c 64000624 li $6,100 # 0x64 445 148:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 0; 149:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 150:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->cfg = PSC_SMB_CFG_SDIV_N(2) // clk / 8 151:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_CFG_TRD_N(0) // Tx FIFO threshold = 1 152:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_CFG_RRD_N(0) // Rx FIFO threshold = 1 153:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_CFG_DD; // Disable DDMA 154:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 155:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->msk |= PSC_SMB_MSK_ALL; // All Interrupts Masked 156:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 157:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->tmr = PSC_SMB_TMR_CH_N(0x0F) // Clock High hold time 158:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_TMR_CL_N(0x0F) // Clock Low hold time 159:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_TMR_SU_N(0x0F) // Start setup time 160:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_TMR_SH_N(0x0F) // Start hold time 161:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_TMR_PU_N(0x0F) // Stop setup time 162:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_TMR_PS_N(0x0F) // Stop->Start wait time 163:/mnt/hgfs/boot/booter/source/psc_i2c.c **** | PSC_SMB_TMR_TH_N(0); // Transmit Data hold time 164:/mnt/hgfs/boot/booter/source/psc_i2c.c **** 165:/mnt/hgfs/boot/booter/source/psc_i2c.c **** smb->cfg |= PSC_SMB_CFG_DE; // Enable device 166:/mnt/hgfs/boot/booter/source/psc_i2c.c **** if(!i2c_wait_status(PSC_SMB_STS_DR, 1, I2C_OPEN_TIMEOUT)) // wait for device ready 446 .loc 1 166 0 447 0350 02000424 li $4,2 # 0x2 448 0354 01000524 li $5,1 # 0x1 449 0358 64000624 li $6,100 # 0x64 450 .loc 1 148 0 451 .loc 1 147 0 452 035c 06004014 bne $2,$0,$L44 453 0360 21180000 move $3,$0 454 167:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 0; 168:/mnt/hgfs/boot/booter/source/psc_i2c.c **** GAS LISTING /tmp/ccmjNVoP.s page 12 169:/mnt/hgfs/boot/booter/source/psc_i2c.c **** return 1; 170:/mnt/hgfs/boot/booter/source/psc_i2c.c **** } 455 .loc 1 170 0 456 0364 1400BF8F lw $31,20($sp) 457 0368 1000B08F lw $16,16($sp) 458 036c 21106000 move $2,$3 459 0370 0800E003 j $31 460 0374 1800BD27 addiu $sp,$sp,24 461 462 $L44: 463 .loc 1 150 0 464 0378 0000078E lw $7,%lo(smb)($16) 465 037c 0008023C li $2,134217728 # 0x8000000 466 0380 00404234 ori $2,$2,0x4000 467 0384 0800E2AC sw $2,8($7) 468 .loc 1 155 0 469 0388 0C00E38C lw $3,12($7) 470 038c 0170023C li $2,1879113728 # 0x70010000 471 0390 301B4234 ori $2,$2,0x1b30 472 0394 25186200 or $3,$3,$2 473 .loc 1 157 0 474 0398 F71E023C li $2,519503872 # 0x1ef70000 475 039c EFBD4234 ori $2,$2,0xbdef 476 .loc 1 155 0 477 03a0 0C00E3AC sw $3,12($7) 478 .loc 1 157 0 479 03a4 2000E2AC sw $2,32($7) 480 .loc 1 165 0 481 03a8 0800E38C lw $3,8($7) 482 03ac 0004023C li $2,67108864 # 0x4000000 483 03b0 25186200 or $3,$3,$2 484 03b4 0800E3AC sw $3,8($7) 485 .loc 1 166 0 486 03b8 0000000C jal i2c_wait_status 487 03bc 00000000 nop 488 489 .loc 1 170 0 490 03c0 1400BF8F lw $31,20($sp) 491 03c4 1000B08F lw $16,16($sp) 492 .loc 1 167 0 493 03c8 2B180200 sltu $3,$0,$2 494 .loc 1 170 0 495 03cc 21106000 move $2,$3 496 03d0 0800E003 j $31 497 03d4 1800BD27 addiu $sp,$sp,24
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -