Unlocking with Intel J3 series flash
Ralph Siemsen
ralphs at netwinder.org
Tue Jul 31 13:56:29 EDT 2007
On Tue, Jul 31, 2007 at 05:23:31PM +0100, Ben Dooks wrote:
> My solution, which I can post the patch for, is to check the lock
> status of the page before trying to unlock the device.
In principle this sounds like a good idea, but we then trust the
device to give us status... wherease prevously the unlock command
would be issued regardless. I wonder if there are any errata
regarding device status... probably... here is one:
http://download.intel.com/design/flcomp/applnots/30855503.pdf
although your code looks like it will deal correctly with this.
> + /* check to see if the block is actually in the right state */
> +
> + map_write(map, CMD(0x90), adr + (2 * ofs_factor));
> + chip->state = FL_JEDEC_QUERY;
Ok.
> + status = map_read(map, adr + (2 * ofs_factor));
Any reason you're not doing:
status = cfi_read_query(map, adr+(2*ofs_factor));
as is done in the do_printlockstatus_oneblock() function?
> + /* return the chip to a state */
> + map_write(map, CMD(0xf0), adr);
> + map_write(map, CMD(0xff), adr);
> +
> + chip->state = FL_READY;
That sequence worries me... I don't know enough about the state
machines in the MTD code to know if it safe to do this here...
The rest looks ok.
I do wonder if this should be done in cfi_cmdset_0001, or should
it happen more globally? Are there AMD chips with the same "feature"?
-R
More information about the linux-mtd
mailing list