public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/2] Add support for booting EFI FIT images
Date: Wed, 27 Nov 2019 21:45:26 +0200	[thread overview]
Message-ID: <20191127194526.GA18254@BV030612LT> (raw)
In-Reply-To: <8ac19207-ccc7-3ca3-7de4-b0ad32dc2cad@gmx.de>

On Tue, Nov 26, 2019 at 07:31:39PM +0100, Heinrich Schuchardt wrote:
> On 11/24/19 9:11 PM, Cristian Ciocaltea wrote:
> > Currently the only way to run an EFI binary like GRUB2 is via the
> > 'bootefi' command, which cannot be used in a verified boot scenario.
> > 
> > The obvious solution to this limitation is to add support for
> > booting FIT images containing those EFI binaries.
> > 
> > The implementation relies on a new image type - IH_OS_EFI - which
> > can be created by using 'os = "efi"' inside an ITS file:
> > 
> > / {
> >      #address-cells = <1>;
> > 
> >      images {
> >          efi-grub {
> >              description = "GRUB EFI";
> >              data = /incbin/("EFI/BOOT/bootarm.efi");
> >              type = "kernel_noload";
> >              arch = "arm";
> >              os = "efi";
> >              compression = "none";
> >              load = <0x0>;
> >              entry = <0x0>;
> >              hash-1 {
> >                  algo = "sha256";
> >              };
> >          };
> >      };
> > 
> >      configurations {
> >          default = "config-grub";
> >          config-grub {
> >              kernel = "efi-grub";
> >              signature-1 {
> >                  algo = "sha256,rsa2048";
> >                  sign-images = "kernel";
> >              };
> >          };
> >      };
> > };
> > 
> > The bootm command has been extended to handle the IH_OS_EFI images.
> > To enable this feature, a new configuration option has been added:
> > BOOTM_EFI
> > 
> > I tested the solution using the 'qemu_arm' board:
> > 
> > => load scsi 0:1 ${kernel_addr_r} efi-image.fit
> > => bootm ${kernel_addr_r}#config-grub
> 
> Thanks a lot for the patch series which makes good sense to me.
> 
> I think we should pass addresses and not strings to cmd/bootefi.c. This
> will need a bit of refactoring as already addressed in a comment to
> patch 2/2.
> 
> Additionally the documentation in doc/uefi/u-boot_on_efi.rst and
> doc/uImage.FIT/howto.txt should be updated.
> 
> I cc the contributors given by
> scripts/get_maintainer.pl -f common/bootm_os.c
> 
> Best regards
> 
> Heinrich
> 

Thanks for the feedback, Heinrich!

Instead of creating new function(s), I think we could simply extend
  int do_bootefi_image(const char *image_opt)
with a new parameter to hold the fdt address and move here the call
to 'efi_install_fdt()', which is now performed by 'do_bootefi()'.

However, I'm not sure about changing the data types, i.e. from
'char *' to ulong, for the following reasons:
1. image_opt may have a different meaning in addition to efi address
2. fdt address may not be provided, so we need somehow to detect an
invalid value

Kind regards,
Cristian

> > 
> > 
> > Cristian Ciocaltea (2):
> >    image: Add IH_OS_EFI for EFI chain-load boot
> >    bootm: Add a bootm command for type IH_OS_EFI
> > 
> >   cmd/Kconfig        |  9 ++++++++-
> >   cmd/bootefi.c      |  2 +-
> >   common/bootm_os.c  | 44 ++++++++++++++++++++++++++++++++++++++++++++
> >   common/image-fit.c |  3 ++-
> >   common/image.c     |  1 +
> >   include/bootm.h    |  2 ++
> >   include/image.h    |  1 +
> >   7 files changed, 59 insertions(+), 3 deletions(-)
> > 
> 

  reply	other threads:[~2019-11-27 19:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 20:11 [U-Boot] [PATCH 0/2] Add support for booting EFI FIT images Cristian Ciocaltea
2019-11-24 20:11 ` [U-Boot] [PATCH 1/2] image: Add IH_OS_EFI for EFI chain-load boot Cristian Ciocaltea
2019-11-24 20:11 ` [U-Boot] [PATCH 2/2] bootm: Add a bootm command for type IH_OS_EFI Cristian Ciocaltea
2019-11-25  6:22   ` Heinrich Schuchardt
2019-12-27 16:41     ` Simon Glass
2019-12-27 19:05       ` Heinrich Schuchardt
2019-11-26 18:31 ` [U-Boot] [PATCH 0/2] Add support for booting EFI FIT images Heinrich Schuchardt
2019-11-27 19:45   ` Cristian Ciocaltea [this message]
2019-11-28  7:20     ` Heinrich Schuchardt
2019-12-08  0:25       ` Heinrich Schuchardt
2019-12-09  8:59         ` Cristian Ciocaltea
2019-12-09 17:42           ` Heinrich Schuchardt

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=20191127194526.GA18254@BV030612LT \
    --to=cristian.ciocaltea@gmail.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