
Hello,
[POWERPC] TQM8272: Fix compiling error for the TQM8272 board.
tqm8272.c: In function 'upmnand_hwcontrol': tqm8272.c:1086: warning: implicit declaration of function 'writeb' tqm8272.c: In function 'board_nand_init': tqm8272.c:1193: error: 'struct nand_chip' has no member named 'write_byte' make[1]: *** [tqm8272.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [board/tqc/tqm8272/libtqm8272.a] Error 2
introduced from commit:
Update MTD to that of Linux 2.6.22.1
author William Juul william.juul@datarespons.no Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100) committer Scott Wood scottwood@freescale.com Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500) commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b
Couldnt try this patch, because I have no longer the Hardware :-(
Signed-off-by: Heiko Schocher hs@denx.de --- board/tqc/tqm8272/tqm8272.c | 35 ++++++++++------------------------- 1 files changed, 10 insertions(+), 25 deletions(-)
diff --git a/board/tqc/tqm8272/tqm8272.c b/board/tqc/tqm8272/tqm8272.c index a0ec254..8b95143 100644 --- a/board/tqc/tqm8272/tqm8272.c +++ b/board/tqc/tqm8272/tqm8272.c @@ -1066,38 +1066,24 @@ int update_flash_size (int flash_size) #include <nand.h> #include <linux/mtd/mtd.h>
-static u8 hwctl = 0; - static void upmnand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct nand_chip *this = mtd->priv; + ulong base = (ulong) (this->IO_ADDR_W + chipsel * CFG_NAND_CS_DIST); + unsigned char byte = (unsigned char) cmd;
if (ctrl & NAND_CTRL_CHANGE) { - if ( ctrl & NAND_CLE ) - hwctl |= 0x1; - else - hwctl &= ~0x1; - if ( ctrl & NAND_ALE ) - hwctl |= 0x2; - else - hwctl &= ~0x2; + if ( ctrl & NAND_CLE ) { + WRITE_NAND_UPM(byte, base, CFG_NAND_UPM_WRITE_CMD_OFS); + return ; + } else + if ( ctrl & NAND_ALE ) { + WRITE_NAND_UPM(byte, base, CFG_NAND_UPM_WRITE_ADDR_OFS); + return ; + } } if (cmd != NAND_CMD_NONE) - writeb(cmd, this->IO_ADDR_W); -} - -static void upmnand_write_byte(struct mtd_info *mtdinfo, u_char byte) -{ - struct nand_chip *this = mtdinfo->priv; - ulong base = (ulong) (this->IO_ADDR_W + chipsel * CFG_NAND_CS_DIST); - - if (hwctl & 0x1) { - WRITE_NAND_UPM(byte, base, CFG_NAND_UPM_WRITE_CMD_OFS); - } else if (hwctl & 0x2) { - WRITE_NAND_UPM(byte, base, CFG_NAND_UPM_WRITE_ADDR_OFS); - } else { WRITE_NAND(byte, base); - } }
static u_char upmnand_read_byte(struct mtd_info *mtdinfo) @@ -1190,7 +1176,6 @@ int board_nand_init(struct nand_chip *nand)
nand->cmd_ctrl = upmnand_hwcontrol; nand->read_byte = upmnand_read_byte; - nand->write_byte = upmnand_write_byte; nand->dev_ready = tqm8272_dev_ready;
#ifndef CONFIG_NAND_SPL