[CFT] FIX CFI cmdset 0002 for x16 and x32 devices.

Ben Dooks ben-mtd at fluff.org
Tue Sep 28 08:15:07 EDT 2004


On Thu, Sep 23, 2004 at 10:29:03PM -0600, Eric W. Biederman wrote:
> ebiederman at lnxi.com (Eric W. Biederman) writes:
> 
> > So it looks like the TODO item is to just look up what cfi standard
> > says are the unlock addresses for cfi command set 2. And make certain
> > the cfi hard codes are correct and nothing should be broken.
> 
> Looking at cfi specification and the AMD/Fujitsu specific
> portion of it.  This is what the CFI address assignment code
> needs to look like:
> 
> 		/* Set the default CFI lock/unlock addresses */
> 		cfi->addr_unlock1 = 0x555;
> 		cfi->addr_unlock2 = 0x2aa;
> 		/* Modify the unlock address if we are in compatibility mode */
> 		if (	/* x16 in x8 mode */
> 			((cfi->device_type == CFI_DEVICETYPE_X8) && 
> 				(cfi->cfiq->InterfaceDesc == 2)) ||
> 			/* x32 in x16 mode */
> 			((cfi->device_type == CFI_DEVICETYPE_X16) &&
> 				(cfi->cfiq->InterfaceDesc == 4))) 
> 		{
> 			cfi->addr_unlock1 = 0xaaa;
> 			cfi->addr_unlock2 = 0x555;
> 		}
> 
> 
> The previous code to handle this was quite bogus.  Unless I completely
> cannot read the code.
> 
> I have committed this change and corresponding change to use
> cfi_send_gen_cmd.
> 
> Will people please test this?

I've just had a chance to test this on my EB2410ITX (BAST) and it
seems to work (erased and then zeroed the spare partition). I'll
try and bootloader upgraded with it later.


-- 
Ben (ben at fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'




More information about the linux-mtd mailing list