u8 command[8];
/* Calculate buffer size and boundary mask */
- u32 buffersize = 1UL << cfi_info->max_buf_write_size;
+ u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width);
u32 buffermask = buffersize-1;
u32 bufferwsize;
return ERROR_FLASH_OPERATION_FAILED;
}
+ bufferwsize/=(bank->bus_width / bank->chip_width);
+
+
/* Check for valid size */
if (wordcount > bufferwsize)
{
cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext;
/* Calculate buffer size and boundary mask */
- u32 buffersize = 1UL << cfi_info->max_buf_write_size;
+ u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width);
u32 buffermask = buffersize-1;
u32 bufferwsize;
return ERROR_FLASH_OPERATION_FAILED;
}
+ bufferwsize/=(bank->bus_width / bank->chip_width);
+
/* Check for valid size */
if (wordcount > bufferwsize)
{
{
if (retval == ERROR_TARGET_RESOURCE_NOT_AVAILABLE)
{
- u32 buffersize = 1UL << cfi_info->max_buf_write_size;
+ //adjust buffersize for chip width
+ u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width);
u32 buffermask = buffersize-1;
u32 bufferwsize;
LOG_ERROR("Unsupported chip width %d", bank->chip_width);
return ERROR_FLASH_OPERATION_FAILED;
}
+
+ bufferwsize/=(bank->bus_width / bank->chip_width);
/* fall back to memory writes */
while (count >= bank->bus_width)