From: Dan Brown <dan_brown@ieee.org>
To: "Joseph M Dupre (AVAB Inc.)" <dupre@avab.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: docboot: nandwrite: Input file is not page aligned
Date: Tue, 11 Oct 2005 09:42:42 -0400 [thread overview]
Message-ID: <434BC152.6060105@ieee.org> (raw)
In-Reply-To: <434A9F39.29129.1B3216A@localhost>
I can shed some light on some of these issues:
Joseph M Dupre (AVAB Inc.) wrote:
> I am trying to use the /mtd/docboot tool to place a boot image on a
> DOC 2000 (INFTL version), but nandwrite is failing:
>
> # cat /proc/mtd
> dev: size erasesize name
> mtd0: 08000000 00004000 "DiskOnChip 2000 (INFTL Model)"
> mtd1: 00a14000 00004000 " DiskOnChip BDK partition"
> mtd2: 075dc000 00004000 " DiskOnChip BDTL partition"
> # flash_eraseall /dev/mtd1
> erasing 16 Kibyte @ 74000 -- 4 % complete
> Skipping badblock @ 0x00078000
> Erasing 16 Kibyte @ a10000 -- 99 % complete.
First thing to note: The "Skipping badblock" is reporting the location
of the bad block *relative to the start of mtd1*, not relative to the
start of the entire device. More on this below.
> # nandwrite -o /dev/mtd1 doc_spl
> Input file is not page aligned: Success
> Data did not fit into device, due to bad blocks.
> : Success
>
> First, what is this "Input file is not page aligned" error and how do
> I make the doc_spl image so that it is page aligned?
This is odd. Can you show me the output of the 'make' command (in
particular, it prints some info on the # and types of sectors in
doc_spl)? Also, what is the exact size of your doc_spl?
> Second, there is only one bad block on the 10MB BDK partition, so
> there shouldn't be any problem loading my doc_spl which is only 1.9MB
> (Unless nandwrite is not aware of bad blocks.) How do I fix that
> issue?
This is a bug in nandwrite. Only the first error message (not page
aligned) is real. The second one is a completely bogus consequence of
the first. Basically, the first error skips over the entire writing
process to a piece of code designed to close down all the files. It
also checks the amount of unwritten data (in your case, ALL of it), and
reports an error if any data was unwritten. Ugh.
> Third, when the kernel reads the bbt it reports two bad blocks:
> nand_read_bbt: Bad block at 0x00080000
> nand_read_bbt: Bad block at 0x03370000
> nand_read_bbt: Reserved block at 0x07ffc000
> That, in conjunction with the badblock reported by flash_eraseall,
> indicates to me that the IPL is actually using 2 eraseblocks.
> (0x0080000 - 0x00078000 = 0x00008000)
> I thought the IPL is only supposed to be in the first erase block.
> Is that correct?
Here's what's really happening:
- The IPL does indeed take up just one block, the first block.
- The MediaHeader takes up the second block.
- /dev/mtd1 starts at the third block, at 0x8000.
- Nandwrite reports a bad block at 0x78000 from the start of mtd1.
- Adding in the start address of mtd1 we get 0x78000 + 0x8000 = 0x80000.
- This agrees with the bbt scan.
Hopefully we can figure out your 'not page aligned' issue with some more
info.
-Dan
next prev parent reply other threads:[~2005-10-11 13:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-11 0:04 docboot: nandwrite: Input file is not page aligned Joseph M Dupre (AVAB Inc.)
2005-10-11 13:42 ` Dan Brown [this message]
2005-10-11 17:49 ` Joseph M Dupre (AVAB Inc.)
2005-10-11 18:02 ` Dan Brown
2005-10-11 21:44 ` Joseph M Dupre (AVAB Inc.)
2005-10-13 16:44 ` Joseph M Dupre (AVAB Inc.)
2005-10-21 17:45 ` Joseph M Dupre (AVAB Inc.)
2005-10-24 13:15 ` Dan Brown
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=434BC152.6060105@ieee.org \
--to=dan_brown@ieee.org \
--cc=dupre@avab.com \
--cc=linux-mtd@lists.infradead.org \
/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