From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 03/11] SPL: FIT: factor out spl_load_fit_image()
Date: Mon, 23 Jan 2017 07:58:05 -0500 [thread overview]
Message-ID: <20170123125805.GG10853@bill-the-cat> (raw)
In-Reply-To: <dc4e11be-e09e-d4d4-e7ad-a2deb9d817d4@ti.com>
On Mon, Jan 23, 2017 at 02:23:40PM +0530, Lokesh Vutla wrote:
>
>
> On Friday 20 January 2017 07:23 AM, Andre Przywara wrote:
> > At the moment we load two images from a FIT image: the actual U-Boot
> > image and the DTB. Both times we have very similar code to deal with
> > alignment requirement the media we load from imposes upon us.
> > Factor out this code into a new function, which we just call twice.
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> > common/spl/spl_fit.c | 122 +++++++++++++++++++++------------------------------
> > 1 file changed, 51 insertions(+), 71 deletions(-)
> >
> > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> > index 381ed1f..d4149c5 100644
> > --- a/common/spl/spl_fit.c
> > +++ b/common/spl/spl_fit.c
> > @@ -138,19 +138,58 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size,
> > return (data_size + info->bl_len - 1) / info->bl_len;
> > }
> >
> > +static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
> > + void *fit, ulong base_offset, int node,
> > + struct spl_image_info *image_info)
> > +{
> > + ulong offset;
> > + size_t length;
> > + ulong load, entry;
> > + void *src;
> > + ulong overhead;
> > + int nr_sectors;
> > +
> > + offset = fdt_getprop_u32(fit, node, "data-offset") + base_offset;
> > + length = fdt_getprop_u32(fit, node, "data-size");
> > + load = fdt_getprop_u32(fit, node, "load");
> > + if (load == -1U && image_info)
> > + load = image_info->load_addr;
>
> What if load_addr is not aligned with ARCH_DMA_MINALIGN like in case of
> DT loading (u-boot's load_addr + size cannot be always aligned with
> DMA). I keep getting this error when loading DT: "FAT: Misaligned buffer
> address (808675a0)."
My immediate concern here is that we've found another way we're going to
run into the same old problems of 'large kernel BSS stomps on DT (or
initrd) on ARM32 (arm64 won't because the Image format includes end of
BSS as a field). If your FDT isn't at base+128MiB (and you have >
128MiB DDR), something is wrong :)
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170123/2a129fbf/attachment.sig>
next prev parent reply other threads:[~2017-01-23 12:58 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 1:53 [U-Boot] [RFC PATCH 00/11] extend FIT loading support (plus Pine64/ATF support) Andre Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 01/11] SPL: FIT: refactor FDT loading Andre Przywara
2017-01-23 8:56 ` Lokesh Vutla
2017-01-27 21:29 ` Simon Glass
2017-01-28 0:38 ` André Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 02/11] SPL: FIT: rework U-Boot image loading Andre Przywara
2017-01-23 8:56 ` Lokesh Vutla
2017-01-27 21:29 ` Simon Glass
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 03/11] SPL: FIT: factor out spl_load_fit_image() Andre Przywara
2017-01-22 7:16 ` Kever Yang
2017-01-22 10:42 ` André Przywara
2017-01-23 2:37 ` Kever Yang
2017-01-23 8:53 ` Lokesh Vutla
2017-01-23 12:58 ` Tom Rini [this message]
2017-01-23 13:31 ` Lokesh Vutla
2017-01-23 13:50 ` Tom Rini
2017-01-23 23:07 ` André Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 04/11] SPL: FIT: allow loading multiple images Andre Przywara
2017-01-22 7:08 ` Kever Yang
2017-01-22 10:58 ` André Przywara
2017-01-23 2:49 ` Kever Yang
2017-01-23 12:47 ` Michal Simek
2017-01-23 23:52 ` André Przywara
2017-01-23 8:57 ` Lokesh Vutla
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 05/11] tools: mksunxiboot: allow larger SPL binaries Andre Przywara
2017-01-21 4:24 ` Siarhei Siamashka
2017-01-21 11:17 ` André Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 06/11] sunxi: A64: SPL: allow large SPL binary Andre Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 07/11] sunxi: A64: move SPL stack to end of SRAM A2 Andre Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 08/11] sunxi: SPL: add FIT config selector for Pine64 boards Andre Przywara
2017-01-20 21:35 ` Maxime Ripard
2017-01-20 21:55 ` André Przywara
2017-01-21 2:16 ` [U-Boot] [linux-sunxi] " Icenowy Zheng
2017-01-21 2:16 ` Icenowy Zheng
2017-01-21 4:05 ` [U-Boot] " Siarhei Siamashka
2017-01-21 15:15 ` André Przywara
2017-01-23 17:29 ` Maxime Ripard
2017-01-23 22:55 ` André Przywara
2017-01-26 10:55 ` Maxime Ripard
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 09/11] sunxi: Pine64: defconfig: enable SPL FIT support Andre Przywara
2017-01-20 21:36 ` Maxime Ripard
2017-01-20 21:55 ` André Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 10/11] sunxi: Pine64: add FIT image source Andre Przywara
2017-01-20 1:53 ` [U-Boot] [RFC PATCH 11/11] SPL: SPI: sunxi: add SPL FIT image support Andre Przywara
2017-01-20 21:37 ` Maxime Ripard
2017-01-20 21:58 ` André Przywara
2017-01-20 17:02 ` [U-Boot] [RFC PATCH 00/11] extend FIT loading support (plus Pine64/ATF support) Andrew F. Davis
2017-01-20 17:17 ` Andre Przywara
2017-01-20 17:35 ` Andrew F. Davis
2017-01-20 17:48 ` Andre Przywara
2017-01-20 19:07 ` [U-Boot] [linux-sunxi] " Icenowy Zheng
2017-01-20 22:21 ` [U-Boot] " André Przywara
2017-01-27 21:29 ` Simon Glass
2017-01-28 1:47 ` André Przywara
2017-02-06 15:33 ` Simon Glass
2017-02-06 16:09 ` Andre Przywara
2017-02-06 16:17 ` Andrew F. Davis
2017-02-06 16:32 ` Andre Przywara
2017-02-06 16:37 ` Andrew F. Davis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170123125805.GG10853@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox