diff options
Diffstat (limited to 'drivers/mtd/spi/sunxi_spi_spl.c')
-rw-r--r-- | drivers/mtd/spi/sunxi_spi_spl.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mtd/spi/sunxi_spi_spl.c b/drivers/mtd/spi/sunxi_spi_spl.c index e3ded5b..67c7edd 100644 --- a/drivers/mtd/spi/sunxi_spi_spl.c +++ b/drivers/mtd/spi/sunxi_spi_spl.c @@ -262,7 +262,8 @@ static void spi0_read_data(void *buf, u32 addr, u32 len) /*****************************************************************************/ -int spl_spi_load_image(void) +static int spl_spi_load_image(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev) { int err; struct image_header *header; @@ -271,13 +272,15 @@ int spl_spi_load_image(void) spi0_init(); spi0_read_data((void *)header, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40); - err = spl_parse_image_header(header); + err = spl_parse_image_header(spl_image, header); if (err) return err; - spi0_read_data((void *)spl_image.load_addr, CONFIG_SYS_SPI_U_BOOT_OFFS, - spl_image.size); + spi0_read_data((void *)spl_image->load_addr, CONFIG_SYS_SPI_U_BOOT_OFFS, + spl_image->size); 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); |