2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2011-09-14 19:33:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011
|
|
|
|
* Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
|
|
|
|
*/
|
|
|
|
#include <common.h>
|
2012-08-14 21:33:02 +00:00
|
|
|
#include <config.h>
|
2020-05-10 17:40:01 +00:00
|
|
|
#include <fdt_support.h>
|
|
|
|
#include <image.h>
|
arm: imx: Check header before calling spl_load_imx_container
Make sure we have an IMX header before calling spl_load_imx_container,
since if we don't it will fail with -ENOENT. This allows us to fall back to
legacy/raw images if they are also enabled.
This is a functional change, one which likely should have been in place
from the start, but a functional change nonetheless. Previously, all
non-IMX8 images (except FITs without FIT_FULL) would be optimized out if
the only image load method enabled supported IMX8 images. With this change,
support for other image types now has an effect.
There are seven boards with SPL_LOAD_IMX_CONTAINER enabled: three with
SPL_BOOTROM_SUPPORT:
imx93_11x11_evk_ld imx93_11x11_evk imx8ulp_evk
and four with SPL_MMC:
deneb imx8qxp_mek giedi imx8qm_mek
All of these boards also have SPL_RAW_IMAGE_SUPPORT and
SPL_LEGACY_IMAGE_FORMAT enabled as well. However, none have FIT support
enabled. Of the six load methods affected by this patch, only SPL_MMC and
SPL_BOOTROM_SUPPORT are enabled with SPL_LOAD_IMX_CONTAINER.
spl_romapi_load_image_seekable does not support legacy or raw images, so
there is no growth. However, mmc_load_image_raw_sector does support loading
legacy/raw images. Since these images could not have been booted before, I
have disabled support for legacy/raw images on these four boards. This
reduces bloat from around 800 bytes to around 200.
There are no in-tree boards with SPL_LOAD_IMX_CONTAINER and AHAB_BOOT both
enabled, so we do not need to worry about potentially falling back to
legacy images in a secure boot scenario.
Future work could include merging imx_container.h with imx8image.h, since
they appear to define mostly the same structures.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-14 20:47:44 +00:00
|
|
|
#include <imx_container.h>
|
2020-05-10 17:40:05 +00:00
|
|
|
#include <log.h>
|
2012-08-13 19:03:19 +00:00
|
|
|
#include <spl.h>
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
#include <spl_load.h>
|
2012-03-15 04:01:36 +00:00
|
|
|
#include <asm/io.h>
|
2023-11-04 20:37:46 +00:00
|
|
|
#include <mapmem.h>
|
2011-09-14 19:33:34 +00:00
|
|
|
#include <nand.h>
|
2018-03-04 16:20:11 +00:00
|
|
|
#include <linux/libfdt_env.h>
|
2016-05-24 05:04:42 +00:00
|
|
|
#include <fdt.h>
|
2011-09-14 19:33:34 +00:00
|
|
|
|
2019-09-23 02:18:43 +00:00
|
|
|
uint32_t __weak spl_nand_get_uboot_raw_page(void)
|
|
|
|
{
|
|
|
|
return CONFIG_SYS_NAND_U_BOOT_OFFS;
|
|
|
|
}
|
|
|
|
|
2014-10-31 07:31:00 +00:00
|
|
|
#if defined(CONFIG_SPL_NAND_RAW_ONLY)
|
2018-07-04 13:53:37 +00:00
|
|
|
static int spl_nand_load_image(struct spl_image_info *spl_image,
|
2016-09-25 00:20:13 +00:00
|
|
|
struct spl_boot_device *bootdev)
|
2014-10-31 07:31:00 +00:00
|
|
|
{
|
|
|
|
nand_init();
|
|
|
|
|
2019-03-26 12:04:00 +00:00
|
|
|
printf("Loading U-Boot from 0x%08x (size 0x%08x) to 0x%08x\n",
|
2022-11-12 22:36:51 +00:00
|
|
|
CONFIG_SYS_NAND_U_BOOT_OFFS, CFG_SYS_NAND_U_BOOT_SIZE,
|
|
|
|
CFG_SYS_NAND_U_BOOT_DST);
|
2019-03-26 12:04:00 +00:00
|
|
|
|
2019-09-23 02:18:43 +00:00
|
|
|
nand_spl_load_image(spl_nand_get_uboot_raw_page(),
|
2022-11-12 22:36:51 +00:00
|
|
|
CFG_SYS_NAND_U_BOOT_SIZE,
|
2023-11-04 20:37:46 +00:00
|
|
|
map_sysmem(CFG_SYS_NAND_U_BOOT_DST,
|
|
|
|
CFG_SYS_NAND_U_BOOT_SIZE));
|
2016-09-25 00:20:13 +00:00
|
|
|
spl_set_header_raw_uboot(spl_image);
|
2014-10-31 07:31:00 +00:00
|
|
|
nand_deselect();
|
2015-11-08 15:11:49 +00:00
|
|
|
|
|
|
|
return 0;
|
2014-10-31 07:31:00 +00:00
|
|
|
}
|
|
|
|
#else
|
2016-05-24 05:04:42 +00:00
|
|
|
|
2023-11-08 16:48:44 +00:00
|
|
|
__weak u32 nand_spl_adjust_offset(u32 sector, u32 offs)
|
2016-05-24 05:04:42 +00:00
|
|
|
{
|
2023-11-08 16:48:44 +00:00
|
|
|
return offs;
|
2021-03-01 22:33:28 +00:00
|
|
|
}
|
|
|
|
|
2023-11-08 16:48:44 +00:00
|
|
|
static ulong spl_nand_read(struct spl_load_info *load, ulong offs, ulong size,
|
|
|
|
void *dst)
|
2022-05-20 03:24:04 +00:00
|
|
|
{
|
|
|
|
int err;
|
2023-11-08 16:48:44 +00:00
|
|
|
ulong sector;
|
2022-05-20 03:24:04 +00:00
|
|
|
|
|
|
|
debug("%s: offs %lx, size %lx, dst %p\n",
|
|
|
|
__func__, offs, size, dst);
|
|
|
|
|
2023-11-08 16:48:44 +00:00
|
|
|
sector = *(int *)load->priv;
|
|
|
|
offs = sector + nand_spl_adjust_offset(sector, offs - sector);
|
2022-05-20 03:24:04 +00:00
|
|
|
err = nand_spl_load_image(offs, size, dst);
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
spl_set_bl_len(load, nand_page_size());
|
2022-05-20 03:24:04 +00:00
|
|
|
if (err)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
2016-09-25 00:20:13 +00:00
|
|
|
static int spl_nand_load_element(struct spl_image_info *spl_image,
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
struct spl_boot_device *bootdev, int offset)
|
2015-11-08 15:11:42 +00:00
|
|
|
{
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
struct spl_load_info load;
|
2015-11-08 15:11:42 +00:00
|
|
|
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
load.priv = &offset;
|
|
|
|
spl_set_bl_len(&load, 1);
|
|
|
|
load.read = spl_nand_read;
|
|
|
|
return spl_load(spl_image, bootdev, &load, 0, offset);
|
2015-11-08 15:11:42 +00:00
|
|
|
}
|
|
|
|
|
2016-09-25 00:20:13 +00:00
|
|
|
static int spl_nand_load_image(struct spl_image_info *spl_image,
|
|
|
|
struct spl_boot_device *bootdev)
|
2011-09-14 19:33:34 +00:00
|
|
|
{
|
2015-11-08 15:11:49 +00:00
|
|
|
int err;
|
2012-03-15 04:01:36 +00:00
|
|
|
|
2016-03-25 12:13:17 +00:00
|
|
|
#ifdef CONFIG_SPL_NAND_SOFTECC
|
|
|
|
debug("spl: nand - using sw ecc\n");
|
|
|
|
#else
|
2012-08-13 21:11:06 +00:00
|
|
|
debug("spl: nand - using hw ecc\n");
|
2016-03-25 12:13:17 +00:00
|
|
|
#endif
|
2012-08-13 21:11:06 +00:00
|
|
|
nand_init();
|
2011-09-14 19:33:34 +00:00
|
|
|
|
2021-10-31 03:03:48 +00:00
|
|
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
2012-03-15 04:01:38 +00:00
|
|
|
if (!spl_start_uboot()) {
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
int *src, *dst;
|
|
|
|
struct legacy_img_hdr *header =
|
|
|
|
spl_get_load_buffer(0, sizeof(*header));
|
|
|
|
|
2012-03-15 04:01:36 +00:00
|
|
|
/*
|
|
|
|
* load parameter image
|
|
|
|
* load to temp position since nand_spl_load_image reads
|
|
|
|
* a whole block which is typically larger than
|
2012-03-31 07:47:17 +00:00
|
|
|
* CONFIG_CMD_SPL_WRITE_SIZE therefore may overwrite
|
2012-03-15 04:01:36 +00:00
|
|
|
* following sections like BSS
|
|
|
|
*/
|
|
|
|
nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
|
|
|
|
CONFIG_CMD_SPL_WRITE_SIZE,
|
2022-10-21 00:22:39 +00:00
|
|
|
(void *)CONFIG_TEXT_BASE);
|
2012-03-15 04:01:36 +00:00
|
|
|
/* copy to destintion */
|
2023-09-26 14:14:17 +00:00
|
|
|
for (dst = (int *)CONFIG_SPL_PAYLOAD_ARGS_ADDR,
|
|
|
|
src = (int *)CONFIG_TEXT_BASE;
|
|
|
|
src < (int *)(CONFIG_TEXT_BASE +
|
|
|
|
CONFIG_CMD_SPL_WRITE_SIZE);
|
|
|
|
src++, dst++) {
|
2012-03-15 04:01:36 +00:00
|
|
|
writel(readl(src), dst);
|
|
|
|
}
|
2011-09-14 19:33:34 +00:00
|
|
|
|
2012-03-15 04:01:36 +00:00
|
|
|
/* load linux */
|
|
|
|
nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
|
2014-07-10 11:43:16 +00:00
|
|
|
sizeof(*header), (void *)header);
|
2022-01-14 13:31:38 +00:00
|
|
|
err = spl_parse_image_header(spl_image, bootdev, header);
|
2016-04-28 22:44:54 +00:00
|
|
|
if (err)
|
|
|
|
return err;
|
2012-03-15 04:01:38 +00:00
|
|
|
if (header->ih_os == IH_OS_LINUX) {
|
|
|
|
/* happy - was a linux */
|
2015-11-08 15:11:49 +00:00
|
|
|
err = nand_spl_load_image(
|
|
|
|
CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
|
2016-09-25 00:20:13 +00:00
|
|
|
spl_image->size,
|
|
|
|
(void *)spl_image->load_addr);
|
2012-03-15 04:01:38 +00:00
|
|
|
nand_deselect();
|
2015-11-08 15:11:49 +00:00
|
|
|
return err;
|
2012-03-15 04:01:38 +00:00
|
|
|
} else {
|
2012-08-14 21:33:02 +00:00
|
|
|
puts("The Expected Linux image was not "
|
|
|
|
"found. Please check your NAND "
|
2012-03-15 04:01:38 +00:00
|
|
|
"configuration.\n");
|
2012-08-14 21:33:02 +00:00
|
|
|
puts("Trying to start u-boot now...\n");
|
2012-03-15 04:01:38 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-15 04:01:36 +00:00
|
|
|
#endif
|
2011-09-14 19:33:34 +00:00
|
|
|
#ifdef CONFIG_NAND_ENV_DST
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
spl_nand_load_element(spl_image, bootdev, CONFIG_ENV_OFFSET);
|
2011-09-14 19:33:34 +00:00
|
|
|
#ifdef CONFIG_ENV_OFFSET_REDUND
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
spl_nand_load_element(spl_image, bootdev, CONFIG_ENV_OFFSET_REDUND);
|
2011-09-14 19:33:34 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2012-03-15 04:01:38 +00:00
|
|
|
/* Load u-boot */
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
err = spl_nand_load_element(spl_image, bootdev, spl_nand_get_uboot_raw_page());
|
2016-06-06 08:16:58 +00:00
|
|
|
#ifdef CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND
|
|
|
|
#if CONFIG_SYS_NAND_U_BOOT_OFFS != CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND
|
|
|
|
if (err)
|
2022-01-14 13:31:38 +00:00
|
|
|
err = spl_nand_load_element(spl_image, bootdev,
|
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-08 16:48:51 +00:00
|
|
|
CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND);
|
2016-06-06 08:16:58 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2011-09-14 19:33:34 +00:00
|
|
|
nand_deselect();
|
2015-11-08 15:11:49 +00:00
|
|
|
return err;
|
2011-09-14 19:33:34 +00:00
|
|
|
}
|
2014-10-31 07:31:00 +00:00
|
|
|
#endif
|
2016-09-25 00:20:02 +00:00
|
|
|
/* Use priorty 1 so that Ubi can override this */
|
2016-11-30 22:30:50 +00:00
|
|
|
SPL_LOAD_IMAGE_METHOD("NAND", 1, BOOT_DEVICE_NAND, spl_nand_load_image);
|