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 E3B24C19F2A for ; Sat, 30 Jul 2022 21:52:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5BA6A83FA7; Sat, 30 Jul 2022 23:52:53 +0200 (CEST) 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="kPIVBOs5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F4EE80306; Sat, 30 Jul 2022 23:52:51 +0200 (CEST) Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) (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 D325D8412C for ; Sat, 30 Jul 2022 23:52:48 +0200 (CEST) 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-x231.google.com with SMTP id i4so9312835oif.2 for ; Sat, 30 Jul 2022 14:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=cxtsIkx+E6uqrHifUSJGYgOfKHVhp1mpZ3jY03Me04A=; b=kPIVBOs5fpKosXZSXZVw6Fck+tOAfNySSz7gfFc6YMw4E0ZIs/Pa2JjwDNJcDLBsOE XUcutuNeAm7U5hjbodpw2H0am/+2LBSbW51wixki54yitGC6A0RjQe4Q+41Z52tfvjyn gY122GJGU1LptcpdgchnWIXwzMx8TZPAcLLvI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=cxtsIkx+E6uqrHifUSJGYgOfKHVhp1mpZ3jY03Me04A=; b=nyl3hVp9tP2X2gdMEK5Dg+JpZxgrvliQOtJWT36xWtJcj0WCmokDReWeL1kAaLyckz OJGGSmhpHjB/Yu+9R8NFldBZP16XXfmZb/DdPgNU4AYkvXLy79+4/Pc3KiyYp5Tc9PsE I51iNj9Uu6lgV76d8lKo9HbsI1lqIMFfFZykupB6s52s4HEhDqEjoorxCChmoje7mtnZ Kpxg1bFKUCJr6AoSSWiZYHzgsk2PIOpzuhjLVety7ec0bWrL+CfxpTgoRv8CqvfMqL6k gvF0y/R26qfOdFCSpaVXm1zGLzr3GnDM/95qi4S3ohsErcNl3YuZY0Fg66meavnTAnDf dTlA== X-Gm-Message-State: AJIora/lm2z4vOY/7oHDCAxjzBeGV+HqxLNjCbX9m/vA1Au97Mc8RRz/ Q+me63jtVaJkLcXRR63satQyGqETcivzvacU X-Google-Smtp-Source: AGRyM1sGJOVi0242JylyHmhLivu02vj/KlCOfC8nVU7TdTU8q15sb8ewlQWyjvCARW+LsanhT4Rh0w== X-Received: by 2002:a05:6808:d4e:b0:33a:b40a:54dd with SMTP id w14-20020a0568080d4e00b0033ab40a54ddmr4309528oik.294.1659217966983; Sat, 30 Jul 2022 14:52:46 -0700 (PDT) Received: from sjg1.lan (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 19-20020a544193000000b0032f75714af1sm1699656oiy.18.2022.07.30.14.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 14:52:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass , Anatolij Gustschin , Marek Vasut , Pavel Herrmann Subject: [PATCH v2 00/35] vbe: Verified Boot for Embedded initial support Date: Sat, 30 Jul 2022 15:52:02 -0600 Message-Id: <20220730215237.818368-1-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.455.g008518b4e5-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean This adds the concept of a VBE method to U-Boot, along with an implementation of the 'VBE simple' method, basically a simple way of updating firmware in MMC from userspace and monitoring it from U-Boot. VBE simple is implemented in fwupd. U-Boot's role is to set up the device tree with the required firmware-update properties and provide the developer with information about the current VBE state. To that end this series includes a new 'vbe' command that allows VBE methods to be listed and examined. As part of this work, support for doing FDT fixups via the event interface is provided, along with the ability to write to the device tree via the ofnode interface. Another (significant) change is that bootmeths now have a 'global' flag, to allow the implementation of EFI bootmgr (and VBE) to be cleaned up. The 'system' bootdev is no-longer needed and these bootmeths are scanned first. Further work is needed to pull everything together, but this is a step along the way. Changes in v2: - Add new patch with some documentation and links for VBE - Add a reference to VBE documentation in the header file and commit - Make VBE a global bootmeth - Introduce the concept of global bootmeths (various patches) - Correct the clang / LTO / event bug from v1 Simon Glass (35): vbe: Add some documentation video: Renname vbe.h to vesa.h video: Rename structs and functions to avoid VBE dm: core: Split out the declaration of ofnode dm: core: Add a note about how livetree updates work dm: core: Introduce support for multiple trees dm: core: Move ofnode-writing test to ofnode dm: core: Swap parameters of ofnode_write_prop() dm: core: Tidy up ofnode-writing test dm: core: Prepare for updating the device tree with ofnode dm: core: Allow writing to a flat tree with ofnode dm: core: Add support for writing u32 with ofnode dm: core: Support sandbox with read interface bootstd: Drop delays in the tests bootstd: Fix comment in bootmeth test bootstd: Detect empty bootmeth ordering bootstd: Provide a bootmeth method to obtain state info bootstd: Tidy up var naming in bootdev_setup_iter_order() bootstd: Allow bootmeths to be marked as global bootstd: Allow EFI bootmgr to support an invalid bootflow bootstd: Allow the bootdev to be optional in bootflows bootstd: Tidy comments in bootflow_scan_bootdev() bootstd: Support bootflows with global bootmeths dm: core: Call dm_scan_other() when setting up for tests bootstd: Allow scanning for global bootmeths separately bootstd: Always create the EFI bootmgr bootmeth bootstd: Drop the system bootdev event: Change EVENT_SPY to global event: Add an event for device tree fixups vbe: Add initial support for VBE vbe: Support VBE simple bootstd: Add vbe bootmeth into sandbox bootstd: Update documentation bootstd: Check building without global bootmeths vbe: Add a new vbe command arch/sandbox/dts/sandbox.dtsi | 13 ++ arch/sandbox/dts/test.dts | 15 ++ arch/sandbox/include/asm/test.h | 11 + arch/x86/lib/bios.c | 12 +- arch/x86/lib/coreboot_table.c | 2 +- arch/x86/lib/fsp/fsp_graphics.c | 4 +- boot/Kconfig | 29 +++ boot/Makefile | 5 +- boot/bootdev-uclass.c | 15 +- boot/bootflow.c | 63 +++++- boot/bootmeth-uclass.c | 105 +++++++-- boot/bootmeth_distro.c | 14 ++ boot/bootmeth_efi_mgr.c | 35 ++- boot/bootstd-uclass.c | 13 +- boot/image-fdt.c | 11 + boot/system_bootdev.c | 66 ------ boot/vbe.c | 119 ++++++++++ boot/vbe_simple.c | 315 ++++++++++++++++++++++++++ cmd/Kconfig | 10 + cmd/Makefile | 1 + cmd/bootflow.c | 12 +- cmd/bootmeth.c | 4 +- cmd/elf.c | 2 +- cmd/read.c | 3 +- cmd/vbe.c | 87 +++++++ common/event.c | 3 + configs/sandbox_flattree_defconfig | 2 + doc/develop/bootstd.rst | 89 +++++--- doc/develop/driver-model/livetree.rst | 60 ++++- doc/develop/index.rst | 1 + doc/develop/vbe.rst | 26 +++ doc/usage/cmd/bootmeth.rst | 9 +- drivers/bios_emulator/atibios.c | 18 +- drivers/core/of_access.c | 57 ++++- drivers/core/ofnode.c | 81 +++---- drivers/pci/pci_rom.c | 14 +- drivers/video/broadwell_igd.c | 4 +- drivers/video/coreboot.c | 4 +- drivers/video/efi.c | 4 +- drivers/video/ivybridge_igd.c | 4 +- drivers/video/vesa.c | 4 +- include/bios_emul.h | 6 +- include/bootflow.h | 20 +- include/bootmeth.h | 65 +++++- include/bootstd.h | 2 + include/dm/of_access.h | 22 +- include/dm/ofnode.h | 122 +++++----- include/dm/ofnode_decl.h | 85 +++++++ include/event.h | 21 +- include/of_live.h | 16 ++ include/test/test.h | 2 + include/vbe.h | 147 ++++-------- include/vesa.h | 116 ++++++++++ lib/efi_loader/Kconfig | 1 + lib/elf.c | 2 +- lib/of_live.c | 14 +- test/boot/Makefile | 4 + test/boot/bootflow.c | 106 +++++++-- test/boot/bootmeth.c | 55 ++++- test/boot/vbe_simple.c | 115 ++++++++++ test/dm/ofnode.c | 132 +++++++++++ test/dm/test-fdt.c | 53 ----- test/py/tests/test_event_dump.py | 1 + test/test-main.c | 7 +- 64 files changed, 1930 insertions(+), 530 deletions(-) delete mode 100644 boot/system_bootdev.c create mode 100644 boot/vbe.c create mode 100644 boot/vbe_simple.c create mode 100644 cmd/vbe.c create mode 100644 doc/develop/vbe.rst create mode 100644 include/dm/ofnode_decl.h create mode 100644 include/vesa.h create mode 100644 test/boot/vbe_simple.c -- 2.37.1.455.g008518b4e5-goog