public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Bug in StrataFlash drivers
@ 2005-11-10 14:18 llandre
  2005-11-10 16:44 ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: llandre @ 2005-11-10 14:18 UTC (permalink / raw)
  To: u-boot

Several platforms are equipped with StrataFlash memory. Most of the 
existing drivers seem to not handle correctly odd-sized buffers in 
writing. IIUC the bug is the function flash_write_cfibuffer - enabled 
when CFG_FLASH_USE_BUFFER_WRITE is defined - when working with 16-bit 
wide memories. The following code ...

		...
		case FLASH_CFI_8BIT:
			cnt = len;
			break;
		case FLASH_CFI_16BIT:
			cnt = len >> 1;
			break;
		case FLASH_CFI_32BIT:
		...

... must be changed like this:

		...
			break;
		case FLASH_CFI_16BIT:						
			cnt = len >> 1;
			if (len % 2)
				cnt += 1;
			break;
		case FLASH_CFI_32BIT:
		...


Best regards,
llandre

DAVE Electronics System House - R&D Department
web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <20051111093808.0F719352681@atlas.denx.de>]
* [U-Boot-Users] Bug in StrataFlash drivers
@ 2005-11-11 15:39 Menon, Nishanth
  2005-11-11 15:47 ` llandre
  0 siblings, 1 reply; 8+ messages in thread
From: Menon, Nishanth @ 2005-11-11 15:39 UTC (permalink / raw)
  To: u-boot

Greetings,
I can see it hit here too:
		case FLASH_CFI_32BIT:
 			cnt = len >> 2;
 			break;
 		default:
it is a div 4operation.. so last 3 bytes may go missin!!
Mebbe I am wrong abt it.. but then.. so it seems..
Regards,
Nishanth Menon
> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net [mailto:u-boot-users-
> admin at lists.sourceforge.net] On Behalf Of llandre
> Sent: Friday, November 11, 2005 4:27 AM
> To: Wolfgang Denk
> Cc: u-boot-users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] Bug in StrataFlash drivers
> 
> >>>Do you have a spoecific test case that shows the presence of the
bug?
> >>
> >>I experience the problem when trying to store in Flash my ramdisk
image
> >>that is 1502693 bytes.
> >
> >
> > This will probably also happen with smaller size?
> Yes, I think it will happen with any odd-sized files.
> 
> 
> >>>And can you please provide a  proper  patch,  with  CHANGELOG
entry,
> >>>Signed-off-by line and everything?
> See attached file.
> 
> ChangeLog:
> * Patch by Andrea Marson, 11 November 2005:
> Fixed odd-sized images writing in Zefeer StrataFlash driver.
> 
> 
> Signed-off-by: Andrea Marson <r&d2@dave-tech.it>
> 
> 
> 
> 
> Best regards,
> llandre
> 
> DAVE Electronics System House - R&D Department
> web:   http://www.dave-tech.it
> email: r&d2 at dave-tech.it

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-08-18  9:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-10 14:18 [U-Boot-Users] Bug in StrataFlash drivers llandre
2005-11-10 16:44 ` Wolfgang Denk
2005-11-11  9:29   ` llandre
     [not found] <20051111093808.0F719352681@atlas.denx.de>
2005-11-11 10:26 ` llandre
2006-08-18  9:40   ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-11-11 15:39 Menon, Nishanth
2005-11-11 15:47 ` llandre
2005-11-21 20:40   ` Detlev Zundel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox