--- /opt/mtd/drivers/mtd/nand/nand_base.c 2004-12-14 07:00:18.000000000 +0800 +++ nand_base.c 2005-01-01 21:58:19.000000000 +0800 @@ -66,6 +66,8 @@ #include #endif +#define NAND_USE_IO_INSTR 1 + /* Define default oob placement schemes for large and small page devices */ static struct nand_oobinfo nand_oob_8 = { .useecc = MTD_NANDECC_AUTOPLACE, @@ -171,7 +173,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); + } } /** @@ -184,7 +192,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; + } } /** @@ -277,8 +293,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; + } } /** @@ -294,8 +318,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; + } } /** @@ -311,10 +343,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; }