* protection on cfi-flash
@ 2010-08-05 8:01 Frans Meulenbroeks
2010-08-24 9:56 ` Gernot Hoyler
0 siblings, 1 reply; 2+ messages in thread
From: Frans Meulenbroeks @ 2010-08-05 8:01 UTC (permalink / raw)
To: linux-mtd
Hi,
I have a board with Spansion nor flash, type S29GL01GP. This uses the
cfi-flash driver
In order to avoid accidential erasure of sectors, and hence wanted to
use flash_lock and flash_unlock.
However apparently the mtd driver for this chip does not support lock
and unlock.
U-boot does support protecting the flash (using the protect command)
so it is feasible.
The chip uses cfi_cmdset_0002.c to do its work.
I guess adding lock/unlock to this is technically not too difficult,
but I lack some info on the internals of mtd and how best to do this.
Anyone a suggestion (or maybe some code or a pointer to some code)?
Thanks alot, Frans
PS: I noticed that if I protect the flash in u-boot that flash_erase
will still report success when I invoke it (although of course the
actual data is not erased).
I would expect flash_erase to get some error code in that case and
report it back (or if that is not possible do a readback of the data
to see if the erase was successful).
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Re: protection on cfi-flash
2010-08-05 8:01 protection on cfi-flash Frans Meulenbroeks
@ 2010-08-24 9:56 ` Gernot Hoyler
0 siblings, 0 replies; 2+ messages in thread
From: Gernot Hoyler @ 2010-08-24 9:56 UTC (permalink / raw)
To: linux-mtd; +Cc: fransmeulenbroeks
> I would expect flash_erase to get some error code in that case and
> report it back (or if that is not possible do a readback of the data
> to see if the erase was successful).
Erasing or programing a locked sector does not immediately issue an
error on the S29GL01GP. The status you get from the device in this
case shows a couple of toggle bit cycles before it goes back to read
array mode.
It is the responsibility of higher layers to verify erase and/or program
operations. This verification step is done e.g. in flash file systems
but not in the MTD chip driver.
--Gernot
PS: Feel free to get in direct touch with me regarding adding locking
support to the AMD/Spansion chip driver. I can help you with this.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-24 9:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05 8:01 protection on cfi-flash Frans Meulenbroeks
2010-08-24 9:56 ` Gernot Hoyler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).