diff options
Diffstat (limited to 'drivers/nand/nand.c')
-rw-r--r-- | drivers/nand/nand.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/nand/nand.c b/drivers/nand/nand.c index d187c89..bc85005 100644 --- a/drivers/nand/nand.c +++ b/drivers/nand/nand.c @@ -23,6 +23,7 @@ #include <common.h> +#ifdef CONFIG_NEW_NAND_CODE #if (CONFIG_COMMANDS & CFG_CMD_NAND) #include <nand.h> @@ -46,12 +47,12 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand, { mtd->priv = nand; - nand->IO_ADDR_R = nand->IO_ADDR_W = base_addr; + nand->IO_ADDR_R = nand->IO_ADDR_W = (void __iomem *)base_addr; board_nand_init(nand); if (nand_scan(mtd, 1) == 0) { if (!mtd->name) - mtd->name = default_nand_name; + mtd->name = (char *)default_nand_name; } else mtd->name = NULL; @@ -60,12 +61,16 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand, void nand_init(void) { int i; - + 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; if (nand_curr_device == -1) nand_curr_device = i; - } +} + printf("%lu MiB\n", size / (1024 * 1024)); } #endif +#endif /* CONFIG_NEW_NAND_CODE */ + |