From: Tom Rini Date: Fri, 12 Jul 2019 14:31:04 -0400 Subject: [U-Boot] [PATCH 2/3] spl: ubi: Add support for loading simple fitImage In-Reply-To: <20190528014915.6202-2-marex@denx.de> References: <20190528014915.6202-1-marex@denx.de> <20190528014915.6202-2-marex@denx.de> Message-ID: <20190712183104.GA6311@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, May 28, 2019 at 03:49:14AM +0200, Marek Vasut wrote: > Add code to load simple fitImage from the kernel volume, the args > volume is unnecessary. > > Signed-off-by: Marek Vasut > Cc: Ladislav Michl > Cc: Tom Rini > --- > common/spl/spl_ubi.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > > diff --git a/common/spl/spl_ubi.c b/common/spl/spl_ubi.c > index 67e5fadd7c..6addd46ece 100644 > --- a/common/spl/spl_ubi.c > +++ b/common/spl/spl_ubi.c > @@ -11,6 +11,14 @@ > #include > #include > > +static ulong spl_ubi_load_read(struct spl_load_info *load, ulong sector, > + ulong count, void *buf) > +{ > + if (buf != (void *)CONFIG_SPL_LOAD_FIT_ADDRESS + sector) > + memcpy(buf, (void *)(CONFIG_SYS_LOAD_ADDR + sector), count); > + return count; > +} > + > int spl_ubi_load_image(struct spl_image_info *spl_image, > struct spl_boot_device *bootdev) > { > @@ -54,7 +62,19 @@ int spl_ubi_load_image(struct spl_image_info *spl_image, > ret = ubispl_load_volumes(&info, volumes, 2); > if (!ret) { > header = (struct image_header *)volumes[0].load_addr; > - spl_parse_image_header(spl_image, header); > + > + if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && > + image_get_magic(header) == FDT_MAGIC) { > + struct spl_load_info load; > + > + debug("Found FIT\n"); > + load.bl_len = 1; > + load.read = spl_ubi_load_read; > + spl_load_simple_fit(spl_image, &load, 0, header); > + } else { > + spl_parse_image_header(spl_image, header); > + } > + > puts("Linux loaded.\n"); > goto out; > } This breaks building on igep00x0 and am335x_igep003x, sorry. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: