karo: tx53: romupdate: fix calculation of starting block in tx53_prog_uboot()
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 30 Jun 2016 08:46:00 +0000 (10:46 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 30 Jun 2016 08:46:00 +0000 (10:46 +0200)
board/karo/tx53/flash.c

index c5fe8d7..19bb9b6 100644 (file)
@@ -211,9 +211,9 @@ static int tx53_prog_uboot(void *addr, int start_block, int skip,
        nand_erase_options_t erase_opts = { 0, };
        size_t actual;
        size_t prg_length = max_len - skip * mtd->erasesize;
        nand_erase_options_t erase_opts = { 0, };
        size_t actual;
        size_t prg_length = max_len - skip * mtd->erasesize;
-       int prg_start = (start_block + skip) * mtd->erasesize;
+       int prg_start = start_block * mtd->erasesize;
 
 
-       erase_opts.offset = start_block * mtd->erasesize;
+       erase_opts.offset = (start_block - skip) * mtd->erasesize;
        erase_opts.length = max_len;
        erase_opts.quiet = 1;
 
        erase_opts.length = max_len;
        erase_opts.quiet = 1;