summaryrefslogtreecommitdiff
path: root/board/tqc/tqm8272
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2008-08-28 13:48:36 +0200
committerWolfgang Denk <wd@denx.de>2008-09-06 23:30:51 +0200
commit584f979f7ee914e32d408739cbdd2c4457ec18b8 (patch)
tree90492d0ef512dd846d9e30a53ff4f4685e5f2c68 /board/tqc/tqm8272
parent1a7f8ccec981648ccd38fca2535490582eee08e6 (diff)
TQM8272: Fix compiling error for the TQM8272 board.
Fix compile problems caused by commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'board/tqc/tqm8272')
-rw-r--r--board/tqc/tqm8272/tqm8272.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/board/tqc/tqm8272/tqm8272.c b/board/tqc/tqm8272/tqm8272.c
index 3a2376c3f94..0da16e7e33e 100644
--- a/board/tqc/tqm8272/tqm8272.c
+++ b/board/tqc/tqm8272/tqm8272.c
@@ -1069,10 +1069,22 @@ int update_flash_size (int flash_size)
static u8 hwctl = 0;
-static void upmnand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+static void upmnand_write_byte(struct mtd_info *mtdinfo, u_char byte)
{
- struct nand_chip *this = mtd->priv;
+ 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 void upmnand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
if (ctrl & NAND_CTRL_CHANGE) {
if ( ctrl & NAND_CLE )
hwctl |= 0x1;
@@ -1084,21 +1096,7 @@ static void upmnand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
hwctl &= ~0x2;
}
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);
- }
+ upmnand_write_byte (mtd, cmd);
}
static u_char upmnand_read_byte(struct mtd_info *mtdinfo)
@@ -1191,7 +1189,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