/*-----------------------------------------------------------------------
* This function assumes that flash_addr is aligned on 512 bytes boundary
- * in flash. This function also assumes that prepare have been called
+ * in flash. This function also assumes that prepare have been called
* for the sector in question.
*/
int copy_buffer_to_flash(flash_info_t * info, ulong flash_addr)
for (j = 0; j < 7; j++, k++) {
flash_info[0].start[k] = flashbase;
flashbase += 0x00002000;
- }
+ }
size += flash_info[0].size;
flash_info[1].flash_id = (SST_MANUFACT & FLASH_VENDMASK);
flash_protect (FLAG_PROTECT_SET,
CFG_ENV_ADDR,
- CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
+ CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
&flash_info[0]);
return size;
{
switch (info->flash_id & FLASH_VENDMASK) {
case (SST_MANUFACT & FLASH_VENDMASK):
- return flash_erase_sst(info, s_first, s_last);
+ return flash_erase_sst(info, s_first, s_last);
case (PHILIPS_LPC2292 & FLASH_VENDMASK):
- return flash_erase_philips(info, s_first, s_last);
+ return flash_erase_philips(info, s_first, s_last);
default:
return ERR_PROTECTED;
}
src_org++;
}
-
return ret;
}
-int write_buff_philips (flash_info_t * info,
- uchar * src,
- ulong addr,
+int write_buff_philips (flash_info_t * info,
+ uchar * src,
+ ulong addr,
ulong cnt)
{
int first_copy_size;
#endif
/* copy first block */
- memcpy((void*)COPY_BUFFER_LOCATION,
+ memcpy((void*)COPY_BUFFER_LOCATION,
(void*)(first_block * 512), 512);
- memcpy((void*)(COPY_BUFFER_LOCATION + 512 - first_copy_size),
+ memcpy((void*)(COPY_BUFFER_LOCATION + 512 - first_copy_size),
src, first_copy_size);
copy_buffer_to_flash(info, first_block * 512);
src += first_copy_size;
memcpy((void*)COPY_BUFFER_LOCATION, src, 512);
copy_buffer_to_flash(info, addr);
src += 512;
- addr += 512;
+ addr += 512;
}
(ulong)addr);
#endif
/* copy last block */
- memcpy((void*)COPY_BUFFER_LOCATION,
+ memcpy((void*)COPY_BUFFER_LOCATION,
(void*)(last_block * 512), 512);
- memcpy((void*)COPY_BUFFER_LOCATION,
+ memcpy((void*)COPY_BUFFER_LOCATION,
src, last_copy_size);
copy_buffer_to_flash(info, addr);
}
{
switch (info->flash_id & FLASH_VENDMASK) {
case (SST_MANUFACT & FLASH_VENDMASK):
- return write_buff_sst(info, src, addr, cnt);
+ return write_buff_sst(info, src, addr, cnt);
case (PHILIPS_LPC2292 & FLASH_VENDMASK):
- return write_buff_philips(info, src, addr, cnt);
+ return write_buff_philips(info, src, addr, cnt);
default:
return ERR_PROG_ERROR;
}