diff mbox

[BUG] Nand support broken with v2.6.36-rc1

Message ID 4C6AD9C2.1070705@broadcom.com
State New, archived
Headers show

Commit Message

Brian Norris Aug. 17, 2010, 6:49 p.m. UTC
Hi,

On 08/17/2010 10:47 AM, Michael Guntsche wrote:
> First, I am just an end user so I have no access to the datasheets etc. I
> just got the code from the board manufactrurer (2.6.27) and forward
> port it to recent kernels.

I see. No problem. We'll work with what you can do:

If you can simply find the NAND chip part number (it would be printed on 
the chip itself), that will be helpful.

Also, there are a few things you can do under a working kernel (e.g., 
2.6.35?).

First, have you ever used any of the mtdutils? In particular, running 
the command "mtdinfo -a" and sending the output is helpful if you have 
the utility installed on your board.

Second, since you are doing the forward-porting, I assume you can do a 
little bit of coding/patching. To print the whole ID string, you can add 
a simple "printk" line to the code in "drivers/mtd/nand/nand_base.c". 
For example, on the 2.6.35 kernel, you can just apply the patch below. 
Then, on boot, the ID string will print (or at least show up in "dmesg" 
or "syslog"). That info can help a little.

> The reason I am using a specific layout is because the bootloader on
> this board expects it this way. It formats it this way in the beginning
> and I cannot change that.

Well, if the new commit that broke your board is getting the block 
marker *correct* according to the factory specifications, then this 
particular problem is your setup's problem; perhaps there could be a 
workaround, like I mentioned about checking for these kind of conflicts. 
However, I'm still hypothesizing that I simply got the detection wrong, 
and so my fix will solve your problem.

Thanks,
Brian

---
  drivers/mtd/nand/nand_base.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

  		printk(KERN_INFO "%s: second ID read did not match "

Comments

Michael Guntsche Aug. 17, 2010, 8:05 p.m. UTC | #1
On 17 Aug 10 11:49, Brian Norris wrote:
> First, have you ever used any of the mtdutils? In particular,
> running the command "mtdinfo -a" and sending the output is helpful
> if you have the utility installed on your board.
hmm mtdinfo tries to open /sys/class/mtd/mtd0/dev which das not exist
the device is working ok as block device on the other hand so let's try
the next thing.

Output booting with a patched .36-rc1

[    0.279217] rbppc_nand_probe: MikroTik RouterBOARD 600 series NAND driver, version 0.0.2
[    0.287535] ID byte 0: 0xad
[    0.290373] ID byte 1: 0x76
[    0.293185] ID byte 2: 0xad
[    0.295985] ID byte 3: 0x76
[    0.298798] ID byte 4: 0xad
[    0.301610] ID byte 5: 0x76
[    0.304423] ID byte 6: 0xad
[    0.307223] ID byte 7: 0x76
[    0.310046] NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)

Hope this helps...
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 4a7b864..d2d1fab 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2809,8 +2809,10 @@  static struct nand_flash_dev 
*nand_get_flash_type(struct mtd_info *mtd,

  	/* Read entire ID string */

-	for (i = 0; i < 8; i++)
+	for (i = 0; i < 8; i++) {
  		id_data[i] = chip->read_byte(mtd);
+		printk(KERN_INFO "ID byte %i: %#x\n", i, id_data[i]);
+	}

  	if (id_data[0] != *maf_id || id_data[1] != dev_id) {