Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74BD4C433F5 for ; Tue, 4 Jan 2022 10:51:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D1F6281429; Tue, 4 Jan 2022 11:51:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="aNy8LRjs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 274828192E; Tue, 4 Jan 2022 11:51:32 +0100 (CET) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ED9A5811BA for ; Tue, 4 Jan 2022 11:51:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wr1-x433.google.com with SMTP id r17so75295894wrc.3 for ; Tue, 04 Jan 2022 02:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vcsj5k1uVk8NyW3lNQK+4QDvtbFd8iQmUQ3OOo0f95w=; b=aNy8LRjsL0xrWvkiG1EKM2wuSagMi3yC2BbAzvU3oQwChGNRPt3VSevK/lXy7vnPP+ 0V95gLL1eXd55zgsdDxdjQIp51nYX47wEadoJNF+bXMrAki3yQP2WttXMByqN5o7lZIV WOpgBdiaqbEWJDTpUSAZ0a7gHM23NtULv261k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vcsj5k1uVk8NyW3lNQK+4QDvtbFd8iQmUQ3OOo0f95w=; b=aSWDnhP/8l1UkdLAGOvmAAYZ6M4fLzjZsYEObsti5jHzRRGAPkw9TOMSRM35dM6gUu fJkkJt5nQ+DvvfTIyiMAI1XyY9xsSrQPva9LSQeEFZITkA9WWv6vUomaB2iQ9WhGzoOH IZ7p7hH5OW/Yl7Z3TjHN3S4cjAY9I7va+uBRWKP5+XHMM1TXwYZ/ylEFQgegt+9fN+Ub vkFRvJeXbaL1lRi8eXN+pysa5NDiDgnpQXh8nnxTQwjsoFGXW2xrHzMR0X6U6DBZUL3a 8OOitTi0paqFiRSLQo5PqcoWGKkwWksdv7qBOt5rRkGKyU5nm6q7y8l2WyVHF2hUFs5S EVYw== X-Gm-Message-State: AOAM533hhbUs0b6ZD2az9lCzE0RLfUOzRNsnn1Ohxm5yED1J5u2riMJw VZbKWRFpwcnqzWJgX0ZkCWoQXOUoENUHsQ== X-Google-Smtp-Source: ABdhPJzioy4WafBDMkujAT3VKZvuSxCv+X0qCzgcPlh6aWrmmr1wzZDmNrdXISTzfG0hYYBmMIJ/fg== X-Received: by 2002:a05:6000:1886:: with SMTP id a6mr43025721wri.614.1641293488330; Tue, 04 Jan 2022 02:51:28 -0800 (PST) Received: from sjg1.roam.corp.google.com (bba134459.alshamil.net.ae. [217.165.114.93]) by smtp.gmail.com with ESMTPSA id m10sm38310552wms.25.2022.01.04.02.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 02:51:27 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Christian Melki , Tom Rini , Ilias Apalodimas , Bin Meng , Simon Glass , Alexander Graf Subject: [PATCH v9 0/9] efi: Improvements to U-Boot running on top of UEFI Date: Tue, 4 Jan 2022 03:51:09 -0700 Message-Id: <20220104105118.373365-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean At present U-Boot can be built as an EFI app, but it is really just for testing, with very few features. Instead, the payload build is used for booting on top of UEFI, where U-Boot takes over the machine immediately and supplies its own drivers. But the app could be made more useful. This series provides access to EFI block devices and the video console within U-Boot. It also restructures the app to make it possible to boot a kernel, although further work is needed to implement this. This can be thought of as making U-Boot perform a little like 'grub', in that it runs purely based on UEFI-provided services. Of course a lot more work is required, but this is a start. Note: It would be very useful to include qemu tests of the app and stub in CI. This is available at u-boot-dm/efi-working Changes in v9: - Add a comment as to why printf() cannot be used - Comment out storing the EFI memory map in the app and update commit message - Drop changes previously applied Changes in v8: - Add new patch to tidy up header comments Changes in v7: - Rebase on -master instead of -next Changes in v6: - Fix typo in function comment Changes in v5: - Add new patch to avoid using the 64-bit link script for the EFI app - Add new patch to build the 64-bit app properly - Add new patch to round out the link script for 64-bit EFI - Add new patch to set the correct link flags for the 64-bit EFI app - Add new patch to tweak the code used for the 64-bit EFI app - Add various patches to fix up the 64-bit app so that it boots Changes in v2: - Add a sentence about what the patch does - Add new patch to support the efi command in the app Simon Glass (9): efi: Move exit_boot_services into a function x86: efi: Update efi_get_next_mem_desc() to avoid needing a map efi: Support the efi command in the app x86: efi: Tweak the code used for the 64-bit EFI app x86: efi: Round out the link script for 64-bit EFI x86: efi: Don't use the 64-bit link script for the EFI app x86: efi: Set the correct link flags for the 64-bit EFI app efi: Build the 64-bit app properly efi: Tidy up some comments in efi header Makefile | 4 +- arch/x86/config.mk | 15 +++++-- arch/x86/cpu/config.mk | 2 +- arch/x86/cpu/efi/payload.c | 8 ++-- arch/x86/cpu/x86_64/cpu.c | 5 +++ arch/x86/lib/Makefile | 5 +-- arch/x86/lib/elf_x86_64_efi.lds | 5 ++- arch/x86/lib/relocate.c | 2 + cmd/Makefile | 2 +- cmd/efi.c | 78 +++++++++++++++++++++------------ include/efi.h | 64 +++++++++++++++++++++++---- lib/efi/efi.c | 72 ++++++++++++++++++++++++++++++ lib/efi/efi_app.c | 42 ++++++++++++++++++ lib/efi/efi_stub.c | 66 +++++----------------------- 14 files changed, 263 insertions(+), 107 deletions(-) -- 2.34.1.448.ga2b2bfdf31-goog