diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-03-21 19:01:15 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-03-21 19:02:03 +0100 |
commit | d504a6b220c6f67461a5c9695f428ea12ccc50a1 (patch) | |
tree | e9e91efcc5765ec25521d42e0b970d2328edeaec /utils/rknanoutils/rkboottool | |
parent | 6ea48cf92b2961fe3f9ffe76445bc981e6c88707 (diff) | |
download | rockbox-d504a6b220c6f67461a5c9695f428ea12ccc50a1.tar.gz rockbox-d504a6b220c6f67461a5c9695f428ea12ccc50a1.zip |
rknanoutils: fix boot tool
Correctly descramble the first stages (0 to 2) in continuous mode.
Also fix a disassembled (but unused) crc routine used in dfu mode.
Change-Id: I20016d1c696a9bcb6584377ee9b55493783c7159
Diffstat (limited to 'utils/rknanoutils/rkboottool')
-rw-r--r-- | utils/rknanoutils/rkboottool/rkboottool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/rknanoutils/rkboottool/rkboottool.c b/utils/rknanoutils/rkboottool/rkboottool.c index 442046f96a..ee9b17e610 100644 --- a/utils/rknanoutils/rkboottool/rkboottool.c +++ b/utils/rknanoutils/rkboottool/rkboottool.c | |||
@@ -128,7 +128,7 @@ static uint16_t crc(uint8_t *buf, int size) | |||
128 | { | 128 | { |
129 | for(int bit = 128; bit; bit >>= 1) | 129 | for(int bit = 128; bit; bit >>= 1) |
130 | { | 130 | { |
131 | if(result & 0x80) | 131 | if(result & 0x8000) |
132 | result = (2 * result) ^ 0x1021; | 132 | result = (2 * result) ^ 0x1021; |
133 | else | 133 | else |
134 | result *= 2; | 134 | result *= 2; |
@@ -221,7 +221,7 @@ static int do_nanofw_image(uint8_t *buf, unsigned long size) | |||
221 | cprintf(GREEN, " %i: ", i); | 221 | cprintf(GREEN, " %i: ", i); |
222 | print_blob_interval(&hdr->stage[i]); | 222 | print_blob_interval(&hdr->stage[i]); |
223 | cprintf(OFF, "\n"); | 223 | cprintf(OFF, "\n"); |
224 | save_blob(&hdr->stage[i], buf, size, "stage", i, NO_ENC); | 224 | save_blob(&hdr->stage[i], buf, size, "stage", i, i == 3 ? NO_ENC : CONTINOUS_ENC); |
225 | } | 225 | } |
226 | cprintf(BLUE, "Fonts\n"); | 226 | cprintf(BLUE, "Fonts\n"); |
227 | for(unsigned i = 0; i < hdr->nr_fonts; i++) | 227 | for(unsigned i = 0; i < hdr->nr_fonts; i++) |