return loader->load_image(&bootdev);
switch (boot_device) {
-#if defined(CONFIG_SPL_SPI_SUPPORT) || defined(CONFIG_SPL_SPI_FLASH_SUPPORT)
- case BOOT_DEVICE_SPI:
- return spl_spi_load_image(&bootdev);
-#endif
#ifdef CONFIG_SPL_ETH_SUPPORT
case BOOT_DEVICE_CPGMAC:
#ifdef CONFIG_SPL_ETH_DEVICE
* configured and available since this code loads the main U-Boot image
* from SPI into SDRAM and starts it from there.
*/
-int spl_spi_load_image(struct spl_boot_device *bootdev)
+static int spl_spi_load_image(struct spl_boot_device *bootdev)
{
int err = 0;
struct spi_flash *flash;
return err;
}
+/* Use priorty 1 so that boards can override this */
+SPL_LOAD_IMAGE_METHOD(1, BOOT_DEVICE_SPI, spl_spi_load_image);
/*****************************************************************************/
-int spl_spi_load_image(struct spl_boot_device *bootdev)
+static int spl_spi_load_image(struct spl_boot_device *bootdev)
{
int err;
struct image_header *header;
spi0_deinit();
return 0;
}
+/* Use priorty 0 to override the default if it happens to be linked in */
+SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_SPI, spl_spi_load_image);
.load_image = __method, \
}
-/* SPI SPL functions */
-int spl_spi_load_image(struct spl_boot_device *bootdev);
-
/* Ethernet SPL functions */
int spl_net_load_image(struct spl_boot_device *bootdev);