]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/nand/nand.c
Merge with /home/wd/git/u-boot/testing-NAND/ to add new NAND handling.
[karo-tx-uboot.git] / drivers / nand / nand.c
index d187c89ea1311011cfa8b4311da3ca4769a9b984..bc85005b2af28429898691143ca2a13ee4e2da0b 100644 (file)
@@ -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 */
+