From: Ollie Lho <ollie@sis.com.tw>
To: Ian <Relativity@HumanHeuristic.com>
Cc: Ronald G Minnich <rminnich@lanl.gov>,
mtd@infradead.org, linuxbios@lanl.gov
Subject: Re: Problems with r/w on mtdblock0
Date: Wed, 06 Dec 2000 08:41:50 +0800 [thread overview]
Message-ID: <3A2D8B4E.BBF15715@sis.com.tw> (raw)
In-Reply-To: 200012060019.KAA19472@singularity.tronunltd.com
Ian wrote:
>
> However! If you *then* do a dd and transfer any_other_file
> into /dev/mtd0, the new contents are logically "and"ed with
> the old contents of /dev/mtd0. Ie;
>
>
> So if I take a hexdump of the first line of the "doc_loadbios" binary;
> #hexdump -v doc_loadbios | more
> 0000000 457f 464c 0101 0001 0000 0000 0000 0000
>
> .. the first line of my bios image;
> #hdexdump -v bios | more
> 0000000 69b0 80e6 0000 0000 0000 0000 0000 0000
>
> .. and "and" the two;
> 0110100110110000 = 69b0h
> 0100010101111111 = 4575h
> ================
> 0100000100110000
>
> ... I get the first word displayed by /dev/mtd0 after the dd (see above)
> 0100000100110000 = 4130h
>
> Is /dev/mtd0 supposed to behave like this, or have I just rediscovered a
> deliberate "feature" ... ?
>
Of course it WILL BEHAVIOR THIS WAY !!!!
The DoC has an NAND flash chip in side. For NAND flash chip
you can only turn each bit form 1 to 0 by WRITE operation,
not the other way around. The only way to turn a 0 bit to 1
is by a ERASE operation. This is why I have to erase the first
few Erase Blocks befor writing the DoC in my loaddoc script.
# Erase the first 128 pages of the DoC,
# 128 pages == 128 page * 512 bytes per page == 1 MB
./erase /dev/mtd0 0 128
# Use dd to (zero) pad linuxbios.strip to 63 KB
dd conv=sync bs=63k if=$LINUXBIOS/util/config/winfast/linuxbios.strip \
of=linuxbios.block
# Use dd to wrtie IPL to the first and second pages (page 0, 1) on the DoC
# N.B. if you are using 2.4.0-test10 and later kernel, the conv=notrunc
# is neceressary.
dd if=$LINUXBIOS/util/config/winfast/docipl of=/dev/mtd0 conv=notrunc
dd if=$LINUXBIOS/util/config/winfast/docipl of=/dev/mtd0 seek=1 conv=notrunc
Ollie
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
next prev parent reply other threads:[~2000-12-06 0:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-06 0:19 Problems with r/w on mtdblock0 Ian
2000-12-06 0:41 ` Ollie Lho [this message]
2000-12-06 2:18 ` Nicolas Pitre
-- strict thread matches above, loose matches on Subject: below --
2000-12-06 4:33 Ian
2000-12-06 3:07 Ian
2000-12-06 2:45 Ian
2000-12-06 2:28 Ian
2000-12-06 2:52 ` Nicolas Pitre
2000-12-05 1:54 Ian
2000-12-05 9:15 ` David Woodhouse
2000-12-05 14:50 ` Ronald G Minnich
2000-12-05 14:54 ` David Woodhouse
2000-12-05 15:34 ` Nicolas Pitre
2000-12-05 15:36 ` David Woodhouse
2000-12-05 19:38 ` Ronald G Minnich
2000-12-05 0:42 Ian
2000-12-04 22:36 Ian
2000-12-05 1:10 ` Ollie Lho
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=3A2D8B4E.BBF15715@sis.com.tw \
--to=ollie@sis.com.tw \
--cc=Relativity@HumanHeuristic.com \
--cc=linuxbios@lanl.gov \
--cc=mtd@infradead.org \
--cc=rminnich@lanl.gov \
/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