[U-Boot-Users] Bug in StrataFlash drivers

llandre r&d2 at dave-tech.it
Thu Nov 10 15:18:44 CET 2005


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




More information about the U-Boot mailing list