#include <malloc.h>
#include <asm/io.h>
#include <watchdog.h>
-
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
-
#include <linux/mtd/nand_legacy.h>
#include <linux/mtd/nand_ids.h>
#include <jffs2/jffs2.h>
nand->erasesize = nand_flash_ids[i].erasesize;
nand->chips_name = nand_flash_ids[i].name;
nand->bus16 = nand_flash_ids[i].bus16;
- return 1;
+ return 1;
}
return 0;
}
/* Send the read command */
NanD_Command(nand, NAND_CMD_READ0);
if (nand->bus16) {
- NanD_Address(nand, ADDR_COLUMN_PAGE,
+ NanD_Address(nand, ADDR_COLUMN_PAGE,
(page << nand->page_shift) + (col >> 1));
} else {
- NanD_Address(nand, ADDR_COLUMN_PAGE,
+ NanD_Address(nand, ADDR_COLUMN_PAGE,
(page << nand->page_shift) + col);
}
NAND_WP_OFF();
#endif
- NAND_ENABLE_CE(nand); /* set pin low */
+ NAND_ENABLE_CE(nand); /* set pin low */
/* Check the WP bit */
NanD_Command(nand, NAND_CMD_STATUS);
/* De-select the NAND device */
NAND_DISABLE_CE(nand); /* set pin high */
#ifdef CONFIG_OMAP1510
- archflashwp(0,1);
+ archflashwp(0,1);
#endif
#ifdef CFG_NAND_WP
NAND_WP_ON();
NAND_ENABLE_CE(nand); /* set pin low */
NanD_Command(nand, NAND_CMD_READOOB);
if (nand->bus16) {
- NanD_Address(nand, ADDR_COLUMN_PAGE,
+ NanD_Address(nand, ADDR_COLUMN_PAGE,
((ofs >> nand->page_shift) << nand->page_shift) +
- ((ofs & (nand->oobblock - 1)) >> 1));
+ ((ofs & (nand->oobblock - 1)) >> 1));
} else {
NanD_Address(nand, ADDR_COLUMN_PAGE, ofs);
}
/* issue the Read2 command to set the pointer to the Spare Data Area. */
NanD_Command(nand, NAND_CMD_READOOB);
if (nand->bus16) {
- NanD_Address(nand, ADDR_COLUMN_PAGE,
+ NanD_Address(nand, ADDR_COLUMN_PAGE,
((ofs >> nand->page_shift) << nand->page_shift) +
- ((ofs & (nand->oobblock - 1)) >> 1));
+ ((ofs & (nand->oobblock - 1)) >> 1));
} else {
- NanD_Address(nand, ADDR_COLUMN_PAGE, ofs);
+ NanD_Address(nand, ADDR_COLUMN_PAGE, ofs);
}
/* update address for 2M x 8bit devices. OOB starts on the second */
/* issue the Serial Data In command to initial the Page Program process */
NanD_Command(nand, NAND_CMD_SEQIN);
if (nand->bus16) {
- NanD_Address(nand, ADDR_COLUMN_PAGE,
+ NanD_Address(nand, ADDR_COLUMN_PAGE,
((ofs >> nand->page_shift) << nand->page_shift) +
- ((ofs & (nand->oobblock - 1)) >> 1));
+ ((ofs & (nand->oobblock - 1)) >> 1));
} else {
- NanD_Address(nand, ADDR_COLUMN_PAGE, ofs);
+ NanD_Address(nand, ADDR_COLUMN_PAGE, ofs);
}
/* treat crossing 8-byte OOB data for 2M x 8bit devices */
NanD_Command(nand, NAND_CMD_PAGEPROG);
NanD_Command(nand, NAND_CMD_STATUS);
#ifdef NAND_NO_RB
- { u_char ret_val;
+ { u_char ret_val;
do {
ret_val = READ_NAND(nandptr); /* wait till ready */
} while ((ret_val & 0x40) != 0x40);
/* De-select the NAND device */
NAND_DISABLE_CE(nand); /* set pin high */
#ifdef CONFIG_OMAP1510
- archflashwp(0,1);
+ archflashwp(0,1);
#endif
#ifdef CFG_NAND_WP
NAND_WP_ON();
start, len, retlen, buf);
}
#endif /* CONFIG_JFFS2_NAND */
-
-#endif