# HG changeset patch # User Mychaela Falconia # Date 1553317869 0 # Node ID 5259ce993e8758f5c383c36a4bb0278b5687a50a # Parent dd8a9ebcd8b1d88422a331b855735eed84250b4b compal/c156-fw-disasm: got to Init_Target() diff -r dd8a9ebcd8b1 -r 5259ce993e87 compal/c156-fw-disasm --- a/compal/c156-fw-disasm Thu Mar 14 22:40:18 2019 +0000 +++ b/compal/c156-fw-disasm Sat Mar 23 05:11:09 2019 +0000 @@ -108,7 +108,7 @@ 1a41a0: e3700001 cmn r0, #1 1a41a4: 1b000083 blne 0x1a43b8 1a41a8: e1a00002 mov r0, r2 - 1a41ac: ea19d513 b 0x819600 + 1a41ac: ea19d513 b 0x819600 ; _INC_Initialize 1a4250: ea0cc185 b 0x4d486c 1a4254: eaf9efa9 b 0x20100 @@ -117,6 +117,229 @@ 1a4260: eafffffe b 0x1a4260 1a4264: eafffffe b 0x1a4264 +$Init_Target: + 4bf76c: b570 push {r4, r5, r6, lr} + 4bf76e: b081 sub sp, #4 + 4bf770: 4c73 ldr r4, =0xfffef006 ; via 0x4bf940 + 4bf772: 2003 mov r0, #3 + 4bf774: 0340 lsl r0, r0, #13 + 4bf776: 8060 strh r0, [r4, #2] + 4bf778: f00e ffce bl 0x4ce718 ; $TM_DisableWatchdog +; 8 MiB MEMIF setting + 4bf77c: 2008 mov r0, #8 + 4bf77e: 8821 ldrh r1, [r4, #0] + 4bf780: 4308 orr r0, r1 + 4bf782: 8020 strh r0, [r4, #0] +; standard code continues + 4bf784: 486f ldr r0, =0xfffffd02 ; via 0x4bf944 + 4bf786: 2105 mov r1, #5 + 4bf788: 8001 strh r1, [r0, #0] + 4bf78a: 2180 mov r1, #128 ; 0x80 + 4bf78c: 8802 ldrh r2, [r0, #0] + 4bf78e: 4311 orr r1, r2 + 4bf790: 8001 strh r1, [r0, #0] + 4bf792: 2180 mov r1, #128 ; 0x80 + 4bf794: 8802 ldrh r2, [r0, #0] + 4bf796: 4311 orr r1, r2 + 4bf798: 8001 strh r1, [r0, #0] + 4bf79a: 496b ldr r1, =0xffdf ; via 0x4bf948 + 4bf79c: 8802 ldrh r2, [r0, #0] + 4bf79e: 4011 and r1, r2 + 4bf7a0: 8001 strh r1, [r0, #0] + 4bf7a2: 4e6a ldr r6, =0xfffff900 ; via 0x4bf94c + 4bf7a4: 20ff mov r0, #255 ; 0xff + 4bf7a6: 0200 lsl r0, r0, #8 + 4bf7a8: 8030 strh r0, [r6, #0] + 4bf7aa: 4d69 ldr r5, =0xffff9800 ; via 0x4bf950 + 4bf7ac: 4869 ldr r0, =0xfff3 ; via 0x4bf954 + 4bf7ae: 8829 ldrh r1, [r5, #0] + 4bf7b0: 4008 and r0, r1 + 4bf7b2: 8028 strh r0, [r5, #0] + 4bf7b4: 8828 ldrh r0, [r5, #0] + 4bf7b6: 8028 strh r0, [r5, #0] + 4bf7b8: 4867 ldr r0, =0xf01f ; via 0x4bf958 + 4bf7ba: 8829 ldrh r1, [r5, #0] + 4bf7bc: 4008 and r0, r1 + 4bf7be: 8028 strh r0, [r5, #0] + 4bf7c0: 2001 mov r0, #1 + 4bf7c2: 0280 lsl r0, r0, #10 + 4bf7c4: 8829 ldrh r1, [r5, #0] + 4bf7c6: 4308 orr r0, r1 + 4bf7c8: 8028 strh r0, [r5, #0] + 4bf7ca: 2000 mov r0, #0 + 4bf7cc: 2102 mov r1, #2 + 4bf7ce: 2200 mov r2, #0 + 4bf7d0: f010 f806 bl 0x4cf7e0 ; $CLKM_InitARMClock + 4bf7d4: 4961 ldr r1, =0xfffffb00 ; via 0x4bf95c + 4bf7d6: 20a4 mov r0, #164 ; 0xa4 + 4bf7d8: 8008 strh r0, [r1, #0] + 4bf7da: 8048 strh r0, [r1, #2] + 4bf7dc: 22a5 mov r2, #165 ; 0xa5 + 4bf7de: 808a strh r2, [r1, #4] + 4bf7e0: 80c8 strh r0, [r1, #6] + 4bf7e2: 20a6 mov r0, #166 ; 0xa6 + 4bf7e4: 8148 strh r0, [r1, #10] ; 0xa + 4bf7e6: 20c0 mov r0, #192 ; 0xc0 + 4bf7e8: 8188 strh r0, [r1, #12] ; 0xc + 4bf7ea: 2040 mov r0, #64 ; 0x40 + 4bf7ec: 8108 strh r0, [r1, #8] + 4bf7ee: 2020 mov r0, #32 ; 0x20 + 4bf7f0: 8070 strh r0, [r6, #2] + 4bf7f2: 2000 mov r0, #0 + 4bf7f4: 80b0 strh r0, [r6, #4] + 4bf7f6: 2010 mov r0, #16 ; 0x10 + 4bf7f8: 8829 ldrh r1, [r5, #0] + 4bf7fa: 4308 orr r0, r1 + 4bf7fc: 8028 strh r0, [r5, #0] + 4bf7fe: 4858 ldr r0, =0xfffffa08 ; via 0x4bf960 + 4bf800: 4958 ldr r1, =0xffff ; via 0x4bf964 + 4bf802: 8001 strh r1, [r0, #0] + 4bf804: 8041 strh r1, [r0, #2] + 4bf806: 2103 mov r1, #3 + 4bf808: 8181 strh r1, [r0, #12] ; 0xc + 4bf80a: f00d f8a7 bl 0x4cc95c ; $IQ_SetupInterrupts + 4bf80e: 4856 ldr r0, =0xfffffc00 ; via 0x4bf968 + 4bf810: 2124 mov r1, #36 ; 0x24 + 4bf812: 8001 strh r1, [r0, #0] + 4bf814: 210d mov r1, #13 ; 0xd + 4bf816: 8041 strh r1, [r0, #2] + 4bf818: 2500 mov r5, #0 + 4bf81a: 4854 ldr r0, =0xfffe2016 ; via 0x4bf96c + 4bf81c: 8005 strh r5, [r0, #0] + 4bf81e: 4954 ldr r1, =0xfffe2014 ; via 0x4bf970 + 4bf820: 2002 mov r0, #2 + 4bf822: 8008 strh r0, [r1, #0] + 4bf824: 4953 ldr r1, =0xfffe2002 ; via 0x4bf974 + 4bf826: 2084 mov r0, #132 ; 0x84 + 4bf828: 8008 strh r0, [r1, #0] + 4bf82a: 4953 ldr r1, =0xfffe2000 ; via 0x4bf978 + 4bf82c: 4853 ldr r0, =0x3de0 ; via 0x4bf97c + 4bf82e: 8008 strh r0, [r1, #0] + 4bf830: 4a53 ldr r2, =0xfffe2022 ; via 0x4bf980 + 4bf832: 200a mov r0, #10 ; 0xa + 4bf834: 8010 strh r0, [r2, #0] + 4bf836: 4a53 ldr r2, =0xfffe2020 ; via 0x4bf984 + 4bf838: 4853 ldr r0, =0x45a ; via 0x4bf988 + 4bf83a: 8010 strh r0, [r2, #0] + 4bf83c: 4a53 ldr r2, =0xfffe201e ; via 0x4bf98c + 4bf83e: 20ff mov r0, #255 ; 0xff + 4bf840: 304b add r0, #75 ; 0x4b + 4bf842: 8010 strh r0, [r2, #0] + 4bf844: 4852 ldr r0, =0xfffe201c ; via 0x4bf990 + 4bf846: 221f mov r2, #31 ; 0x1f + 4bf848: 8002 strh r2, [r0, #0] + 4bf84a: 4852 ldr r0, =0xfffe2024 ; via 0x4bf994 + 4bf84c: 8005 strh r5, [r0, #0] + 4bf84e: 4a52 ldr r2, =0xfffe2010 ; via 0x4bf998 + 4bf850: 2002 mov r0, #2 + 4bf852: 8813 ldrh r3, [r2, #0] + 4bf854: 4318 orr r0, r3 + 4bf856: 8010 strh r0, [r2, #0] + 4bf858: 2004 mov r0, #4 + 4bf85a: 8813 ldrh r3, [r2, #0] + 4bf85c: 4318 orr r0, r3 + 4bf85e: 8010 strh r0, [r2, #0] + 4bf860: 2027 mov r0, #39 ; 0x27 + 4bf862: 80e0 strh r0, [r4, #6] + 4bf864: 8a08 ldrh r0, [r1, #16] ; 0x10 + 4bf866: 0840 lsr r0, r0, #1 + 4bf868: d30f bcc 0x4bf88a + 4bf86a: 8a08 ldrh r0, [r1, #16] ; 0x10 + 4bf86c: 0400 lsl r0, r0, #16 + 4bf86e: 0c40 lsr r0, r0, #17 + 4bf870: 0040 lsl r0, r0, #1 + 4bf872: 8208 strh r0, [r1, #16] ; 0x10 + 4bf874: 2001 mov r0, #1 + 4bf876: e001 b 0x4bf87c + 4bf878: 9800 ldr r0, [sp, #0] + 4bf87a: 3001 add r0, #1 + 4bf87c: 9000 str r0, [sp, #0] + 4bf87e: 9800 ldr r0, [sp, #0] + 4bf880: 2832 cmp r0, #50 ; 0x32 + 4bf882: d3f9 bcc 0x4bf878 + 4bf884: 8a48 ldrh r0, [r1, #18] ; 0x12 + 4bf886: 2800 cmp r0, #0 + 4bf888: d0fc beq 0x4bf884 + 4bf88a: f00f f92c bl 0x4ceae6 ; ARMIO setup? + 4bf88e: 2027 mov r0, #39 ; 0x27 + 4bf890: 0500 lsl r0, r0, #20 + 4bf892: 8005 strh r5, [r0, #0] + 4bf894: 2001 mov r0, #1 + 4bf896: f00e ff4f bl 0x4ce738 + 4bf89a: 2002 mov r0, #2 + 4bf89c: f00e ff4c bl 0x4ce738 + 4bf8a0: b001 add sp, #4 + 4bf8a2: bd70 pop {r4, r5, r6, pc} + + 4bf8a4: b500 push {lr} + 4bf8a6: f79c fdc9 bl 0x45c43c + 4bf8aa: f70f f9e4 bl 0x3cec76 + 4bf8ae: f73c f835 bl 0x3fb91c + 4bf8b2: f7d4 fbb7 bl 0x494024 + 4bf8b6: f699 f8b5 bl 0x358a24 + 4bf8ba: bd00 pop {pc} + + 4bf8bc: b500 push {lr} + 4bf8be: 4837 ldr r0, =0x1175c94 ; via 0x4bf99c + 4bf8c0: f756 ff05 bl 0x4166ce + 4bf8c4: f757 f9ca bl 0x416c5c + 4bf8c8: bd00 pop {pc} + + 4bf8ca: b500 push {lr} + 4bf8cc: 2004 mov r0, #4 + 4bf8ce: f00d f8a6 bl 0x4cca1e + 4bf8d2: 2012 mov r0, #18 ; 0x12 + 4bf8d4: f00d f8a3 bl 0x4cca1e + 4bf8d8: 2007 mov r0, #7 + 4bf8da: f00d f8a0 bl 0x4cca1e + 4bf8de: 2008 mov r0, #8 + 4bf8e0: f00d f89d bl 0x4cca1e + 4bf8e4: bd00 pop {pc} + + 4bf8e6: b510 push {r4, lr} + 4bf8e8: 1c04 add r4, r0, #0 + 4bf8ea: 2012 mov r0, #18 ; 0x12 + 4bf8ec: f00d f8a8 bl 0x4cca40 + 4bf8f0: 2007 mov r0, #7 + 4bf8f2: f00d f8a5 bl 0x4cca40 + 4bf8f6: 2c00 cmp r4, #0 + 4bf8f8: d012 beq 0x4bf920 + 4bf8fa: 3c01 sub r4, #1 + 4bf8fc: 2c00 cmp r4, #0 + 4bf8fe: d009 beq 0x4bf914 + 4bf900: 3c01 sub r4, #1 + 4bf902: 2c00 cmp r4, #0 + 4bf904: d114 bne 0x4bf930 + 4bf906: 2049 mov r0, #73 ; 0x49 + 4bf908: 00c0 lsl r0, r0, #3 + 4bf90a: f756 fdef bl 0x4164ec + 4bf90e: 2101 mov r1, #1 + 4bf910: 4a23 ldr r2, =0x4a502f ; via 0x4bf9a0 + 4bf912: e00a b 0x4bf92a + 4bf914: 20ff mov r0, #255 ; 0xff + 4bf916: 3069 add r0, #105 ; 0x69 + 4bf918: f756 fde8 bl 0x4164ec + 4bf91c: 4a20 ldr r2, =0x4a502f ; via 0x4bf9a0 + 4bf91e: e003 b 0x4bf928 + 4bf920: 2068 mov r0, #104 ; 0x68 + 4bf922: f756 fde3 bl 0x4164ec + 4bf926: 2200 mov r2, #0 + 4bf928: 2100 mov r1, #0 + 4bf92a: 2001 mov r0, #1 + 4bf92c: f757 f938 bl 0x416ba0 + 4bf930: 2012 mov r0, #18 ; 0x12 + 4bf932: f00d f874 bl 0x4cca1e + 4bf936: 2007 mov r0, #7 + 4bf938: f00d f871 bl 0x4cca1e + 4bf93c: bd10 pop {r4, pc} + 4bf93e: 46c0 nop (mov r8, r8) + + 4cfb9a: 4770 bx lr + 4cfb9c: 4770 bx lr + 4cfb9e: 4806 ldr r0, =0x1175c90 ; via 0x4cfbb8 + 4cfba0: 7800 ldrb r0, [r0, #0] + 4cfba2: 4770 bx lr + ; code looks like TI's bootloader.s, not int.s 4d486c: e51f101c ldr r1, =0xffff9800 ; via 0x4d4858 4d4870: e15f21b2 ldrh r2, =0x2006 ; via 0x4d4866 @@ -160,3 +383,156 @@ 4d4908: e3c22003 bic r2, r2, #3 4d490c: e1a0d002 mov sp, r2 4d4910: eaf33dc7 b 0x1a4034 + + 4d6b80: 2900 cmp r1, #0 + 4d6b82: d006 beq 0x4d6b92 + 4d6b84: 6803 ldr r3, [r0, #0] + 4d6b86: 6013 str r3, [r2, #0] + 4d6b88: 3204 add r2, #4 + 4d6b8a: 3004 add r0, #4 + 4d6b8c: 3904 sub r1, #4 + 4d6b8e: 2900 cmp r1, #0 + 4d6b90: d1f8 bne 0x4d6b84 + 4d6b92: 4770 bx lr + + 4d6bc0: b500 push {lr} + 4d6bc2: 2000 mov r0, #0 + 4d6bc4: 4909 ldr r1, =0x116a020 ; via 0x4d6bec + 4d6bc6: 8008 strh r0, [r1, #0] + 4d6bc8: 4909 ldr r1, =0x116a022 ; via 0x4d6bf0 + 4d6bca: 8008 strh r0, [r1, #0] + 4d6bcc: 4a09 ldr r2, =0x800000 ; via 0x4d6bf4 + 4d6bce: 480a ldr r0, =0x20188 ; via 0x4d6bf8 + 4d6bd0: 490a ldr r1, =0x81e614 ; via 0x4d6bfc + 4d6bd2: 1a89 sub r1, r1, r2 + 4d6bd4: 3904 sub r1, #4 + 4d6bd6: 2304 mov r3, #4 + 4d6bd8: 189a add r2, r3, r2 + 4d6bda: f7ff ffd1 bl 0x4d6b80 + 4d6bde: 4a08 ldr r2, =0x81e618 ; via 0x4d6c00 + 4d6be0: 4808 ldr r0, =0x4d9280 ; via 0x4d6c04 + 4d6be2: 4909 ldr r1, =0x81e868 ; via 0x4d6c08 + 4d6be4: 1a89 sub r1, r1, r2 + 4d6be6: f7ff ffcb bl 0x4d6b80 + 4d6bea: bd00 pop {pc} + +; code from 0x20188 is moved to 0x800004, length 0x1E610 +; code from 0x4D9280 is moved to 0x81E618, length 0x250 + +$Application_Initialize: + 4d751a: b500 push {lr} + 4d751c: f7f8 fb3d bl 0x4cfb9a ; empty function + 4d7520: 4916 ldr r1, =0x116b56c ; via 0x4d757c + 4d7522: 4817 ldr r0, =0xffff5800 ; via 0x4d7580 + 4d7524: 6008 str r0, [r1, #0] + 4d7526: 2000 mov r0, #0 + 4d7528: 2107 mov r1, #7 + 4d752a: f7e3 fba9 bl 0x4bac80 + 4d752e: f001 f8db bl 0x4d86e8 + 4d7532: f7d8 fde2 bl 0x4b00fa + 4d7536: f329 ff4b bl 0x8013d0 + 4d753a: f7d8 fdde bl 0x4b00fa + 4d753e: f001 f8d9 bl 0x4d86f4 + 4d7542: 2000 mov r0, #0 + 4d7544: 2102 mov r1, #2 + 4d7546: 4a0f ldr r2, =0x4d7519 ; via 0x4d7584 + 4d7548: f73f fb2a bl 0x416ba0 + 4d754c: f7fe fb82 bl 0x4d5c54 + 4d7550: f75d fc05 bl 0x434d5e + 4d7554: f7f8 fb21 bl 0x4cfb9a ; empty function + 4d7558: 4808 ldr r0, =0x116b56c ; via 0x4d757c + 4d755a: 4909 ldr r1, =0xffff5800 ; via 0x4d7580 + 4d755c: 6001 str r1, [r0, #0] + 4d755e: 2000 mov r0, #0 + 4d7560: 2107 mov r1, #7 + 4d7562: f7e3 fb8d bl 0x4bac80 + 4d7566: f7b4 fa1d bl 0x48b9a4 + 4d756a: bd00 pop {pc} + + 4d86e8: b500 push {lr} + 4d86ea: f7e7 f83f bl 0x4bf76c + 4d86ee: f7e7 f8d9 bl 0x4bf8a4 + 4d86f2: bd00 pop {pc} + + 4d86f4: b500 push {lr} + 4d86f6: f7e7 f8e1 bl 0x4bf8bc + 4d86fa: bd00 pop {pc} + + 4d86fc: b500 push {lr} + 4d86fe: f7e7 f8e4 bl 0x4bf8ca + 4d8702: bd00 pop {pc} + + 4d8704: b500 push {lr} + 4d8706: 200a mov r0, #10 ; 0xa + 4d8708: f7f4 f989 bl 0x4cca1e + 4d870c: bd00 pop {pc} + 4d870e: 0000 + + 4d8710: 4770 bx lr + 4d8712: 4770 bx lr + 4d8714: 4770 bx lr + 4d8716: 4770 bx lr + 4d8718: 4770 bx lr + 4d871a: 4770 bx lr + 4d871c: 4770 bx lr + 4d871e: 4770 bx lr + 4d8720: 4770 bx lr + 4d8722: 4770 bx lr + + 4d8724: 4803 ldr r0, =0xfffe480e ; via 0x4d8734 + 4d8726: 8800 ldrh r0, [r0, #0] + 4d8728: 07c0 lsl r0, r0, #31 + 4d872a: 0fc0 lsr r0, r0, #31 + 4d872c: 0600 lsl r0, r0, #24 + 4d872e: 0e00 lsr r0, r0, #24 + 4d8730: 4770 bx lr + 4d8732: 46c0 nop (mov r8, r8) + + 4d8ea4: e92d4000 stmdb sp!, {lr} + 4d8ea8: e28fe001 add lr, pc, #1 + 4d8eac: e12fff1e bx lr + 4d8eb0: f7fd fe86 bl 0x4d6bc0 + 4d8eb4: 4778 bx pc + 4d8eb6: 46c0 nop (mov r8, r8) + 4d8eb8: e8bd8000 ldmia sp!, {pc} + +; IRAM code + +_INC_Initialize: ; call veneer + 819600: e92d4000 stmdb sp!, {lr} + 819604: e28fe001 add lr, pc, #1 + 819608: e12fff1e bx lr + 81960c: f000 f804 bl 0x819618 + 819610: 4778 bx pc + 819612: 46c0 nop (mov r8, r8) + 819614: e8bd8000 ldmia sp!, {pc} + +$INC_Initialize: + 819618: b500 push {lr} + 81961a: b081 sub sp, #4 + 81961c: 9000 str r0, [sp, #0] + 81961e: 4914 ldr r1, =0x82ef7c ; via 0x819670 + 819620: 2001 mov r0, #1 + 819622: 6008 str r0, [r1, #0] + 819624: f000 f836 bl 0x819694 + 819628: f000 f85c bl 0x8196e4 + 81962c: f000 f908 bl 0x819840 + 819630: f000 f8ee bl 0x819810 + 819634: f000 f91a bl 0x81986c + 819638: f000 f85c bl 0x8196f4 + 81963c: f000 f8d8 bl 0x8197f0 + 819640: f000 f904 bl 0x81984c + 819644: f000 f9c0 bl 0x8199c8 + 819648: f000 f82c bl 0x8196a4 + 81964c: f000 f83a bl 0x8196c4 + 819650: f000 f810 bl 0x819674 + 819654: f000 f86e bl 0x819734 + 819658: f000 f85c bl 0x819714 + 81965c: 9800 ldr r0, [sp, #0] + 81965e: f4bd ff5c bl 0x4d751a ; $Application_Initialize + 819662: 4803 ldr r0, =0x82ef7c ; via 0x819670 + 819664: 2102 mov r1, #2 + 819666: 6001 str r1, [r0, #0] + 819668: f7fb fa48 bl 0x814afc + 81966c: b001 add sp, #4 + 81966e: bd00 pop {pc}