public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] Fix the NAND size overflow issue.
@ 2008-09-19  9:32 Jason Jin
  2008-09-19  9:32 ` [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xx and 85xx Jason Jin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jason Jin @ 2008-09-19  9:32 UTC (permalink / raw)
  To: u-boot

When the NAND size is or large than 4G, the size will overflow,
The adjustment in this patch try to fix this.

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
---
 drivers/mtd/nand/nand.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index ebd2acd..71a0e4b 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -63,11 +63,11 @@ void nand_init(void)
 	unsigned int size = 0;
 	for (i = 0; i < CFG_MAX_NAND_DEVICE; i++) {
 		nand_init_chip(&nand_info[i], &nand_chip[i], base_address[i]);
-		size += nand_info[i].size;
+		size += nand_info[i].size / 1024;
 		if (nand_curr_device == -1)
 			nand_curr_device = i;
 	}
-	printf("%u MiB\n", size / (1024 * 1024));
+	printf("%u MiB\n", size / 1024);
 
 #ifdef CFG_NAND_SELECT_DEVICE
 	/*
-- 
1.5.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-10-14 11:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-19  9:32 [U-Boot] [PATCH 1/4] Fix the NAND size overflow issue Jason Jin
2008-09-19  9:32 ` [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xx and 85xx Jason Jin
2008-09-19  9:32   ` [U-Boot] [PATCH 3/4] Enable NAND support for MPC8536DS board Jason Jin
2008-09-19  9:32     ` [U-Boot] [PATCH 4/4] Enable NAND support for MPC8572DS board Jason Jin
2008-10-07 16:32   ` [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xx and 85xx Scott Wood
2008-10-08  9:45     ` [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xxand 85xx Jin Zhengxiong-R64188
2008-10-08 14:58       ` Anton Vorontsov
2008-09-19 10:04 ` [U-Boot] [PATCH 1/4] Fix the NAND size overflow issue Jens Gehrlein
2008-09-23  2:20   ` Jin Zhengxiong-R64188
2008-10-14 11:27 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox