comparison pirelli/fw-disasm @ 257:01030ff953a2

pirelli/fw-disasm: beginning of pwr_liion_cha code
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Dec 2017 03:28:22 +0000
parents dbcfb097ffe1
children 61d8d70ca7b0
comparison
equal deleted inserted replaced
256:dbcfb097ffe1 257:01030ff953a2
478 406c4: e4d13001 ldrb r3, [r1], #1 478 406c4: e4d13001 ldrb r3, [r1], #1
479 406c8: e4c03001 strb r3, [r0], #1 479 406c8: e4c03001 strb r3, [r0], #1
480 406cc: e2522001 subs r2, r2, #1 480 406cc: e2522001 subs r2, r2, #1
481 406d0: 1afffffb bne 0x406c4 481 406d0: 1afffffb bne 0x406c4
482 406d4: e8bd8001 ldmia sp!, {r0, pc} 482 406d4: e8bd8001 ldmia sp!, {r0, pc}
483
484 2e21bc: b510 push {r4, lr}
485 2e21be: 2400 mov r4, #0
486 2e21c0: 489d ldr r0, =0x8036a8 ; via 0x2e2438
487 2e21c2: 6800 ldr r0, [r0, #0]
488 2e21c4: 2802 cmp r0, #2
489 2e21c6: d804 bhi 0x2e21d2
490 2e21c8: f0d1 ff6d bl 0x3b40a6
491 2e21cc: 2800 cmp r0, #0
492 2e21ce: d100 bne 0x2e21d2
493 2e21d0: 2401 mov r4, #1
494 2e21d2: 1c20 add r0, r4, #0
495 2e21d4: bd10 pop {r4, pc}
496
497 $pwr_start_CI_charging:
498 2e21d6: b510 push {r4, lr}
499 2e21d8: b083 sub sp, #12 ; 0xc
500 2e21da: 1c04 add r4, r0, #0
501 2e21dc: 4997 ldr r1, =0x1774b7a ; via 0x2e243c
502 2e21de: 2000 mov r0, #0
503 2e21e0: 8008 strh r0, [r1, #0]
504 ; start of MV100-matching code
505 2e21e2: 48f8 ldr r0, =0xa0020 ; via 0x2e25c4
506 2e21e4: 9000 str r0, [sp, #0]
507 2e21e6: a0f9 add r0, pc, #996 ; 0x3e4
508 2e21e8: 2111 mov r1, #17 ; 0x11
509 2e21ea: 2200 mov r2, #0
510 2e21ec: 43d2 mvn r2, r2
511 2e21ee: 2305 mov r3, #5
512 2e21f0: f0f8 fd20 bl 0x3dac34
513 2e21f4: 207d mov r0, #125 ; 0x7d
514 2e21f6: 00c0 lsl r0, r0, #3
515 2e21f8: 4344 mul r4, r0
516 2e21fa: 1c20 add r0, r4, #0
517 2e21fc: 4990 ldr r1, =0x357 ; via 0x2e2440
518 2e21fe: f115 f815 bl 0x3f722c ; I$DIV
519 2e2202: 4668 mov r0, sp
520 2e2204: 8101 strh r1, [r0, #8]
521 2e2206: 2001 mov r0, #1
522 2e2208: 213a mov r1, #58 ; 0x3a
523 2e220a: 2202 mov r2, #2
524 2e220c: f066 fffe bl 0x34920c
525 2e2210: 2001 mov r0, #1
526 2e2212: 2132 mov r1, #50 ; 0x32
527 2e2214: 466a mov r2, sp
528 2e2216: 8912 ldrh r2, [r2, #8]
529 2e2218: f066 fff8 bl 0x34920c
530 2e221c: 2001 mov r0, #1
531 2e221e: 213a mov r1, #58 ; 0x3a
532 2e2220: 2203 mov r2, #3
533 2e2222: f066 fff3 bl 0x34920c
534 2e2226: 48e8 ldr r0, =0x1774e70 ; via 0x2e25c8
535 2e2228: 6800 ldr r0, [r0, #0]
536 2e222a: 2102 mov r1, #2
537 2e222c: 6041 str r1, [r0, #4]
538 ; end of MV100-matching code
539 2e222e: 4985 ldr r1, =0x17749b8 ; via 0x2e2444
540 2e2230: 2001 mov r0, #1
541 2e2232: 7008 strb r0, [r1, #0]
542 2e2234: b003 add sp, #12 ; 0xc
543 2e2236: bd10 pop {r4, pc}
544
545 $pwr_start_CV_charging:
546 2e2238: b510 push {r4, lr}
547 2e223a: b083 sub sp, #12 ; 0xc
548 2e223c: 1c04 add r4, r0, #0
549 2e223e: 497f ldr r1, =0x1774b7a ; via 0x2e243c
550 2e2240: 2001 mov r0, #1
551 2e2242: 8008 strh r0, [r1, #0]
552 2e2244: 48df ldr r0, =0xa0020 ; via 0x2e25c4
553 2e2246: 9000 str r0, [sp, #0]
554 2e2248: a0e5 add r0, pc, #916 ; 0x394
555 2e224a: 2111 mov r1, #17 ; 0x11
556 2e224c: 2200 mov r2, #0
557 2e224e: 43d2 mvn r2, r2
558 2e2250: 2305 mov r3, #5
559 2e2252: f0f8 fcef bl 0x3dac34
560 2e2256: 3414 add r4, #20 ; 0x14
561 2e2258: 0420 lsl r0, r4, #16
562 2e225a: 0c02 lsr r2, r0, #16
563 2e225c: 497a ldr r1, =0x801746 ; via 0x2e2448
564 2e225e: 2000 mov r0, #0
565 2e2260: 5e08 ldrsh r0, [r1, r0]
566 2e2262: 1a10 sub r0, r2, r0
567 2e2264: 0280 lsl r0, r0, #10
568 2e2266: 4979 ldr r1, =0x801734 ; via 0x2e244c
569 2e2268: 8809 ldrh r1, [r1, #0]
570 2e226a: f114 ffc7 bl 0x3f71fc
571 2e226e: 4668 mov r0, sp
572 2e2270: 8101 strh r1, [r0, #8]
573 2e2272: 8900 ldrh r0, [r0, #8]
574 2e2274: 4976 ldr r1, =0x17749ca ; via 0x2e2450
575 2e2276: 8008 strh r0, [r1, #0]
576 2e2278: 4976 ldr r1, =0x17749c6 ; via 0x2e2454
577 2e227a: 8008 strh r0, [r1, #0]
578 2e227c: 2000 mov r0, #0
579 2e227e: 4976 ldr r1, =0x17749c8 ; via 0x2e2458
580 2e2280: 8008 strh r0, [r1, #0]
581 2e2282: 4976 ldr r1, =0x17749c0 ; via 0x2e245c
582 2e2284: 8008 strh r0, [r1, #0]
583 2e2286: 4a76 ldr r2, =0x17749c4 ; via 0x2e2460
584 2e2288: 2103 mov r1, #3
585 2e228a: 8011 strh r1, [r2, #0]
586 2e228c: 4975 ldr r1, =0x17749c2 ; via 0x2e2464
587 2e228e: 8008 strh r0, [r1, #0]
588 2e2290: 4668 mov r0, sp
589 2e2292: 8902 ldrh r2, [r0, #8]
590 2e2294: 48cb ldr r0, =0xa0020 ; via 0x2e25c4
591 2e2296: 9000 str r0, [sp, #0]
592 2e2298: a0d6 add r0, pc, #856 ; 0x358
593 2e229a: 2113 mov r1, #19 ; 0x13
594 2e229c: 2305 mov r3, #5
595 2e229e: f0f8 fcc9 bl 0x3dac34
596 2e22a2: 2001 mov r0, #1
597 2e22a4: 213a mov r1, #58 ; 0x3a
598 2e22a6: 2200 mov r2, #0
599 2e22a8: f066 ffb0 bl 0x34920c
600 2e22ac: 2001 mov r0, #1
601 2e22ae: 2132 mov r1, #50 ; 0x32
602 2e22b0: 466a mov r2, sp
603 2e22b2: 8912 ldrh r2, [r2, #8]
604 2e22b4: f066 ffaa bl 0x34920c
605 2e22b8: 2001 mov r0, #1
606 2e22ba: 213a mov r1, #58 ; 0x3a
607 2e22bc: 2201 mov r2, #1
608 2e22be: f066 ffa5 bl 0x34920c
609 2e22c2: 48c1 ldr r0, =0x1774e70 ; via 0x2e25c8
610 2e22c4: 6801 ldr r1, [r0, #0]
611 2e22c6: 2003 mov r0, #3
612 2e22c8: 6048 str r0, [r1, #4]
613 2e22ca: f04b ffbc bl 0x32e246
614 2e22ce: 2002 mov r0, #2
615 2e22d0: f7cf fae5 bl 0x2b189e
616 2e22d4: 2001 mov r0, #1
617 2e22d6: 2122 mov r1, #34 ; 0x22
618 2e22d8: 2200 mov r2, #0
619 2e22da: f066 ff97 bl 0x34920c
620 2e22de: 2002 mov r0, #2
621 2e22e0: f7cf fadd bl 0x2b189e
622 2e22e4: 4857 ldr r0, =0x17749b8 ; via 0x2e2444
623 2e22e6: 2101 mov r1, #1
624 2e22e8: 7001 strb r1, [r0, #0]
625 2e22ea: b003 add sp, #12 ; 0xc
626 2e22ec: bd10 pop {r4, pc}
627
628 $pwr_stop_charging:
629 2e22ee: b500 push {lr}
630 2e22f0: b082 sub sp, #8
631 2e22f2: 48b4 ldr r0, =0xa0020 ; via 0x2e25c4
632 2e22f4: 9000 str r0, [sp, #0]
633 2e22f6: a0eb add r0, pc, #940 ; 0x3ac
634 2e22f8: 2115 mov r1, #21 ; 0x15
635 2e22fa: 2200 mov r2, #0
636 2e22fc: 43d2 mvn r2, r2
637 2e22fe: 2305 mov r3, #5
638 2e2300: f0f8 fc98 bl 0x3dac34
639 2e2304: 2001 mov r0, #1
640 2e2306: 213a mov r1, #58 ; 0x3a
641 2e2308: 2200 mov r2, #0
642 2e230a: f066 ff7f bl 0x34920c
643 2e230e: 48ae ldr r0, =0x1774e70 ; via 0x2e25c8
644 2e2310: 6800 ldr r0, [r0, #0]
645 2e2312: 2100 mov r1, #0
646 2e2314: 6041 str r1, [r0, #4]
647 ; additional code beyond MV100 version
648 2e2316: 48bc ldr r0, =0x1774b78 ; via 0x2e2608
649 2e2318: 80c1 strh r1, [r0, #6]
650 2e231a: 8101 strh r1, [r0, #8]
651 2e231c: 4849 ldr r0, =0x17749b8 ; via 0x2e2444
652 2e231e: 7001 strb r1, [r0, #0]
653 2e2320: b002 add sp, #8
654 2e2322: bd00 pop {pc}
655
656 $pwr_current_loop_cal:
657 2e2324: b500 push {lr}
658 2e2326: b082 sub sp, #8
659 ; "Current loop calibration" trace
660 2e2328: 48a6 ldr r0, =0xa0020 ; via 0x2e25c4
661 2e232a: 9000 str r0, [sp, #0]
662 2e232c: a0e3 add r0, pc, #908 ; 0x38c
663 2e232e: 2118 mov r1, #24 ; 0x18
664 2e2330: 2200 mov r2, #0
665 2e2332: 43d2 mvn r2, r2
666 2e2334: 2305 mov r3, #5
667 2e2336: f0f8 fc7d bl 0x3dac34
668 ; same as MV100 version
669 2e233a: 2001 mov r0, #1
670 2e233c: 213a mov r1, #58 ; 0x3a
671 2e233e: 2210 mov r2, #16 ; 0x10
672 2e2340: f066 ff64 bl 0x34920c
673 2e2344: 2001 mov r0, #1
674 2e2346: 213a mov r1, #58 ; 0x3a
675 2e2348: 2219 mov r2, #25 ; 0x19
676 2e234a: f066 ff5f bl 0x34920c
677 ; TIMER0 run for 22 ticks (probably 100 ms intended)
678 2e234e: 2000 mov r0, #0
679 2e2350: 2116 mov r1, #22 ; 0x16
680 2e2352: 2200 mov r2, #0
681 2e2354: f048 fd90 bl 0x32ae78
682 2e2358: b002 add sp, #8
683 2e235a: bd00 pop {pc}
684
685 $pwr_calibration_process:
686 2e235c: b500 push {lr}
687 2e235e: 2138 mov r1, #56 ; 0x38
688 2e2360: 4899 ldr r0, =0x1774e70 ; via 0x2e25c8
689 2e2362: 6800 ldr r0, [r0, #0]
690 2e2364: 5e08 ldrsh r0, [r1, r0]
691 2e2366: f04b fbda bl 0x32db1e ; $pwr_bat_temp_within_limits
692 2e236a: 2800 cmp r0, #0
693 2e236c: d111 bne 0x2e2392
694 ; failure code path
695 2e236e: 2000 mov r0, #0
696 2e2370: f0b2 fda7 bl 0x394ec2
697 2e2374: 2132 mov r1, #50 ; 0x32
698 2e2376: 48ca ldr r0, =0x1774e38 ; via 0x2e26a0
699 2e2378: 6800 ldr r0, [r0, #0]
700 2e237a: 5c08 ldrb r0, [r1, r0]
701 2e237c: 2800 cmp r0, #0
702 2e237e: d105 bne 0x2e238c
703 2e2380: 2001 mov r0, #1
704 2e2382: 213c mov r1, #60 ; 0x3c
705 2e2384: 2201 mov r2, #1
706 2e2386: f066 ff41 bl 0x34920c
707 2e238a: bd00 pop {pc}
708 2e238c: f0d1 fc11 bl 0x3b3bb2
709 2e2390: bd00 pop {pc}
710 ; good path
711 2e2392: 488d ldr r0, =0x1774e70 ; via 0x2e25c8
712 2e2394: 6801 ldr r1, [r0, #0]
713 2e2396: 2005 mov r0, #5
714 2e2398: 6308 str r0, [r1, #48] ; 0x30
715 2e239a: f7ff ffc3 bl 0x2e2324 ; $pwr_current_loop_cal
716 2e239e: bd00 pop {pc}
717
718 $pwr_battery_qualification:
719 2e23a0: b500 push {lr}
720 2e23a2: b082 sub sp, #8
721 ; "Battery qualification" trace
722 2e23a4: 4887 ldr r0, =0xa0020 ; via 0x2e25c4
723 2e23a6: 9000 str r0, [sp, #0]
724 2e23a8: a0cb add r0, pc, #812 ; 0x32c
725 2e23aa: 2115 mov r1, #21 ; 0x15
726 2e23ac: 2200 mov r2, #0
727 2e23ae: 43d2 mvn r2, r2
728 2e23b0: 2305 mov r3, #5
729 2e23b2: f0f8 fc3f bl 0x3dac34
730 ; pwr_env_ctrl_blk->timer0_state = BATTERY_SHORT_TEST;
731 2e23b6: 4884 ldr r0, =0x1774e70 ; via 0x2e25c8
732 2e23b8: 6800 ldr r0, [r0, #0]
733 2e23ba: 2101 mov r1, #1
734 2e23bc: 6301 str r1, [r0, #48] ; 0x30
735 ; CONSTANT_CURRENT_VALUE = 522 mA
736 2e23be: 4893 ldr r0, =0x20a ; via 0x2e260c
737 2e23c0: f7ff ff09 bl 0x2e21d6 ; $pwr_start_CI_charging
738 ; TIMER0 to 300 ms
739 2e23c4: 2000 mov r0, #0
740 2e23c6: 2141 mov r1, #65 ; 0x41
741 2e23c8: 2200 mov r2, #0
742 2e23ca: f048 fd55 bl 0x32ae78
743 2e23ce: b002 add sp, #8
744 2e23d0: bd00 pop {pc}
745
746 $pwr_start_fast_charge:
747 2e23d2: b500 push {lr}
748 2e23d4: f0b2 fcca bl 0x394d6c ; $pwr_send_CI_charge_start_event ?
749 2e23d8: 2001 mov r0, #1
750 2e23da: 2138 mov r1, #56 ; 0x38
751 2e23dc: 2201 mov r2, #1
752 2e23de: f066 ff15 bl 0x34920c
753 2e23e2: 4817 ldr r0, =0x357 ; via 0x2e2440
754 2e23e4: 4978 ldr r1, =0x1774e70 ; via 0x2e25c8
755 2e23e6: 6809 ldr r1, [r1, #0]
756 2e23e8: 8909 ldrh r1, [r1, #8]
757 2e23ea: 4348 mul r0, r1
758 2e23ec: 217d mov r1, #125 ; 0x7d
759 2e23ee: 00c9 lsl r1, r1, #3
760 2e23f0: f114 ff1c bl 0x3f722c ; I$DIV
761 ; diff from MV100 version begins
762 2e23f4: 0408 lsl r0, r1, #16
763 2e23f6: 0c00 lsr r0, r0, #16
764 2e23f8: f113 ff88 bl 0x3f630c ; U$TOFD
765 2e23fc: a2bc add r2, pc, #752 ; 0x2f0
766 2e23fe: ca0c ldmia r2!, {r2, r3}
767 2e2400: f101 fb1d bl 0x3e3a3e ; FD$ADD
768 2e2404: f112 fd5a bl 0x3f4ebc ; FD$TOU
769 2e2408: 0400 lsl r0, r0, #16
770 2e240a: 0c00 lsr r0, r0, #16
771 2e240c: f7ff fee3 bl 0x2e21d6 ; $pwr_start_CI_charging
772 2e2410: f04b ff19 bl 0x32e246
773 2e2414: 2002 mov r0, #2
774 2e2416: f7cf fa42 bl 0x2b189e ; rvf_delay()
775 2e241a: 2001 mov r0, #1
776 2e241c: 2122 mov r1, #34 ; 0x22
777 2e241e: 2200 mov r2, #0
778 2e2420: f066 fef4 bl 0x34920c ; $ABB_Write_Register_on_page
779 2e2424: 2002 mov r0, #2
780 2e2426: f7cf fa3a bl 0x2b189e
781 ; same TIMER1 setting as in MV100
782 2e242a: 2001 mov r0, #1
783 2e242c: 49b2 ldr r1, =0x363 ; via 0x2e26f8
784 2e242e: 2200 mov r2, #0
785 2e2430: f048 fd22 bl 0x32ae78
786 2e2434: bd00 pop {pc}
787 2e2436: 46c0 nop (mov r8, r8)
483 788
484 $l1_abb_power_on: 789 $l1_abb_power_on:
485 31c036: b510 push {r4, lr} 790 31c036: b510 push {r4, lr}
486 31c038: b084 sub sp, #16 ; 0x10 791 31c038: b084 sub sp, #16 ; 0x10
487 31c03a: 2000 mov r0, #0 792 31c03a: 2000 mov r0, #0
4295 00AA (170) 002D (45) 4600 00AA (170) 002D (45)
4296 00FA (250) 0050 (80) 4601 00FA (250) 0050 (80)
4297 4602
4298 0x17741e0: abb_sem 4603 0x17741e0: abb_sem
4299 4604
4605 0x17749b8: 8-bit var zeroed in pwr_stop_charging(), set to 1 in
4606 pwr_start_CI_charging() and pwr_start_CV_charging()
4607
4300 0x1774b78: 16-bit var, gets -4 written into it if the battery T 4608 0x1774b78: 16-bit var, gets -4 written into it if the battery T
4301 is too high, or -5 if it is too low 4609 is too high, or -5 if it is too low
4610 0x1774b7a: 16-bit var set to 0 when starting CI charging,
4611 set to 1 when starting CV charging
4302 0x1774b7c: 16-bit var battery voltage in mV 4612 0x1774b7c: 16-bit var battery voltage in mV
4613 0x1774b7e: 16-bit var zeroed in pwr_stop_charging()
4614 0x1774b80: 16-bit var zeroed in pwr_stop_charging()
4303 4615
4304 0x1774ccc: 16-bit var initial battery % is stored here 4616 0x1774ccc: 16-bit var initial battery % is stored here
4305 4617
4306 0x1774cd0: 16-bit var, ABB_Read_Status() return value at the beginning 4618 0x1774cd0: 16-bit var, ABB_Read_Status() return value at the beginning
4307 of Switch_ON() is stored here 4619 of Switch_ON() is stored here