summaryrefslogtreecommitdiff
path: root/drivers/nand_legacy/nand_legacy.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-04-12 12:26:32 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-04-12 12:26:32 +0200
commitb28a31ca0290627c531b9df0d48ec0239078d2d4 (patch)
tree780f563c9083e773f08b4ca3423b8af0c6994aba /drivers/nand_legacy/nand_legacy.c
parent3a5e21881a194f4d4e053be8410d82a2458e8544 (diff)
parent6db39708117d6391a72f3fc3ea7860231b630270 (diff)
downloadu-boot-imx-b28a31ca0290627c531b9df0d48ec0239078d2d4.zip
u-boot-imx-b28a31ca0290627c531b9df0d48ec0239078d2d4.tar.gz
u-boot-imx-b28a31ca0290627c531b9df0d48ec0239078d2d4.tar.bz2
Merge with /home/m8/git/u-boot
Diffstat (limited to 'drivers/nand_legacy/nand_legacy.c')
-rw-r--r--drivers/nand_legacy/nand_legacy.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/nand_legacy/nand_legacy.c b/drivers/nand_legacy/nand_legacy.c
index 3989ca2..458046d 100644
--- a/drivers/nand_legacy/nand_legacy.c
+++ b/drivers/nand_legacy/nand_legacy.c
@@ -10,11 +10,6 @@
*/
#include <common.h>
-
-#ifndef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY not defined in a file using the legacy NAND support!
-#endif
-
#include <command.h>
#include <malloc.h>
#include <asm/io.h>
@@ -27,7 +22,7 @@
# define SHOW_BOOT_PROGRESS(arg)
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
#include <linux/mtd/nand_legacy.h>
#include <linux/mtd/nand_ids.h>
@@ -1612,4 +1607,13 @@ static int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc)
#endif
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#ifdef CONFIG_JFFS2_NAND
+int read_jffs2_nand(size_t start, size_t len,
+ size_t * retlen, u_char * buf, int nanddev)
+{
+ return nand_legacy_rw(nand_dev_desc + nanddev, NANDRW_READ | NANDRW_JFFS2,
+ start, len, retlen, buf);
+}
+#endif /* CONFIG_JFFS2_NAND */
+
+#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY) */