diff options
author | Tom Rini <trini@konsulko.com> | 2019-10-09 09:35:43 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-10-09 11:44:45 -0400 |
commit | eaa0bde05186b1738d221bc5effc6f257a14e360 (patch) | |
tree | 4e3c589df0fcd55fb38587ff708f6cd4a0d3863b /common/spl/spl_spi.c | |
parent | 8c05abad1367e33908ee43c590801e338967838d (diff) | |
parent | 9fb50c68daa696056c7842989e5f7fae1d326b34 (diff) |
Merge tag 'u-boot-imx-20191009' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20191009
-------------------
Travis : https://travis-ci.org/sbabic/u-boot-imx/builds/595148532
- MX6UL / ULZ
- Toradex board
- Allow to set OCRAM for MX6Q/D
- MX7ULP
- MX8: (container image, imx8mq_mek), SCU API
- fix several board booting from SD/EMMC (cubox-i for example)
- pico boards
[trini: display5 merged manually]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/spl/spl_spi.c')
-rw-r--r-- | common/spl/spl_spi.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 9b74473377f..288dbb5fa98 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -62,6 +62,12 @@ static ulong spl_spi_fit_read(struct spl_load_info *load, ulong sector, 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 @@ -71,7 +77,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 int payload_offs; struct spi_flash *flash; struct image_header *header; @@ -90,6 +96,8 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, 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) @@ -133,6 +141,17 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, err = spl_load_simple_fit(spl_image, &load, payload_offs, header); + } else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) { + struct spl_load_info load; + + load.dev = flash; + load.priv = NULL; + load.filename = NULL; + load.bl_len = 1; + load.read = spl_spi_fit_read; + + err = spl_load_imx_container(spl_image, &load, + payload_offs); } else { err = spl_parse_image_header(spl_image, header); if (err) |