Index: drivers/mtd/nand/Kconfig =================================================================== RCS file: /home/cvs/mtd/drivers/mtd/nand/Kconfig,v retrieving revision 1.26 diff -u -r1.26 Kconfig --- drivers/mtd/nand/Kconfig 5 Jan 2005 12:42:24 -0000 1.26 +++ drivers/mtd/nand/Kconfig 9 Feb 2005 08:17:20 -0000 @@ -204,4 +204,11 @@ The simulator may simulate verious NAND flash chips for the MTD nand layer. +config MTD_NAND_IDE + tristate "Support for NAND Flash through a PC's IDE interface" + depends on MTD_NAND && MTD_PARTITIONS + help + This enables the driver for accessing NAND Flash through the + IDE interface of a PC. + endmenu Index: drivers/mtd/nand/Makefile.common =================================================================== RCS file: /home/cvs/mtd/drivers/mtd/nand/Makefile.common,v retrieving revision 1.15 diff -u -r1.15 Makefile.common --- drivers/mtd/nand/Makefile.common 26 Nov 2004 12:28:22 -0000 1.15 +++ drivers/mtd/nand/Makefile.common 9 Feb 2005 08:17:20 -0000 @@ -20,5 +20,6 @@ obj-$(CONFIG_MTD_NAND_RTC_FROM4) += rtc_from4.o obj-$(CONFIG_MTD_NAND_SHARPSL) += sharpsl.o obj-$(CONFIG_MTD_NAND_NANDSIM) += nandsim.o +obj-$(CONFIG_MTD_NAND_IDE) += ide.o nand-objs = nand_base.o nand_bbt.o Index: drivers/mtd/nand/nand_base.c =================================================================== RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v retrieving revision 1.130 diff -u -r1.130 nand_base.c --- drivers/mtd/nand/nand_base.c 24 Jan 2005 03:07:43 -0000 1.130 +++ drivers/mtd/nand/nand_base.c 9 Feb 2005 08:17:24 -0000 @@ -84,6 +84,8 @@ #include #endif +#define NAND_USE_IO_INSTR 0 + /* Define default oob placement schemes for large and small page devices */ static struct nand_oobinfo nand_oob_8 = { .useecc = MTD_NANDECC_AUTOPLACE, @@ -189,7 +191,13 @@ static u_char nand_read_byte(struct mtd_info *mtd) { struct nand_chip *this = mtd->priv; - return readb(this->IO_ADDR_R); + + switch(NAND_USE_IO_INSTR) { + case 0: + return readb(this->IO_ADDR_R); + case 1: + return inb((unsigned int) this->IO_ADDR_R); + } } /** @@ -202,7 +210,15 @@ static void nand_write_byte(struct mtd_info *mtd, u_char byte) { struct nand_chip *this = mtd->priv; - writeb(byte, this->IO_ADDR_W); + + switch(NAND_USE_IO_INSTR) { + case 0: + writeb(byte, this->IO_ADDR_W); + break; + case 1: + outb(byte, (unsigned int) this->IO_ADDR_W); + break; + } } /** @@ -295,8 +311,16 @@ int i; struct nand_chip *this = mtd->priv; - for (i=0; iIO_ADDR_W); + switch(NAND_USE_IO_INSTR) { + case 0: + for (i=0; iIO_ADDR_W); + break; + case 1: + for (i=0; iIO_ADDR_W); + break; + } } /** @@ -312,8 +336,16 @@ int i; struct nand_chip *this = mtd->priv; - for (i=0; iIO_ADDR_R); + switch(NAND_USE_IO_INSTR) { + case 0: + for (i=0; iIO_ADDR_R); + break; + case 1: + for (i=0; iIO_ADDR_R); + break; + } } /** @@ -329,10 +361,18 @@ int i; struct nand_chip *this = mtd->priv; - for (i=0; iIO_ADDR_R)) - return -EFAULT; - + switch(NAND_USE_IO_INSTR) { + case 0: + for (i=0; iIO_ADDR_R)) + return -EFAULT; + break; + case 1: + for (i=0; iIO_ADDR_R)) + return -EFAULT; + break; + } return 0; }