summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2018-09-17 13:18:19 +0300
committerAbel Vesa <abel.vesa@nxp.com>2018-09-18 09:47:48 +0300
commitc70afc348ee9fae242f00be56cde556822f93156 (patch)
treecb716b1b189590cc734c0b1de46c9518820d84c1 /common
parentab8d565f8a57474773d1a86dfa9690dc72d0104d (diff)
MLK-19219-4 iMX8QXP/QM: Add support to get container image set size from QSPI
This transforms almost all related functions from mmc specific to device independent. This allows the container size to be computed from QSPI and other future devices that will be supported for boot. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'common')
-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);