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 | |
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')
-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) { for(int bit = 128; bit; bit >>= 1) { - if(result & 0x80) + if(result & 0x8000) result = (2 * result) ^ 0x1021; else result *= 2; @@ -221,7 +221,7 @@ static int do_nanofw_image(uint8_t *buf, unsigned long size) cprintf(GREEN, " %i: ", i); print_blob_interval(&hdr->stage[i]); cprintf(OFF, "\n"); - save_blob(&hdr->stage[i], buf, size, "stage", i, NO_ENC); + save_blob(&hdr->stage[i], buf, size, "stage", i, i == 3 ? NO_ENC : CONTINOUS_ENC); } cprintf(BLUE, "Fonts\n"); for(unsigned i = 0; i < hdr->nr_fonts; i++) |