comparison pirelli/fw-disasm @ 259:ea66ce1a0d2e

pirelli/fw-disasm: pwr_cal_timer_process() analyzed
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Dec 2017 04:47:58 +0000
parents 61d8d70ca7b0
children 863b483bf9e7
comparison
equal deleted inserted replaced
258:61d8d70ca7b0 259:ea66ce1a0d2e
950 2e25b6: f066 fe29 bl 0x34920c 950 2e25b6: f066 fe29 bl 0x34920c
951 2e25ba: e001 b 0x2e25c0 951 2e25ba: e001 b 0x2e25c0
952 2e25bc: f0d1 faf9 bl 0x3b3bb2 952 2e25bc: f0d1 faf9 bl 0x3b3bb2
953 2e25c0: b002 add sp, #8 953 2e25c0: b002 add sp, #8
954 2e25c2: bd70 pop {r4, r5, r6, pc} 954 2e25c2: bd70 pop {r4, r5, r6, pc}
955
956 $pwr_open_test_timer_process:
957 2e2610: b510 push {r4, lr}
958 2e2612: b082 sub sp, #8
959 2e2614: 48e5 ldr r0, =0xa0020 ; via 0x2e29ac
960 2e2616: 9000 str r0, [sp, #0]
961 2e2618: a0e6 add r0, pc, #920 ; 0x398
962 2e261a: 2119 mov r1, #25 ; 0x19
963 2e261c: 2200 mov r2, #0
964 2e261e: 43d2 mvn r2, r2
965 2e2620: 2302 mov r3, #2
966 2e2622: f0f8 fb07 bl 0x3dac34
967 2e2626: 2001 mov r0, #1
968 2e2628: 2122 mov r1, #34 ; 0x22
969 2e262a: f066 fe16 bl 0x34925a
970 2e262e: 1c04 add r4, r0, #0
971 2e2630: 48de ldr r0, =0xa0020 ; via 0x2e29ac
972 2e2632: 9000 str r0, [sp, #0]
973 2e2634: a06e add r0, pc, #440 ; 0x1b8
974 2e2636: 211b mov r1, #27 ; 0x1b
975 2e2638: 1c22 add r2, r4, #0
976 2e263a: 2305 mov r3, #5
977 2e263c: f0f8 fafa bl 0x3dac34
978 2e2640: f7ff fe55 bl 0x2e22ee
979 2e2644: 2c00 cmp r4, #0
980 2e2646: d11a bne 0x2e267e
981 2e2648: 48d8 ldr r0, =0xa0020 ; via 0x2e29ac
982 2e264a: 9000 str r0, [sp, #0]
983 2e264c: a0e0 add r0, pc, #896 ; 0x380
984 2e264e: 210c mov r1, #12 ; 0xc
985 2e2650: 2200 mov r2, #0
986 2e2652: 43d2 mvn r2, r2
987 2e2654: 2302 mov r3, #2
988 2e2656: f0f8 faed bl 0x3dac34
989 2e265a: 2001 mov r0, #1
990 2e265c: f0b2 fc31 bl 0x394ec2
991 2e2660: 2132 mov r1, #50 ; 0x32
992 2e2662: 480f ldr r0, =0x1774e38 ; via 0x2e26a0
993 2e2664: 6800 ldr r0, [r0, #0]
994 2e2666: 5c08 ldrb r0, [r1, r0]
995 2e2668: 2800 cmp r0, #0
996 2e266a: d105 bne 0x2e2678
997 2e266c: 2001 mov r0, #1
998 2e266e: 213c mov r1, #60 ; 0x3c
999 2e2670: 2201 mov r2, #1
1000 2e2672: f066 fdcb bl 0x34920c
1001 2e2676: e011 b 0x2e269c
1002 2e2678: f0d1 fa9b bl 0x3b3bb2
1003 2e267c: e00e b 0x2e269c
1004 2e267e: 48cb ldr r0, =0xa0020 ; via 0x2e29ac
1005 2e2680: 9000 str r0, [sp, #0]
1006 2e2682: a062 add r0, pc, #392 ; 0x188
1007 2e2684: 210a mov r1, #10 ; 0xa
1008 2e2686: 2200 mov r2, #0
1009 2e2688: 43d2 mvn r2, r2
1010 2e268a: 2305 mov r3, #5
1011 2e268c: f0f8 fad2 bl 0x3dac34
1012 2e2690: 48c7 ldr r0, =0x1774e70 ; via 0x2e29b0
1013 2e2692: 6800 ldr r0, [r0, #0]
1014 2e2694: 2101 mov r1, #1
1015 2e2696: 6041 str r1, [r0, #4]
1016 2e2698: f04b fad2 bl 0x32dc40
1017 2e269c: b002 add sp, #8
1018 2e269e: bd10 pop {r4, pc}
1019
1020 $pwr_cal_timer_process:
1021 2e26fc: b510 push {r4, lr}
1022 2e26fe: b082 sub sp, #8
1023 ; same check for charger presence and active state as seen before
1024 2e2700: f066 fe04 bl 0x34930c ; $ABB_Read_Status
1025 2e2704: 49aa ldr r1, =0x1774e70 ; via 0x2e29b0
1026 2e2706: 6809 ldr r1, [r1, #0]
1027 2e2708: 6849 ldr r1, [r1, #4]
1028 2e270a: 2900 cmp r1, #0
1029 2e270c: d001 beq 0x2e2712
1030 2e270e: 09c0 lsr r0, r0, #7
1031 2e2710: d205 bcs 0x2e271e
1032 2e2712: 2001 mov r0, #1
1033 2e2714: 2138 mov r1, #56 ; 0x38
1034 2e2716: 2201 mov r2, #1
1035 2e2718: f066 fd78 bl 0x34920c
1036 2e271c: e042 b 0x2e27a4
1037 ; checks passed
1038 ; "TIMER0: Battery calibration" trace
1039 2e271e: 48a3 ldr r0, =0xa0020 ; via 0x2e29ac
1040 2e2720: 9000 str r0, [sp, #0]
1041 2e2722: a0c7 add r0, pc, #796 ; 0x31c
1042 2e2724: 211b mov r1, #27 ; 0x1b
1043 2e2726: 2200 mov r2, #0
1044 2e2728: 43d2 mvn r2, r2
1045 2e272a: 2302 mov r3, #2
1046 2e272c: f0f8 fa82 bl 0x3dac34
1047 ; write 0 into ADIN2REG
1048 2e2730: 2001 mov r0, #1
1049 2e2732: 2128 mov r1, #40 ; 0x28
1050 2e2734: 2200 mov r2, #0
1051 2e2736: f066 fd69 bl 0x34920c
1052 ; delay 2 ticks
1053 2e273a: 2002 mov r0, #2
1054 2e273c: f7cf f8af bl 0x2b189e
1055 ; back to expected code
1056 2e2740: 4c9b ldr r4, =0x1774e70 ; via 0x2e29b0
1057 2e2742: 2001 mov r0, #1
1058 2e2744: 2122 mov r1, #34 ; 0x22
1059 2e2746: f066 fd88 bl 0x34925a
1060 2e274a: 6821 ldr r1, [r4, #0]
1061 2e274c: 8108 strh r0, [r1, #8]
1062 ; i2v offset (raw ADC) also stored in this other var
1063 2e274e: 48a4 ldr r0, =0x1774b82 ; via 0x2e29e0
1064 2e2750: 6821 ldr r1, [r4, #0]
1065 2e2752: 8909 ldrh r1, [r1, #8]
1066 2e2754: 8001 strh r1, [r0, #0]
1067 ; back to expected code
1068 ; "i2v offset (MADC code) " trace
1069 2e2756: 6820 ldr r0, [r4, #0]
1070 2e2758: 8902 ldrh r2, [r0, #8]
1071 2e275a: 4894 ldr r0, =0xa0020 ; via 0x2e29ac
1072 2e275c: 9000 str r0, [sp, #0]
1073 2e275e: a0bf add r0, pc, #764 ; 0x2fc
1074 2e2760: 2117 mov r1, #23 ; 0x17
1075 2e2762: 2305 mov r3, #5
1076 2e2764: f0f8 fa66 bl 0x3dac34
1077 2e2768: f7ff fdc1 bl 0x2e22ee ; $pwr_stop_charging
1078 2e276c: 6820 ldr r0, [r4, #0]
1079 2e276e: 3004 add r0, #4
1080 2e2770: 8881 ldrh r1, [r0, #4]
1081 2e2772: 2900 cmp r1, #0
1082 2e2774: d109 bne 0x2e278a
1083 ; i2v offset is zero
1084 ; pwr_env_ctrl_blk->charging_state = TESTING_BATTERY;
1085 2e2776: 2101 mov r1, #1
1086 2e2778: 6001 str r1, [r0, #0]
1087 ; setting BCICONF to 0x18
1088 2e277a: 2002 mov r0, #2
1089 2e277c: 211a mov r1, #26 ; 0x1a
1090 2e277e: 2218 mov r2, #24 ; 0x18
1091 2e2780: f066 fd44 bl 0x34920c ; $ABB_Write_Register_on_page
1092 2e2784: f7ff fdce bl 0x2e2324 ; $pwr_current_loop_cal
1093 2e2788: e00c b 0x2e27a4 ; return;
1094 ; i2v offset is not zero
1095 2e278a: 317a add r1, #122 ; 0x7a
1096 2e278c: 80c1 strh r1, [r0, #6]
1097 ; "End of charge current (MADC code) " trace
1098 2e278e: 6820 ldr r0, [r4, #0]
1099 2e2790: 8942 ldrh r2, [r0, #10] ; 0xa
1100 2e2792: 4886 ldr r0, =0xa0020 ; via 0x2e29ac
1101 2e2794: 9000 str r0, [sp, #0]
1102 2e2796: a0b7 add r0, pc, #732 ; 0x2dc
1103 2e2798: 2122 mov r1, #34 ; 0x22
1104 2e279a: 2305 mov r3, #5
1105 2e279c: f0f8 fa4a bl 0x3dac34
1106 2e27a0: f7ff fe17 bl 0x2e23d2 ; $pwr_start_fast_charge
1107 2e27a4: b002 add sp, #8
1108 2e27a6: bd10 pop {r4, pc}
955 1109
956 $l1_abb_power_on: 1110 $l1_abb_power_on:
957 31c036: b510 push {r4, lr} 1111 31c036: b510 push {r4, lr}
958 31c038: b084 sub sp, #16 ; 0x10 1112 31c038: b084 sub sp, #16 ; 0x10
959 31c03a: 2000 mov r0, #0 1113 31c03a: 2000 mov r0, #0
4782 0x1774b7a: 16-bit var set to 0 when starting CI charging, 4936 0x1774b7a: 16-bit var set to 0 when starting CI charging,
4783 set to 1 when starting CV charging 4937 set to 1 when starting CV charging
4784 0x1774b7c: 16-bit var battery voltage in mV 4938 0x1774b7c: 16-bit var battery voltage in mV
4785 0x1774b7e: 16-bit var zeroed in pwr_stop_charging() 4939 0x1774b7e: 16-bit var zeroed in pwr_stop_charging()
4786 0x1774b80: 16-bit var zeroed in pwr_stop_charging() 4940 0x1774b80: 16-bit var zeroed in pwr_stop_charging()
4941 0x1774b82: 16-bit var gets i2v offset (raw ADC) written into it
4787 4942
4788 0x1774ccc: 16-bit var initial battery % is stored here 4943 0x1774ccc: 16-bit var initial battery % is stored here
4789 4944
4790 0x1774cd0: 16-bit var, ABB_Read_Status() return value at the beginning 4945 0x1774cd0: 16-bit var, ABB_Read_Status() return value at the beginning
4791 of Switch_ON() is stored here 4946 of Switch_ON() is stored here