# HG changeset patch # User Michael Spacefalcon # Date 1366843692 0 # Node ID e0ce45f043c0e1aee34597095b93775ec7efe5e9 # Parent 25b016d16602378f32a7341b1e94398df6daf2b4 boot ROM re: continuing plowing through the serial protocol code diff -r 25b016d16602 -r e0ce45f043c0 bootrom.disasm --- a/bootrom.disasm Wed Apr 24 19:32:45 2013 +0000 +++ b/bootrom.disasm Wed Apr 24 22:48:12 2013 +0000 @@ -223,8 +223,9 @@ ; *R0 return byte values: ; 00 = got nothing (timeout) or an invalid/non-understood command ; 01 = got 'i' -; 02 = -; 03 = +; 02 = got 'p', 9 additional bytes received, a bunch of vars filled +; 03 = got 'w', the rest of the command read into the buffer at +; 80010C, the flag at 80053C set ; 04 = got 'c', 1 additional byte received, extended to a half-word ; and written to 80052C ; 05 = got 'a' @@ -262,6 +263,7 @@ 334: e3a0a000 mov r10, #0 ; 0x0 338: e3a06000 mov r6, #0 ; 0x0 33c: ea000015 b 0x398 +; more blocks 340: e5d40008 ldrb r0, [r4, #8] 344: e5971000 ldr r1, [r7] 348: e28d2002 add r2, sp, #2 ; 0x2 @@ -284,6 +286,7 @@ 38c: 0a000001 beq 0x398 390: e3a0c001 mov r12, #1 ; 0x1 394: e5c4c018 strb r12, [r4, #24] +; the entry to the 'w' handling block branches here 398: e5d40008 ldrb r0, [r4, #8] 39c: e5971000 ldr r1, [r7] 3a0: e1a0200d mov r2, sp @@ -337,17 +340,17 @@ 460: e18c8408 orr r8, r12, r8, lsl #8 464: e2599001 subs r9, r9, #1 ; 0x1 468: 1afffff5 bne 0x444 - 46c: e59fc9a4 ldr r12, [pc, #2468] ; 0xe18 + 46c: e59fc9a4 ldr r12, =0x800750 ; via 0xe18 470: e158000c cmp r8, r12 474: 3a00004e bcc 0x5b4 - 478: e59f099c ldr r0, [pc, #2460] ; 0xe1c + 478: e59f099c ldr r0, =0x7F8AF ; via 0xe1c 47c: e080c00c add r12, r0, r12 480: e158000c cmp r8, r12 484: 8a00004a bhi 0x5b4 488: e085c006 add r12, r5, r6 48c: e35c0ffe cmp r12, #1016 ; 0x3f8 490: aa000037 bge 0x574 - 494: e59fc970 ldr r12, [pc, #2416] ; 0xe0c + 494: e59fc970 ldr r12, =0x80010C ; via 0xe0c 498: e5dd0000 ldrb r0, [sp] 49c: e7c6000c strb r0, [r6, r12] 4a0: e2860001 add r0, r6, #1 ; 0x1 @@ -403,6 +406,8 @@ 568: e2555001 subs r5, r5, #1 ; 0x1 56c: 1afffff6 bne 0x54c 570: ea00000a b 0x5a0 +; length exceeded: read and discard +; the increment of R5 looks like a bug! 574: e285c001 add r12, r5, #1 ; 0x1 578: e1a0c80c mov r12, r12, lsl #16 57c: e1a0582c mov r5, r12, lsr #16 @@ -419,30 +424,34 @@ 5a8: e3a0c003 mov r12, #3 ; 0x3 5ac: e5cbc000 strb r12, [r11] 5b0: ea00005b b 0x724 +; error path (