summaryrefslogtreecommitdiff
path: root/common/spl/spl_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_spi.c')
-rw-r--r--common/spl/spl_spi.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index 42880d56b9..c26896ed65 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -51,6 +51,13 @@ static int spi_load_image_os(struct spl_image_info *spl_image,
}
#endif
+#ifdef CONFIG_SYS_SPI_U_BOOT_OFFS
+unsigned long __weak spl_spi_get_uboot_raw_sector(struct spi_flash *flash)
+{
+ return CONFIG_SYS_SPI_U_BOOT_OFFS;
+}
+#endif
+
static ulong spl_spi_fit_read(struct spl_load_info *load, ulong sector,
ulong count, void *buf)
{
@@ -72,7 +79,7 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
int err = 0;
- unsigned payload_offs = CONFIG_SYS_SPI_U_BOOT_OFFS;
+ unsigned payload_offs = 0;
struct spi_flash *flash;
struct image_header *header;
@@ -89,6 +96,8 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
return -ENODEV;
}
+ payload_offs = spl_spi_get_uboot_raw_sector(flash);
+
/* use CONFIG_SYS_TEXT_BASE as temporary storage area */
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);