projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge with /home/wd/git/u-boot/testing-NAND/ to add new NAND handling.
[platform/kernel/u-boot.git]
/
drivers
/
nand
/
nand.c
diff --git
a/drivers/nand/nand.c
b/drivers/nand/nand.c
index
d187c89
..
bc85005
100644
(file)
--- a/
drivers/nand/nand.c
+++ b/
drivers/nand/nand.c
@@
-23,6
+23,7
@@
#include <common.h>
#include <common.h>
+#ifdef CONFIG_NEW_NAND_CODE
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
#include <nand.h>
#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;
{
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)
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;
} 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;
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]);
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;
if (nand_curr_device == -1)
nand_curr_device = i;
- }
+}
+ printf("%lu MiB\n", size / (1024 * 1024));
}
#endif
}
#endif
+#endif /* CONFIG_NEW_NAND_CODE */
+