From: Andreas Dannenberg <dannenberg@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/9] spl: fit: add support for post-processing of images
Date: Thu, 23 Jun 2016 10:00:44 -0500 [thread overview]
Message-ID: <20160623150044.GW26355@borg.dal.design.ti.com> (raw)
In-Reply-To: <CAPnjgZ087xLL+F31vGa80e=29CZ-dx+wefUXnP+=7-ogVJG+=A@mail.gmail.com>
On Thu, Jun 23, 2016 at 08:45:54AM -0600, Simon Glass wrote:
> Hi Andreas,
>
> On 23 June 2016 at 08:19, Andreas Dannenberg <dannenberg@ti.com> wrote:
> > On Thu, Jun 23, 2016 at 07:57:13AM -0600, Simon Glass wrote:
> >> Hi Andreas,
> >>
> >> On 20 June 2016 at 21:34, Andreas Dannenberg <dannenberg@ti.com> wrote:
> >> > From: Daniel Allred <d-allred@ti.com>
> >> >
> >> > The next stage boot loader image and the selected FDT can be
> >> > post-processed by board/platform/device-specific code, which can include
> >> > modifying the size and altering the starting source address before
> >> > copying these binary blobs to their final desitination. This might be
> >> > desired to do things like strip headers or footers attached to the
> >> > images before they were packeaged into the FIT, or to perform operations
> >> > such as decryption or authentication.
> >> >
> >> > Signed-off-by: Daniel Allred <d-allred@ti.com>
> >> > Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
> >> > ---
> >> > common/spl/spl_fit.c | 21 ++++++++++++++++-----
> >> > include/image.h | 15 +++++++++++++++
> >> > 2 files changed, 31 insertions(+), 5 deletions(-)
> >> >
> >> > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> >> > index 9874708..ecbcb97 100644
> >> > --- a/common/spl/spl_fit.c
> >> > +++ b/common/spl/spl_fit.c
> >> > @@ -121,6 +121,10 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size,
> >> > return (data_size + info->bl_len - 1) / info->bl_len;
> >> > }
> >> >
> >> > +void __weak board_fit_image_post_process(void **p_src, size_t *p_size)
> >> > +{
> >> > +}
> >>
> >> Can you make this a Kconfig option instead of a weak function? It's
> >> hard enough to trace what a particular board is doing...
> >
> > Hi Simon,
> > I understand your point and we did look into doing it but could not come
> > up with a good way (certainly I don't want to clutter this global file
> > with any TI stuff) but maybe we were over-thinking it :)
> >
> > So (roughly) how would you like to see this Kconfig option to be
> > implemented? I'll be happy to change the implementation if given a
> > little direction.
>
> Add Kconfig like FIT_IMAGE_POST_PROCESS
>
> Then in the code:
>
> if (IS_ENABLED(FIT_IMAGE_POST_PROCESS))
> board_fit_image_post_process(...)
>
> (or use #ifdef)
>
> and enable it for your board.
>
> You are already cluttering the code with TI stuff, but at least this
> way it is clear whether a particular board is using this feature.
> Perhaps others will find it useful too.
Simon,
Yes that was the idea, to allow other use cases here as well. And thanks
for the suggestion, that's actually simpler than what we had thought of
(while also helping the re-use aspect). I'm also going to make this a
SPL_FIT_IMAGE_POST_PROCESS to narrow the scope a little and to follow a
similar scheme like the other SPL FIT related options.
Regards,
Andreas
> With enough weak functions we would reach a point where no one can
> figure out what is happened without linking the code and looking at
> the link map!
>
> Regards,
> Simon
next prev parent reply other threads:[~2016-06-23 15:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 3:34 [U-Boot] [PATCH 0/9] Secure Boot by Authenticating/Decrypting SPL FIT blobs Andreas Dannenberg
2016-06-21 3:34 ` [U-Boot] [PATCH 1/9] arm: cache: add missing dummy functions for when dcache disabled Andreas Dannenberg
2016-06-21 3:34 ` [U-Boot] [PATCH 2/9] spl: fit: add support for post-processing of images Andreas Dannenberg
2016-06-21 23:57 ` Tom Rini
2016-06-23 2:38 ` Masahiro Yamada
2016-06-23 13:25 ` Andreas Dannenberg
2016-06-23 13:57 ` Simon Glass
2016-06-23 14:19 ` Andreas Dannenberg
2016-06-23 14:45 ` Simon Glass
2016-06-23 15:00 ` Andreas Dannenberg [this message]
2016-06-21 3:34 ` [U-Boot] [PATCH 3/9] arm: omap-common: add secure smc entry Andreas Dannenberg
2016-06-21 23:57 ` Tom Rini
2016-06-21 3:34 ` [U-Boot] [PATCH 4/9] arm: omap-common: add secure rom call API for secure devices Andreas Dannenberg
2016-06-21 23:56 ` Tom Rini
2016-06-21 3:34 ` [U-Boot] [PATCH 5/9] arm: omap-common: secure ROM signature verify API Andreas Dannenberg
2016-06-21 4:31 ` Lokesh Vutla
2016-06-21 5:02 ` Andreas Dannenberg
2016-06-21 5:16 ` Lokesh Vutla
2016-06-21 23:56 ` Tom Rini
2016-06-22 9:43 ` Lokesh Vutla
2016-06-22 14:21 ` Andreas Dannenberg
2016-06-22 14:36 ` Tom Rini
2016-06-22 14:49 ` Andreas Dannenberg
2016-06-21 3:34 ` [U-Boot] [PATCH 6/9] arm: omap-common: Update to generate secure U-Boot FIT blob Andreas Dannenberg
2016-06-21 3:34 ` [U-Boot] [PATCH 7/9] arm: omap5: add U-Boot FIT signing and SPL image post-processing Andreas Dannenberg
2016-06-21 23:57 ` Tom Rini
2016-06-21 3:34 ` [U-Boot] [PATCH 8/9] arm: am4x: " Andreas Dannenberg
2016-06-21 23:57 ` Tom Rini
2016-06-21 3:34 ` [U-Boot] [PATCH 9/9] doc: Update info on using secure devices from TI Andreas Dannenberg
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=20160623150044.GW26355@borg.dal.design.ti.com \
--to=dannenberg@ti.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