From 4e880df3470eb099c9934e6b37af87ab47255c52 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 12 Jun 2015 07:03:43 +0200 Subject: imx-bbu-nand-fcb: Erase whole partition Now that we use a partition for the bootloader instead of the whole NAND device we can erase it completely instead of hardcoded 2MB. Signed-off-by: Sascha Hauer --- common/imx-bbu-nand-fcb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'common/imx-bbu-nand-fcb.c') diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c index d65b9cd91f..c4f49b551a 100644 --- a/common/imx-bbu-nand-fcb.c +++ b/common/imx-bbu-nand-fcb.c @@ -275,11 +275,10 @@ static int fcb_create(struct imx_nand_fcb_bbu_handler *imx_handler, static int imx_bbu_erase(struct mtd_info *mtd) { uint64_t offset = 0; - int len = SZ_2M; struct erase_info erase; int ret; - while (len > 0) { + while (offset < mtd->size) { pr_debug("erasing at 0x%08llx\n", offset); if (mtd_block_isbad(mtd, offset)) { pr_debug("erase skip block @ 0x%08llx\n", offset); @@ -296,7 +295,6 @@ static int imx_bbu_erase(struct mtd_info *mtd) return ret; offset += mtd->erasesize; - len -= mtd->erasesize; } return 0; -- cgit v1.2.3