From: Heinrich Schuchardt Date: Sat, 15 Jun 2019 05:55:47 +0200 Subject: [U-Boot] [PATCH] cmd: fat: fatload: pass device path for efi payload In-Reply-To: <20190531140334.15529-1-ykaukab@suse.de> References: <20190531140334.15529-1-ykaukab@suse.de> Message-ID: <42bdd89b-6b68-8214-044f-4cf770a0ec60@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 5/31/19 4:03 PM, Mian Yousaf Kaukab wrote: > fatload command can be used to load the EFI payload since EFI system > partition is always a FAT partition. Call into EFI code from > do_fat_fsload() to set the device path from which the last binary was > loaded. An EFI application like grub2 can=E2=80=99t find its configuration > file without the device path set. > > load command (do_load_wrapper()) already calls efi_set_bootdev(). > There is no need to move the call to do_load() as EFI system partition > is always a FAT partition. Thanks for reporting the issue. U-Boot has no restriction to EFI/FAT partitions when starting EFI applications though of cause EFI/FAT is the normal way to do it. > > Signed-off-by: Mian Yousaf Kaukab > --- > cmd/fat.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/cmd/fat.c b/cmd/fat.c > index 4b9a7eaab0..04e2055275 100644 > --- a/cmd/fat.c > +++ b/cmd/fat.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > > int do_fat_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv= []) > { > @@ -33,6 +34,10 @@ U_BOOT_CMD( > > int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char * const a= rgv[]) > { > +#ifdef CONFIG_CMD_BOOTEFI > + efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "", > + (argc > 4) ? argv[4] : ""); > +#endif We have the same already in cmd/fs.c for the 'load' command. I think we should move it from cmd/fs.c to do_load(). Then we cover all file systems. Could you, please, update the patch accordingly and resend it to me. Best regards Heinrich > return do_load(cmdtp, flag, argc, argv, FS_TYPE_FAT); > } > >