diff options
author | Marian Balakowicz <m8@semihalf.com> | 2006-04-08 19:08:06 +0200 |
---|---|---|
committer | Marian Balakowicz <m8@semihalf.com> | 2006-04-08 19:08:06 +0200 |
commit | 6db39708117d6391a72f3fc3ea7860231b630270 (patch) | |
tree | 1c69fc84c3f615fe60217096c2947744c72e3528 /drivers/nand_legacy | |
parent | 2fc000d756920b340945a74ec1214a34d9e84858 (diff) | |
download | u-boot-imx-6db39708117d6391a72f3fc3ea7860231b630270.zip u-boot-imx-6db39708117d6391a72f3fc3ea7860231b630270.tar.gz u-boot-imx-6db39708117d6391a72f3fc3ea7860231b630270.tar.bz2 |
Fix JFFS2 support for legacy NAND driver.
Some more NAND cleanup and small fixes.
Diffstat (limited to 'drivers/nand_legacy')
-rw-r--r-- | drivers/nand_legacy/nand_legacy.c | 18 |
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) */ |