Skip to contentSkip to conversation

Bug in StrataFlash drivers

U-Boot-Users llandre 2 participants 3 messages Nov 10, 2005 – Nov 11, 2005

lore
Share & tools
lore

llandre

author
#0 lore raw

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
#1 lore raw
Quoted 5 lines · In message <[email protected]> you wrote:

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 ...

...

Quoted 1 line

... must be changed like this:

Do you have a spoecific test case that shows the presence of the bug?

And can you please provide a proper patch, with CHANGELOG entry, Signed-off-by line and everything?

Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Randal said it would be tough to do in sed. He didn't say  he  didn't
understand  sed.  Randal  understands sed quite well. Which is why he
uses Perl. :-)         - Larry Wall in <[email protected]>
author
#2 lore raw

Hi Wolfgang,

Quoted 1 line

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.

Quoted 2 lines

And can you please provide a proper patch, with CHANGELOG entry, Signed-off-by line and everything?

The file I fixed is not in your repository (this file would be added by the patch I sent you last month about Zefeer boards) and it is platform-specific. Do you want me to send you the patch anyway? Also I noted that similar fix is in the file board/g2000/strataflash.c around line 757 and this file is already in the public repository.

Best regards,
llandre

DAVE Electronics System House - R&D Department

web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it