comparison bootrom.notes @ 18:123cb5021b64

boot ROM re: appears to be complete!
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 25 Apr 2013 05:47:59 +0000
parents d2206cb5f8b4
children a52e76c12e6b
comparison
equal deleted inserted replaced
17:d2206cb5f8b4 18:123cb5021b64
56 Followed by 4 bytes, giving a 32-bit value in MSB-first order. The value is 56 Followed by 4 bytes, giving a 32-bit value in MSB-first order. The value is
57 written to 80052C, and the 0x2c8 function returns code 6. 57 written to 80052C, and the 0x2c8 function returns code 6.
58 58
59 <c 59 <c
60 60
61 Checksum verification command. The <c characters need to be followed by a
62 single binary byte, which need to equal the one's complement of the low byte
63 of the 800528 accumulator.
64
65 Response: >c if good, >C if bad. Both are followed by the low byte of 800528.
66
61 <i 67 <i
62 68
63 Calls the 0x11c routine, then responds with '>i'. 69 Calls the 0x11c routine, then responds with '>i'.
64 70
65 <p 71 <p
99 1 byte: total # of blocks 105 1 byte: total # of blocks
100 2 bytes: # of payload bytes in this block (MSB first) 106 2 bytes: # of payload bytes in this block (MSB first)
101 4 bytes: load address for this block (MSB first) 107 4 bytes: load address for this block (MSB first)
102 data 108 data
103 109
104 for a single block (both bytes after <w set to 01), the maximum allowed 110 For a single block (both bytes after <w set to 01), the maximum allowed
105 payload length is 1015 (0x3F7) bytes. 111 payload length is 1015 (0x3F7) bytes.
112
113 No alignment required on the address or length - the copying from the
114 intermediate buffer at 80010C to the specified load address is done
115 with a loop that does one byte at a time with ldrb and strb instructions.
106 116
107 The checksum of each block is computed as a simple ripple-carry sum 117 The checksum of each block is computed as a simple ripple-carry sum
108 (in a 32-bit ARM register) of: 118 (in a 32-bit ARM register) of:
109 + the word-sized payload byte count from the command 119 + the word-sized payload byte count from the command
110 + each of the 4 bytes of the load address 120 + each of the 4 bytes of the load address
134 how long to wait for a character 144 how long to wait for a character
135 800108: byte initialized to 0x01 145 800108: byte initialized to 0x01
136 state variable for the serial command interface 146 state variable for the serial command interface
137 in the initial state of 01, only <i and <p are accepted 147 in the initial state of 01, only <i and <p are accepted
138 state 02: after successful <p, <w is allowed 148 state 02: after successful <p, <w is allowed
139 state 03: after first successful <w? 149 state 03: after first successful <w, and subsequent successful <w's
150 state 04: after <c with matching checksum
140 80010C: all bytes of a '<w' command after these two command chars 151 80010C: all bytes of a '<w' command after these two command chars
141 are stored starting here 152 are stored starting here
142 this buffer is also used for other scratchpad functions: <p 153 this buffer is also used for other scratchpad functions: <p
143 command bytes, all response messages 154 command bytes, all response messages
144 80050B: the above buffer ends here 155 80050B: the above buffer ends here
166 written here 177 written here
167 800528: 16-bit var init to 0 by 0x11c ('<i' handler) 178 800528: 16-bit var init to 0 by 0x11c ('<i' handler)
168 checksum accum? 179 checksum accum?
169 180
170 80052C: 32-bit var init to 0 by 0x11c ('<i' handler) 181 80052C: 32-bit var init to 0 by 0x11c ('<i' handler)
171 word holds the argument of the '<b' command 182 word holds the argument of the '<b' command, i.e., the branch address
172 800530: byte indicates validity of the received '<w' command: 183 800530: byte indicates validity of the received '<w' command:
173 0 means valid, 1 means something bad 184 0 means valid, 1 means something bad
174 init to 0 by 0x11c 185 init to 0 by 0x11c
175 800531: byte error code to return to host as the 3rd (and last) byte 186 800531: byte error code to return to host as the 3rd (and last) byte
176 of the >W message 187 of the >W message