Skip to contentSkip to conversation

TQM8272: Fix compiling error for the TQM8272 board.

U-Boot Superseded Heiko Schocher 4 participants 13 messages Aug 27, 2008 – Sep 6, 2008

lore
Share & tools
lore
#0 lore raw

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 <[email protected]>

         Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100)
committer       Scott Wood <[email protected]>
         Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500)

commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b

Couldnt try this patch, because I have no longer the Hardware :-(

---
 board/tqc/tqm8272/tqm8272.c |   35 ++++++++++-------------------------
 1 files changed, 10 insertions(+), 25 deletions(-)
board/tqc/tqm8272/tqm8272.c +10 -25
index a0ec254..8b95143 100644
@@ -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
Signature · 5 lines
1.5.6.1

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw

Hi Heiko,

On Wednesday 27 August 2008, Heiko Schocher wrote:

<snip>

board/tqc/tqm8272/tqm8272.c int update_flash_size (int flash_size) · line 1073

Quoted 12 lines

+++ b/board/tqc/tqm8272/tqm8272.c

board/tqc/tqm8272/tqm8272.c +2 -2
@@ -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;

You have integrated this NAND driver into the tqm8272.c source file. I suggest you move this at some time into the drivers/mtd/nand directory. Is it a TQM8272 specific driver? Or is this MPC8xxx specific? From the name of the functions (upm_xxx) this seems to match the already available driver under:

drivers/mtd/nand/fsl_upm.c

Is it possible that you can use this common FSL-UPM version?

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#2 lore raw

Hello Stefan,

Quoted 9 lines · Stefan Roese

On Wednesday 27 August 2008, Heiko Schocher wrote:

<snip>

Quoted 5 lines

+++ b/board/tqc/tqm8272/tqm8272.c

board/tqc/tqm8272/tqm8272.c +0 -0
@@ -1066,38 +1066,24 @@ int update_flash_size (int flash_size)
 #include <nand.h>
 #include <linux/mtd/mtd.h>
 
Quoted 10 lines

board/tqc/tqm8272/tqm8272.c int update_flash_size (int flash_size) · line 1073

Quoted 7 lines
board/tqc/tqm8272/tqm8272.c +2 -2
-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;

You have integrated this NAND driver into the tqm8272.c source file. I suggest you move this at some time into the drivers/mtd/nand directory. Is it a

Why? That are just the boardspecific routines, not a complete NAND driver!

Quoted 6 lines

TQM8272 specific driver? Or is this MPC8xxx specific? From the name of the functions (upm_xxx) this seems to match the already available driver under:

drivers/mtd/nand/fsl_upm.c

Is it possible that you can use this common FSL-UPM version?

Maybe this is posible, but without the Hardware to try this new version, I dont like to make such a "big" change ...

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw
Quoted 5 lines · Heiko Schocher
Quoted 3 lines

You have integrated this NAND driver into the tqm8272.c source file. I suggest you move this at some time into the drivers/mtd/nand directory. Is it a

Why? That are just the boardspecific routines, not a complete NAND driver!

It looks like a complete NAND driver to me. I'm referring to the CPU- / board-specific part of it. The part in:

#if defined(CONFIG_CMD_NAND)

#include <nand.h>
#include <linux/mtd/mtd.h>

static u8 hwctl = 0;
...

is what I'm talking about.

Quoted 10 lines
Quoted 7 lines

TQM8272 specific driver? Or is this MPC8xxx specific? From the name of the functions (upm_xxx) this seems to match the already available driver under:

drivers/mtd/nand/fsl_upm.c

Is it possible that you can use this common FSL-UPM version?

Maybe this is posible, but without the Hardware to try this new version, I dont like to make such a "big" change ...

Understood. But at least extracting this driver into a separate file would help to identify this code as NAND driver. Just my 0.02 $.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#4 lore raw

PATCH v2 1/1 TQM8272: Fix compiling error for the TQM8272 board.

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 <[email protected]>

         Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100)
committer       Scott Wood <[email protected]>
         Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500)

commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b

Also moved the NAND Code in a seperate File.

Couldnt try this patch, because I have no longer the Hardware :-(

---

Update since last Patch:

- move NAND functions from tqm8272.c in seperate nand.c File

 board/tqc/tqm8272/Makefile  |    2 +-
 board/tqc/tqm8272/nand.c    |  266 +++++++++++++++++++++++++++++++++++++++++
 board/tqc/tqm8272/tqm8272.c |  277 +------------------------------------------
 board/tqc/tqm8272/tqm8272.h |   51 ++++++++
 4 files changed, 319 insertions(+), 277 deletions(-)
 create mode 100644 board/tqc/tqm8272/nand.c
 create mode 100644 board/tqc/tqm8272/tqm8272.h
board/tqc/tqm8272/Makefile +1 -1
index 6730263..c97fe14 100644
@@ -28,7 +28,7 @@ endif
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	= $(BOARD).o ../tqm8xx/load_sernum_ethaddr.o
+COBJS	= $(BOARD).o ../tqm8xx/load_sernum_ethaddr.o nand.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/tqc/tqm8272/nand.c new file +266 -0

266 lines not on this page · raw message

board/tqc/tqm8272/tqm8272.c +1 -276

301 lines not on this page · raw message

board/tqc/tqm8272/tqm8272.h new file +51 -0

51 lines not on this page · raw message

Signature · 5 lines
1.5.6.1

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

PATCH v2 1/1 TQM8272: Fix compiling error for the TQM8272 board.

Quoted 14 lines · Heiko Schocher

[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

Quoted 7 lines

author William Juul <[email protected]>

         Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100)
committer       Scott Wood <[email protected]>
         Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500)

commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b

Also moved the NAND Code in a seperate File.

Please don't do these in the same patch -- especially if you do not use the -M flag with git-format-patch. It makes it difficult to see what was changed.

-Scott

#6 lore raw

PATCH v3 1/1 TQM8272: Fix compiling error for the TQM8272 board.

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 <[email protected]>

         Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100)
committer       Scott Wood <[email protected]>
         Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500)

commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b

---
 board/tqc/tqm8272/tqm8272.c |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)
board/tqc/tqm8272/tqm8272.c +15 -18
index a0ec254..a3d37f6 100644
@@ -1068,10 +1068,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;
@@ -1083,21 +1095,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)
@@ -1190,7 +1188,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
Signature · 6 lines
1.5.6.1


-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#7 lore raw

PATCH v3 1/1 TQM8272: Fix compiling error for the TQM8272 board.

Dear Heiko Schocher,

Quoted 20 lines · In message <[email protected]> you wrote:

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 <[email protected]>

         Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100)
committer       Scott Wood <[email protected]>
         Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500)
Quoted 6 lines

commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b

---
 board/tqc/tqm8272/tqm8272.c |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
ATTENTION: Despite Any Other Listing of Product Contents Found  Here-
on, the Consumer is Advised That, in Actuality, This Product Consists
Of 99.9999999999% Empty Space.
#8 lore raw

PATCH 1/1 TQM8272: move NAND part in seperate File

In reply to Scott Wood

Hello,

[POWERPC] TQM8272: move NAND part in seperate File

I didnt try to use drivers/mtd/nand/fsl_upm.c for the NAND driver, because I have no longer the Hardware.

---
 board/tqc/tqm8272/Makefile  |    2 +-
 board/tqc/tqm8272/nand.c    |  276 +++++++++++++++++++++++++++++++++++++++++++
 board/tqc/tqm8272/tqm8272.c |  276 +------------------------------------------
 board/tqc/tqm8272/tqm8272.h |   53 ++++++++
 4 files changed, 331 insertions(+), 276 deletions(-)
 create mode 100644 board/tqc/tqm8272/nand.c
 create mode 100644 board/tqc/tqm8272/tqm8272.h
board/tqc/tqm8272/Makefile +1 -1
index 6730263..c97fe14 100644
@@ -28,7 +28,7 @@ endif
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	= $(BOARD).o ../tqm8xx/load_sernum_ethaddr.o
+COBJS	= $(BOARD).o ../tqm8xx/load_sernum_ethaddr.o nand.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/tqc/tqm8272/nand.c new file +276 -0

276 lines not on this page · raw message

board/tqc/tqm8272/tqm8272.c +1 -275

300 lines not on this page · raw message

board/tqc/tqm8272/tqm8272.h new file +53 -0

53 lines not on this page · raw message

Signature · 5 lines
1.5.6.1

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#9 lore raw

PATCH 1/1 TQM8272: move NAND part in seperate File

Dear Heiko Schocher,

Quoted 8 lines · In message <[email protected]> you wrote:

Hello,

[POWERPC] TQM8272: move NAND part in seperate File

I didnt try to use drivers/mtd/nand/fsl_upm.c for the NAND driver, because I have no longer the Hardware.

Quoted 8 lines
---
 board/tqc/tqm8272/Makefile  |    2 +-
 board/tqc/tqm8272/nand.c    |  276 +++++++++++++++++++++++++++++++++++++++++++
 board/tqc/tqm8272/tqm8272.c |  276 +------------------------------------------
 board/tqc/tqm8272/tqm8272.h |   53 ++++++++
 4 files changed, 331 insertions(+), 276 deletions(-)
 create mode 100644 board/tqc/tqm8272/nand.c
 create mode 100644 board/tqc/tqm8272/tqm8272.h

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Premature optimization is the root of all evil.         -- D.E. Knuth
#10 lore raw

PATCH v2 1/1 TQM8272: Fix compiling error for the TQM8272 board.

In reply to Heiko Schocher

Dear Heiko Schocher,

Quoted 20 lines · In message <[email protected]> you wrote:

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 <[email protected]>

         Wed, 31 Oct 2007 12:53:06 +0000 (13:53 +0100)
committer       Scott Wood <[email protected]>
         Tue, 12 Aug 2008 16:31:15 +0000 (11:31 -0500)
Quoted 8 lines

commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b

Also moved the NAND Code in a seperate File.

Couldnt try this patch, because I have no longer the Hardware :-(

---

Applied (with slightly edited commit messages).

Please keep in mind that all commets should go *below* the '---' line.

Thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Faith: not *wanting* to know what is true."    - Friedrich Nietzsche
#11 lore raw
In reply to Heiko Schocher
Quoted 12 lines · Heiko Schocher

static void upmnand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) {

board/tqc/tqm8272/tqm8272.c +2 -5
 	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 )

board/tqc/tqm8272/tqm8272.c int update_flash_size (int flash_size) · line 1082

Quoted 10 lines
board/tqc/tqm8272/tqm8272.c +7 -3
-			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 ;

You shouldn't be writing any bytes unless cmd != NAND_CMD_NONE.

As Stefan pointed out, is there any reason you can't use drivers/mtd/nand/fsl_upm.c?

-Scott

#12 lore raw

Hello Scott,

Quoted 17 lines · Scott Wood
Quoted 16 lines · Heiko Schocher

static void upmnand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) {

board/tqc/tqm8272/tqm8272.c +3 -8
 	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 ) {
Quoted 8 lines

board/tqc/tqm8272/tqm8272.c int update_flash_size (int flash_size) · line 1082

Quoted 6 lines
board/tqc/tqm8272/tqm8272.c +6 -0
+			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 ;

You shouldn't be writing any bytes unless cmd != NAND_CMD_NONE.

Ah, okay ...

Quoted 2 lines

As Stefan pointed out, is there any reason you can't use drivers/mtd/nand/fsl_upm.c?

Yes, as I wrote to Stefan, I have no longer the Hardware and I fear such a big change ...

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany