Fix wrong nblocks calculation at OneNAND IPL
authorKyungmin Park <kyungmin.park@samsung.com>
Sat, 5 Jun 2010 02:20:24 +0000 (11:20 +0900)
committerKyungmin Park <kyungmin.park@samsung.com>
Sat, 5 Jun 2010 02:20:24 +0000 (11:20 +0900)
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
onenand_ipl/onenand_read.c

index 3b0f02b..6511bc7 100644 (file)
@@ -147,7 +147,7 @@ int onenand_read_block(unsigned char *buf)
        } while (0);
 #endif
 
-       nblocks = ALIGN(CONFIG_SYS_MONITOR_LEN, (1 << erase_shift));
+       nblocks = (CONFIG_SYS_MONITOR_LEN + (1 << erase_shift) - 1) >> erase_shift;
 
        /* NOTE: you must read page from page 1 of block 0 */
        /* read the block page by page */