#include <dm/uclass-internal.h>
#include <spi_flash.h>
+#include <asm/io.h>
#include <asm/arch/sys_proto.h>
#include "common.h"
return (void *)(addr + CONFIG_K3_SYSFW_IMAGE_SPI_OFFS);
}
+
+static void k3_sysfw_spi_copy(u32 *dst, u32 *src, size_t len)
+{
+ size_t i;
+
+ for (i = 0; i < len / sizeof(*dst); i++)
+ *dst++ = *src++;
+}
#endif
void k3_sysfw_loader(bool rom_loaded_sysfw,
struct spl_image_info spl_image = { 0 };
struct spl_boot_device bootdev = { 0 };
struct ti_sci_handle *ti_sci;
+#if CONFIG_IS_ENABLED(SPI_LOAD)
+ void *sysfw_spi_base;
+#endif
int ret = 0;
if (rom_loaded_sysfw) {
#endif
#if CONFIG_IS_ENABLED(SPI_LOAD)
case BOOT_DEVICE_SPI:
- sysfw_load_address = k3_sysfw_get_spi_addr();
- if (!sysfw_load_address)
+ sysfw_spi_base = k3_sysfw_get_spi_addr();
+ if (!sysfw_spi_base)
ret = -ENODEV;
+ k3_sysfw_spi_copy(sysfw_load_address, sysfw_spi_base,
+ CONFIG_K3_SYSFW_IMAGE_SIZE_MAX);
break;
#endif
#if CONFIG_IS_ENABLED(YMODEM_SUPPORT)