summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-01-01 09:56:41 -0500
committerTom Rini <trini@konsulko.com>2019-01-01 10:01:00 -0500
commit522e035441ca04d99de2fc13b614ad896691e9c9 (patch)
tree875c0923d24447550db43f6f1b767dea82dccb06 /common
parent08337cd64832ed7f8147da75013510b92bbcd188 (diff)
parent57d2beb91d705bccdfee5e9e5fd267f5e363a100 (diff)
downloadu-boot-522e035441ca04d99de2fc13b614ad896691e9c9.tar.gz
u-boot-522e035441ca04d99de2fc13b614ad896691e9c9.tar.bz2
u-boot-522e035441ca04d99de2fc13b614ad896691e9c9.zip
Merge tag 'u-boot-imx-20190101' of git://www.denx.de/git/u-boot-imx
imx for 2019.01 - introduce support for i.MX8M - fix size limit for Vhybrid / pico boards - several board fixes - w1 driver for MX2x / MX5x
Diffstat (limited to 'common')
-rw-r--r--common/image.c1
-rw-r--r--common/spl/Kconfig1
-rw-r--r--common/spl/spl_fit.c21
3 files changed, 21 insertions, 2 deletions
diff --git a/common/image.c b/common/image.c
index 0659133fcc..4d4248f234 100644
--- a/common/image.c
+++ b/common/image.c
@@ -140,6 +140,7 @@ static const table_entry_t uimage_type[] = {
{ IH_TYPE_KWBIMAGE, "kwbimage", "Kirkwood Boot Image",},
{ IH_TYPE_IMXIMAGE, "imximage", "Freescale i.MX Boot Image",},
{ IH_TYPE_IMX8IMAGE, "imx8image", "NXP i.MX8 Boot Image",},
+ { IH_TYPE_IMX8MIMAGE, "imx8mimage", "NXP i.MX8M Boot Image",},
{ IH_TYPE_INVALID, "invalid", "Invalid Image", },
{ IH_TYPE_MULTI, "multi", "Multi-File Image", },
{ IH_TYPE_OMAPIMAGE, "omapimage", "TI OMAP SPL With GP CH",},
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 953841ebe7..35472f4a92 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -286,6 +286,7 @@ config SPL_FIT_IMAGE_TINY
bool "Remove functionality from SPL FIT loading to reduce size"
depends on SPL_FIT
default y if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN50I_H6
+ default y if ARCH_IMX8M
help
Enable this to reduce the size of the FIT image loading code
in SPL, if space for the SPL binary is very tight.
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index faf4ddbd1f..db436268cb 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -15,6 +15,15 @@
#define CONFIG_SYS_BOOTM_LEN (64 << 20)
#endif
+__weak void board_spl_fit_post_load(ulong load_addr, size_t length)
+{
+}
+
+__weak ulong board_spl_fit_size_align(ulong size)
+{
+ return size;
+}
+
/**
* spl_fit_get_image_name(): By using the matching configuration subnode,
* retrieve the name of an image, specified by a property name and an index
@@ -350,6 +359,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
*/
size = fdt_totalsize(fit);
size = (size + 3) & ~3;
+ size = board_spl_fit_size_align(size);
base_offset = (size + 3) & ~3;
/*
@@ -373,8 +383,9 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
fit = spl_get_load_buffer(-hsize, hsize);
sectors = get_aligned_image_size(info, size, 0);
count = info->read(info, sector, sectors, fit);
- debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu\n",
- sector, sectors, fit, count);
+ debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu, size=0x%lx\n",
+ sector, sectors, fit, count, size);
+
if (count == 0)
return -EIO;
@@ -510,5 +521,11 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
if (spl_image->entry_point == FDT_ERROR || spl_image->entry_point == 0)
spl_image->entry_point = spl_image->load_addr;
+ spl_image->flags |= SPL_FIT_FOUND;
+
+#ifdef CONFIG_SECURE_BOOT
+ board_spl_fit_post_load((ulong)fit, size);
+#endif
+
return 0;
}