From mboxrd@z Thu Jan 1 00:00:00 1970 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 28CB3C433EF for ; Sat, 4 Dec 2021 15:57:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F262682F03; Sat, 4 Dec 2021 16:57:11 +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="Lhq5Z6j0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD5E482F63; Sat, 4 Dec 2021 16:57:09 +0100 (CET) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (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 78672811B3 for ; Sat, 4 Dec 2021 16:57:05 +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-oi1-x233.google.com with SMTP id m6so12313204oim.2 for ; Sat, 04 Dec 2021 07:57:05 -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=NoHTb8fQP/MzDhHycE2h3iFFjbBPY33UO8tf/flC/B8=; b=Lhq5Z6j0u9PJw2Nd+Shncw1C8H916fSh1Qpzow45NmnOmy7pcxvLkP27mAPAFWz9Dr O25UWFKR/gi0xFqkRucQFO9sezO+qTyp8j8EdOT95sseL5BsLGcuxgvtMxCHfeMmrcvD Bxd2HrQZ8FaQXxzfc6Ah+mydGY0G6rjbUCUrM= 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=NoHTb8fQP/MzDhHycE2h3iFFjbBPY33UO8tf/flC/B8=; b=zFCAL8+JTtgCzHaG+XpUwt87u80xbIlsNlMmuT31jdW/p2SjqunG29K2ABbZb/hmcU dIIDo5qyantJho6oK/2IxUcArNmv7EJ8pP46TOIIItH1satHvq1mSsvhmJBADow64gF3 r/7/CVpAfXEaRpr4t9J0TQn+V7zf2plDDGX63+zJ1VTvH5SrsSoiKBnlRp/8OS8SknHe r8W9STUJikNafyoBMAz2dmkN6HTFiYr/MWIj3L4rThrUS/7MEyY58hGJq17WHbePDUHs LJou1/icvj3KFFSqHVWyHc6Kah5kQ2vQiMjjKHd4amhEYqH1rgp3Vz9wzJz+dMCa2tvQ jmKA== X-Gm-Message-State: AOAM532e/SEmA3uisAU+ezbLEk8X1M1IeEbWhDUAn0VYkYHHs2m8uRg6 vSOVArgDMPsUGLEY1pxkOzDUDUPUxjUSvQ== X-Google-Smtp-Source: ABdhPJxeL+SHdJmaoJuIsGENnRdZFY0VulrIH2VbsIM0Pjx8ionRDIgPH9tmRZJEonFL35vLBVEw7A== X-Received: by 2002:a54:4f94:: with SMTP id g20mr15665083oiy.10.1638633423594; Sat, 04 Dec 2021 07:57:03 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a12sm1230513otk.35.2021.12.04.07.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 07:57:03 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Christian Melki , Bin Meng , Heinrich Schuchardt , Tom Rini , Simon Glass , Alexander Graf Subject: [PATCH v5 00/28] efi: Improvements to U-Boot running on top of UEFI Date: Sat, 4 Dec 2021 08:56:29 -0700 Message-Id: <20211204155657.2913911-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-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 v5: - Add new patch to avoid setting up global_data again with EFI - 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 resolve EFI/EFI_LOADER conflict - 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 - Fix grammar in commit message Changes in v3: - Add new patch to show the system-table revision - Drop comments that confuse sphinx - Move device_path path change to its own patch Changes in v2: - Add MAINTAINERS entry - Add a better boot command too - Add a sentence about what the patch does - Add new patch to support the efi command in the app - Drop mention of partitions from the commit message - Fix 'as' typo - Show the correct interface type with 'part list' - Update documentation - Update the commit message to explain things better - Use log_info() instead of printf() Simon Glass (28): efi: Rename UCLASS_EFI and IF_TYPE_EFI efi: Add EFI uclass for media efi: Add a media/block driver for EFI block devices efi: Locate all block devices in the app efi: serial: Support arrow keys bloblist: Support allocating the bloblist x86: Allow booting a kernel from the EFI app x86: Don't process the kernel command line unless enabled x86: efi: Add room for the binman definition in the dtb efi: Drop device_path from struct efi_priv efi: Add comments to struct efi_priv efi: Fix ll_boot_init() operation with the app efi: Add a few comments to the stub efi: Share struct efi_priv between the app and stub code efi: Move exit_boot_services into a function efi: Check for failure when initing the app efi: Mention that efi_info_get() is only used in the stub efi: Show when allocated pages are used efi: Allow easy selection of serial-only operation x86: efi: Update efi_get_next_mem_desc() to avoid needing a map efi: Support the efi command in the app x86: efi: Show the system-table revision x86: efi: Don't set up global_data again with EFI 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 MAINTAINERS | 3 + Makefile | 4 +- arch/sandbox/dts/test.dts | 4 + arch/x86/config.mk | 15 +- arch/x86/cpu/config.mk | 2 +- arch/x86/cpu/efi/payload.c | 17 +- arch/x86/cpu/x86_64/cpu.c | 5 + arch/x86/dts/Makefile | 2 +- arch/x86/lib/Makefile | 5 +- arch/x86/lib/bootm.c | 11 +- arch/x86/lib/elf_x86_64_efi.lds | 5 +- arch/x86/lib/relocate.c | 2 + arch/x86/lib/zimage.c | 13 +- cmd/Makefile | 2 +- cmd/efi.c | 78 +++++--- common/Kconfig | 15 +- common/bloblist.c | 16 +- common/board_f.c | 8 +- common/board_r.c | 5 +- disk/part.c | 5 +- doc/develop/bloblist.rst | 16 ++ doc/develop/uefi/u-boot_on_efi.rst | 6 +- doc/develop/uefi/uefi.rst | 8 +- drivers/block/Kconfig | 33 ++++ drivers/block/Makefile | 4 + drivers/block/blk-uclass.c | 6 +- drivers/block/efi-media-uclass.c | 15 ++ drivers/block/efi_blk.c | 115 ++++++++++++ drivers/block/sb_efi_media.c | 20 +++ drivers/serial/serial_efi.c | 11 +- include/blk.h | 3 +- include/configs/efi-x86_app.h | 25 +++ include/dm/uclass-id.h | 3 +- include/efi.h | 113 +++++++++++- include/efi_api.h | 15 ++ include/init.h | 2 +- lib/efi/efi.c | 97 ++++++++++ lib/efi/efi_app.c | 276 +++++++++++++++++++++++++++-- lib/efi/efi_stub.c | 95 ++++------ lib/efi_driver/efi_block_device.c | 8 +- lib/efi_driver/efi_uclass.c | 8 +- test/dm/Makefile | 1 + test/dm/efi_media.c | 24 +++ 43 files changed, 958 insertions(+), 163 deletions(-) create mode 100644 drivers/block/efi-media-uclass.c create mode 100644 drivers/block/efi_blk.c create mode 100644 drivers/block/sb_efi_media.c create mode 100644 test/dm/efi_media.c -- 2.34.1.400.ga245620fadb-goog