/* Read from NOR and write into SDRAM See errata 2.8.7.  */
int nor_sdram_bufcopy(ulong dst, ulong src, ulong size)
/* Read from NOR and write into SDRAM See errata 2.8.7.  */
int nor_sdram_bufcopy(ulong dst, ulong src, ulong size)
{
	int ret = 0;
	ulong copysize = 0;
	while(size) {
		copysize = min(size, SOC_RAM_BUFFER_SIZE);
		if ((ret = nor_sdram_bufcopy_onebuf(dst, src, copysize)) <= 0)
			goto done;
		dst += min(size, SOC_RAM_BUFFER_SIZE);
		src += min(size, SOC_RAM_BUFFER_SIZE);
		size -= min(size, SOC_RAM_BUFFER_SIZE);
	}
done:
	return ret;
}