From: Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Can I write to flash using mw command
Date: Fri, 06 Oct 2006 08:22:17 -0400 [thread overview]
Message-ID: <45264A79.1090600@smiths-aerospace.com> (raw)
In-Reply-To: <20061006033619.65376.qmail@web33205.mail.mud.yahoo.com>
bilahari akkiraju wrote:
> I did
>
> protect off all
>
>
> I have tried the following command sequences but didnt
> succeed in my objective of writing to and erasing
> first sector on flash.
>
> WRITE COMMAND SEQUENCE:
>
> mw ff000555 00AA00AA
> mw ff0002AA 00550055
> mw ff000555 00A000A0
> mw ff000000 12345678
>
>
> SECTOR ERASE COMMAND SEQUENCE:
>
> mw ff000555 00AA00AA
> mw ff0002AA 00550055
> mw ff000555 00800080
> mw ff000555 00AA00AA
> mw ff0002AA 00550055
> mw ff000000 00300030
>
> Note: I tried mw.b, mw.w, mw.l with appropriate data
> but didnt succeed.
>
> In first place is it possible to write to AMD flash
> manually like this or shud it be done only
> programatically. Any one has tried writing to flash
> this way before ( I could write to Intel strata flash
> this way).
>
> I walked through u-boot code for cfi_flash.c and
> flash_write() function that is called when cp (copy)
> command is invoked, the code does the same thing, the
> only extra thing it does is it polls on data register
> bits for a certain amount of time (flash erase, write
> timeout intervals) and also does a reset to bring back
> device to read array mode
>
> mw.w ff000000 00F0 ; reset cmd
>
>
> I have a ppc 8343 processor on board. I am wondering
> if U-boot that came with my target board has
> configuration that is preventing me to write to flash
> (but cp commands works fine with flash). Any one who
> has same spansion flash chip s29GL064M can try it, I
> cannot figure out the missing link in the chain, any
> advise, comments, suggestion will be of great help
>
> Thanks,
> Bilahari
You can write to flash by hand, if you do it right. It is a good way to
learn how to do it programatically.
I believe the addresses you are using are wrong because your example
shows two 16 bit chips to make up your 32 bits of data. This means that
the LSB address line becomes a chip select between the two chips
(logically, if not physically) and is not seen by the chips themselves.
The result is the chips see the addresses shifted right 1 bit.
Equivalently, you have shift your addresses left by 1 bit to compensate.
Chip address: xxx555 => 0101 0101 0101
Your address: xxxAAA => 101 0101 0101x (x is the dropped bit)
Or, regrouped: 1010 1010 101o
(filling in 'o' for the "unused" LSB)
Chip address: xxx2AA => 0010 1010 1010
Your address: xxx554 => 0001 0101 010x
Or, regrouped: 0001 0101 010o
(filling in 'o' for the "unused" LSB)
Try the following, I suspect it will work.
WRITE COMMAND SEQUENCE:
mw ff000AAA 00AA00AA
mw ff000554 00550055
mw ff000AAA 00A000A0
mw ff000000 12345678
The standard flash driver figures this all out for you and thus works.
gvb
next prev parent reply other threads:[~2006-10-06 12:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20061005230245.240F2353C4C@atlas.denx.de>
2006-10-06 3:36 ` [U-Boot-Users] Can I write to flash using mw command bilahari akkiraju
2006-10-06 8:13 ` Wolfgang Denk
2006-10-06 12:22 ` Jerry Van Baren [this message]
2006-10-11 22:17 ` bilahari
2006-10-11 22:44 ` Ben Warren
2006-10-11 22:48 ` Tolunay Orkun
2006-10-12 2:23 ` Tolunay Orkun
2006-10-12 11:58 ` Jerry Van Baren
2006-10-12 13:11 ` Wolfgang Denk
2006-10-12 17:55 ` Ben Warren
2006-10-12 23:19 ` bilahari
[not found] <20061005210314.40270.qmail@web33206.mail.mud.yahoo.com>
2006-10-05 21:50 ` Ben Warren
2006-10-05 22:59 ` Wolfgang Denk
2006-10-03 17:58 bilahari akkiraju
2006-10-05 14:27 ` Ben Warren
2006-10-05 14:42 ` Wolfgang Denk
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=45264A79.1090600@smiths-aerospace.com \
--to=gerald.vanbaren@smiths-aerospace.com \
--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