Introduce a weak function spl_spi_get_uboot_offs, then
platform could have their own implementation.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michal Simek <michal.simek@xilinx.com>
else
return 0;
}
+
+unsigned int __weak spl_spi_get_uboot_offs(struct spi_flash *flash)
+{
+ return CONFIG_SYS_SPI_U_BOOT_OFFS;
+}
+
/*
* The main entry for SPI booting. It's necessary that SDRAM is already
* configured and available since this code loads the main U-Boot image
struct spl_boot_device *bootdev)
{
int err = 0;
- unsigned payload_offs = CONFIG_SYS_SPI_U_BOOT_OFFS;
+ unsigned int payload_offs;
struct spi_flash *flash;
struct image_header *header;
return -ENODEV;
}
+ payload_offs = spl_spi_get_uboot_offs(flash);
+
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)