From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] NAND on Davinci boards
Date: Wed, 16 Mar 2011 09:22:41 +0100 [thread overview]
Message-ID: <4D807351.4020504@denx.de> (raw)
Hi all,
I have seen an incompatibility between the NAND driver in u-boot for the
davinci boards and the linux driver (kernel 2.6.38, mainline).
I think it is not related to the specific board I use. In any case, I am
using the ea20 board (OMAP-L138 based, in u-boot mainline), and I have
added NAND support setting for the driver:
#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
#define CONFIG_SYS_NAND_USE_FLASH_BBT
This is done in the linux driver, too. Both drivers are using ECC in
Hardware, the number of bits for ECC is set to 4, the OOB is set first,
and the oob layout is the same.
The NAND driver under u-boot works flawless. The kernel is stored on
NAND (the board boots from a SPI-Flash), and everything seems correct.
The same thing under linux. In Linux I am able to set up a root
filesystem with UBIfs, everything ok. Problems arises when u-boot tries
to access to data written from Linux and viceversa. It seems to me that
the management of ECC is different in u-boot and in kernel.
If I write under Linux a kernel Image in a NAND partition, after a reset
I am not able to read that partition from u-boot.
Setting MTDDEBUG and a couple of printf, I see that nand_do_read_ops()
report an error:
if (mtd->ecc_stats.failed - stats.failed)
return -EBADMSG;
This is the output of my board:
nboot aKernel
Loading from nand0, offset 0x0
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
Returning error 4 0
nand_bbt: ECC error while reading bad block table
nand_read_bbt: Bad block at 0x000002220000
nand_read_bbt: Bad block at 0x00000b120000
nand_read_bbt: Bad block at 0x00001f100000
nand_isbad_bbt(): bbt info for offs 0x00000000: (block 0) 0x00
Returning error 8 4
NAND read from offset 0 failed -74
** Read error
Checking the two drivers, it seems to me that they are doing different
things. However, I do not know which one is correct. I would think that
the driver in u-boot is old and must be synchronized with the Linux's
driver, but after checking how u-boot gets the ecc's error from Hardware
it seems to me it is correct.
Has anyone seen the same issue or have proposal, which driver should be
modified ?
Best regards,
Stefano Babic
--
=====================================================================
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
=====================================================================
next reply other threads:[~2011-03-16 8:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 8:22 Stefano Babic [this message]
2011-03-16 10:01 ` [U-Boot] NAND on Davinci boards Nick Thompson
2011-03-16 12:01 ` Stefano Babic
2011-03-16 12:12 ` Nick Thompson
2011-03-16 12:36 ` Stefano Babic
2011-03-16 12:58 ` Nick Thompson
2011-03-16 13:05 ` Ben Gardiner
2011-03-16 14:44 ` Stefano Babic
2011-03-16 17:24 ` Stefano Babic
2011-03-16 17:46 ` Ben Gardiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D807351.4020504@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox