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 CBA43C433F5 for ; Mon, 17 Jan 2022 15:55:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB716837C5; Mon, 17 Jan 2022 16:55:48 +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="esrJvK/J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D518D80FE4; Mon, 17 Jan 2022 16:04:44 +0100 (CET) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 E61E3831B5 for ; Mon, 17 Jan 2022 16:04:36 +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-io1-xd31.google.com with SMTP id s11so13811378ioe.12 for ; Mon, 17 Jan 2022 07:04:36 -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=HMDyTzVov8R8hnaO+Axq1EWTS3sujfSPTu7PXlf0hnA=; b=esrJvK/JmvlE6dYc/NSaYIGtZ+HYP9/ohxpIbS3luAxxd37lL7tHzkn/3RumnNDsXz hNcoMAZEhqa/58PBax/YxrjxIWgrGHqLWf0/q38PIO1SrmqxW6bEQLFHNQygi+rBDmYI 1o2ZKrCHIJDIwS7KJ4AJOJoit3O1fn8go4VWc= 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=HMDyTzVov8R8hnaO+Axq1EWTS3sujfSPTu7PXlf0hnA=; b=uHTTgJtSznyaZ3cR0HCLYEFdvo0Wkow3KwyVdCJIYqy2I2JsguqGCDrjQFgoxqrLlO 4EndGjfyDw+8qTkiGPPHNSH9DW2RbkTej02grMCdYYX1vzzjXDZbeoHXcbtZruBGOmtz tnIv4wy4I9VHO+w8rRaBxQE75SiB83EVNsnoq6CxgJ5sdEaYfbGw6aVd3PAv1yYSZswy qqK/Uo2YeQnO14u4J42ytnMM/tbU2aa1W5REDM5P9WwVatxF6QP9KKzluoFA7R+0OrXf B6rsP3zGupNAPQUhM2QRTxkvoDAcWioTDzsdz9kf4fzQRqaOAZ6Xjk/xwceFKu7rMFxX yBkg== X-Gm-Message-State: AOAM5303ZBe5/6x8+4n7tfpqmE0AADNcwR5+s5nXMyr0uMXD1B4fNOkQ meEdcqx7yBJzTpRxLCUmoQAUrIxdqD5lEQ== X-Google-Smtp-Source: ABdhPJzyjh1eBSmtx4LkAGwYmIEUBSUfR8eCwEYUU8MAA+fJVX7uMw/y0NkHh+sJb5xddTqxY/ZqQQ== X-Received: by 2002:a05:6638:1111:: with SMTP id n17mr9700743jal.159.1642431875125; Mon, 17 Jan 2022 07:04:35 -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 f21sm9379320iol.42.2022.01.17.07.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:04:34 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Tom Rini , =?UTF-8?q?Fran=C3=A7ois=20Ozog?= , Heinrich Schuchardt , Bill Mills , Simon Glass , Albert Aribaud , Alexandru Gagniuc , Anatolij Gustschin , Artem Lapkin , Bharat Gooty , Bin Meng , Chia-Wei Wang , Daniel Schwierzeck , Dario Binacchi , Fabio Estevam , Harald Seiler , Heiko Schocher , Joel Peshkin , Jorge Ramirez-Ortiz , Kristian Amlie , Kunihiko Hayashi , Leo , Lukasz Majewski , Marek Vasut , Marek Vasut , Mario Six , Matthias Brugger , Michal Simek , "NXP i.MX U-Boot Team" , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Patrick Delaunay , Peng Fan , Rasmus Villemoes , Rayagonda Kokatanur , Ricardo Salveti , Rick Chen , Stefan Roese , Stefano Babic , Tom Warren , Tuomas Tynkkynen , Ye Li Subject: [PATCH v2 00/16] passage: Define a standard for firmware data flow Date: Mon, 17 Jan 2022 08:04:12 -0700 Message-Id: <20220117150428.1580273-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.703.g22d0c6ccf7-goog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 17 Jan 2022 16:55:46 +0100 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.2 at phobos.denx.de X-Virus-Status: Clean This series adds a standard way of passing information between different firmware phases. This already exists in U-Boot at a very basic level, in the form of a bloblist containing an spl_handoff structure, but the intent here is to define something useful across projects. The need for this is growing as firmware fragments into multiple binaries each with its own purpose. Without any run-time connection, we must rely on build-time settings which are brittle and painful to keep in sync. This feature is named 'standard passage' since the name is more unique than many others that could be chosen, it is a passage in the sense that information is flowing from one place to another and it is standard, because that is what we want to create. The implementation is simply a pointer to a bloblist in a register, with an extra register to point to a devicetree, for more complex data. This should cover all cases (small memory footprint as well as complex data flow) and be easy enough to implement on all architectures. The emphasis is on enabling open communcation between binaries, not enabling passage of secret, undocumented data, although this is possible in a private environment. This series is available at u-boot-dm/pass-working Changes in v2: - Add a devicetree for qemu-arm so that qemu_arm_spl can work - Add comments about how to pass standard passage to EFI - Add comments about passing a bloblist to Linux - Add detailed arch-specific information - Add new patch with the arm-specific standard passage implementation - Incorporate devicetree source - Make the stdpass calling standard arch-specific - Rebase to master - Rebase to master (dropping bloblist patches already applied) - Rework global_data for new stdpass convention - Split the jump_to_image_no_args() change into its own patch - Use three registers instead of two for the entry Simon Glass (16): spl: Tidy up the header includes arm: qemu: Add an SPL build spl: Rename jump_to_image_no_args() passage: Support an incoming passage passage: Support a control devicetree passage: arm: Accept a passage from the previous phase passage: spl: Support adding the dtb to the passage bloblist passage: spl: Support passing the passage to U-Boot passage: arm: Add the arch-specific standard passage impl passage: Add a qemu test for ARM sandbox: Add a way of checking structs for standard passage passage: Add documentation passage: Add docs for spl_handoff x86: Move Intel GNVS file into the common include directory passage: Add checks for pre-existing blobs WIP: RFC: Add a gitlab test .gitlab-ci.yml | 6 + MAINTAINERS | 10 + arch/arm/Kconfig | 2 +- arch/arm/cpu/armv7/cpu.c | 28 ++ arch/arm/cpu/armv7/start.S | 7 +- arch/arm/cpu/armv8/cpu.c | 20 + arch/arm/dts/qemu-arm-u-boot.dtsi | 22 + arch/arm/dts/qemu-arm.dts | 393 ++++++++++++++++- arch/arm/lib/crt0.S | 5 + arch/arm/mach-imx/imx8ulp/soc.c | 2 +- arch/arm/mach-imx/spl.c | 2 +- arch/arm/mach-k3/common.c | 2 +- arch/arm/mach-omap2/boot-common.c | 2 +- arch/arm/mach-qemu/Kconfig | 9 + arch/arm/mach-tegra/spl.c | 2 +- arch/mips/lib/spl.c | 2 +- arch/riscv/lib/spl.c | 2 +- arch/sandbox/cpu/spl.c | 4 +- arch/x86/cpu/apollolake/acpi.c | 2 +- arch/x86/cpu/intel_common/acpi.c | 2 +- .../include/asm/arch-apollolake/global_nvs.h | 2 +- arch/x86/lib/spl.c | 2 +- arch/x86/lib/tpl.c | 2 +- board/emulation/qemu-arm/Kconfig | 23 +- board/emulation/qemu-arm/MAINTAINERS | 1 + board/emulation/qemu-arm/Makefile | 1 + board/emulation/qemu-arm/spl.c | 27 ++ board/freescale/common/fsl_chain_of_trust.c | 2 +- board/google/chromebook_coral/coral.c | 2 +- board/renesas/rcar-common/gen3-spl.c | 2 +- board/sandbox/Makefile | 3 +- board/sandbox/stdpass_check.c | 107 +++++ common/Kconfig | 51 +++ common/bloblist.c | 8 +- common/board_f.c | 48 ++- common/spl/spl.c | 95 ++++- configs/qemu_arm_spl_defconfig | 78 ++++ doc/board/emulation/qemu-arm.rst | 37 ++ doc/develop/bloblist.rst | 4 +- doc/develop/index.rst | 1 + doc/develop/std_passage.rst | 396 ++++++++++++++++++ drivers/usb/gadget/f_sdp.c | 2 +- dts/Kconfig | 12 + include/asm-generic/global_data.h | 38 ++ include/bloblist.h | 1 + include/fdtdec.h | 4 + include/handoff.h | 8 +- .../x86/include/asm => include}/intel_gnvs.h | 0 include/passage.h | 28 ++ include/spl.h | 4 +- include/stdpass/README | 4 + include/stdpass/tpm2_eventlog.h | 42 ++ include/stdpass/vboot_ctx.h | 267 ++++++++++++ lib/asm-offsets.c | 6 + lib/fdtdec.c | 33 ++ test/py/tests/test_passage.py | 11 + 56 files changed, 1804 insertions(+), 72 deletions(-) create mode 100644 arch/arm/dts/qemu-arm-u-boot.dtsi create mode 100644 board/emulation/qemu-arm/spl.c create mode 100644 board/sandbox/stdpass_check.c create mode 100644 configs/qemu_arm_spl_defconfig create mode 100644 doc/develop/std_passage.rst rename {arch/x86/include/asm => include}/intel_gnvs.h (100%) create mode 100644 include/passage.h create mode 100644 include/stdpass/README create mode 100644 include/stdpass/tpm2_eventlog.h create mode 100644 include/stdpass/vboot_ctx.h create mode 100644 test/py/tests/test_passage.py -- 2.34.1.703.g22d0c6ccf7-goog