static int spl_nor_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
- __maybe_unused const struct legacy_img_hdr *header;
+ struct legacy_img_hdr *header;
__maybe_unused struct spl_load_info load;
/*
* Load Linux from its location in NOR flash to its defined
* location in SDRAM
*/
- header = (const struct legacy_img_hdr *)CONFIG_SYS_OS_BASE;
+ header = (void *)CONFIG_SYS_OS_BASE;
#ifdef CONFIG_SPL_LOAD_FIT
if (image_get_magic(header) == FDT_MAGIC) {
int ret;
* Load real U-Boot from its location in NOR flash to its
* defined location in SDRAM
*/
-#ifdef CONFIG_SPL_LOAD_FIT
header = (const struct legacy_img_hdr *)spl_nor_get_uboot_base();
+#ifdef CONFIG_SPL_LOAD_FIT
if (image_get_magic(header) == FDT_MAGIC) {
debug("Found FIT format U-Boot\n");
load.bl_len = 1;
/* Legacy image handling */
if (IS_ENABLED(CONFIG_SPL_LEGACY_IMAGE_FORMAT)) {
- struct legacy_img_hdr hdr;
-
load.bl_len = 1;
load.read = spl_nor_load_read;
- spl_nor_load_read(&load, spl_nor_get_uboot_base(), sizeof(hdr), &hdr);
return spl_load_legacy_img(spl_image, bootdev, &load,
spl_nor_get_uboot_base(),
- &hdr);
+ header);
}
return -EINVAL;