Hi Heinrich, On Sat, 15 Feb 2025 at 05:05, Simon Glass <s...@chromium.org> wrote: > > Hi Heinrich, > > On Sun, 9 Feb 2025 at 12:05, Heinrich Schuchardt <xypron.g...@gmx.de> wrote: > > > > Am 3. Februar 2025 18:42:00 MEZ schrieb Simon Glass <s...@chromium.org>: > > >Provide a -A flag to select ARM instead of x86. For now, only the app > > >is supported and only for 64-bit ARM. > > > > > >Signed-off-by: Simon Glass <s...@chromium.org> > > >--- > > > > > > scripts/build-efi.py | 49 +++++++++++++++++++++++++++++++------------- > > > 1 file changed, 35 insertions(+), 14 deletions(-) > > > > > >diff --git a/scripts/build-efi.py b/scripts/build-efi.py > > >index 3a1bf180ade..1ba37e86e88 100755 > > >--- a/scripts/build-efi.py > > >+++ b/scripts/build-efi.py > > >@@ -48,6 +48,8 @@ def parse_args(): > > > epilog='Script for running U-Boot as an EFI app/payload') > > > parser.add_argument('-a', '--app', action='store_true', > > > help='Package up the app') > > >+ parser.add_argument('-A', '--arm', action='store_true', > > > > Why have a flag per EFI architecture? > > > > Please add a parameterized flag instead. > > > > --arch i386 > > --arch x64 > > --arch arm > > --arch aarch64 > > --arch riscv64 > > > > and get rid of the bitness parameter. > > Tom has rejected this for the tree. I'll apply it to my tree and then > deal with this comments with another patch. But I'm thinking a > contrib/ directory would be better.
I've updated this here: https://source.denx.de/u-boot/u-boot-extras/-/tree/master/contrib/sjg?ref_type=heads > > > > > >+ help='Run on ARM architecture') > > > parser.add_argument('-B', '--no-build', action='store_true', > > > help="Don't build (an existing build must be > > > present") > > > parser.add_argument('-k', '--kernel', action='store_true', > > >@@ -131,26 +133,43 @@ class BuildEfi: > > > """ > > > extra = [] > > > efi_dir = self.get_setting("efi_dir") > > >- if bitness == 64: > > >- qemu = 'qemu-system-x86_64' > > >- bios = 'OVMF-pure-efi.x64.fd' > > >- else: > > >- qemu = 'qemu-system-i386' > > >- bios = 'OVMF-pure-efi.i386.fd' > > >+ if self.args.arm: > > >+ qemu_arch = 'aarch64' > > >+ extra += ['--machine', 'virt', '-cpu', 'max'] > > >+ bios = os.path.join(efi_dir, 'OVMF-pure-efi.aarch64.fd.64m') > > >+ var_store = os.path.join(efi_dir, 'varstore.img') > > >+ extra += [ > > >+ '-drive', f'if=pflash,format=raw,file={bios},readonly=on', > > >+ '-drive', f'if=pflash,format=raw,file={var_store}' > > >+ ] > > >+ extra += ['-drive', > > >+ f'id=hd0,file={self.img},if=none,format=raw', > > >+ '-device', 'virtio-blk-device,drive=hd0'] > > >+ else: # x86 > > >+ if bitness == 64: > > >+ qemu_arch = 'x86_64' > > >+ bios = 'OVMF-pure-efi.x64.fd' > > > > Not a filename used by EDK II or by QEMU. > > How best to handle this? The edk2.git-ovmf-x64 package has > > /usr/share/edk2.git/ovmf-x64/OVMF-pure-efi.fd > > but I cannot find similar packages for arm64. For ARM, the file has to > be extended to the correct size. I'm still wondering about this. Regards, SImon > > [..] > > Regards, > Simon