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 40A6FEB64D9 for ; Wed, 12 Jul 2023 15:05:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1EDA186B12; Wed, 12 Jul 2023 17:05:05 +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="mG5HPpqa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9249586B06; Wed, 12 Jul 2023 17:05:02 +0200 (CEST) Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 ACEF186ADB for ; Wed, 12 Jul 2023 17:04:59 +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-io1-xd32.google.com with SMTP id ca18e2360f4ac-78372b895d6so336289039f.2 for ; Wed, 12 Jul 2023 08:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689174298; x=1691766298; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xUECPEtn+8XoYQ37wsLr5NhE3XeVF0dA81p37P7ivmk=; b=mG5HPpqawAN568NTJHcwljXoBqGBGmmgrevGoRJ9yWFrJmAOJF7nVXGd6cVFHY8NXZ 8tMaia8AfFi/XoEIIv8uGtz583M971XTg5URLS0gjxIDk6eGIubGFiEHd/at7Sa82OAg ZaJIOC9T+RLPNSu9haobelfvhkNPC/7+Uud40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689174298; x=1691766298; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xUECPEtn+8XoYQ37wsLr5NhE3XeVF0dA81p37P7ivmk=; b=PNAcPKPb+65MNiJ2BZW9Y0YFbyWlG6JYOWJB4eMjnFYvCgvtM+Jg2HASeHubEVYsje 20m5pkH7ZQY2qEp46Z2GQh74JZvmqr9vNF12C4vCdUuUMKNdBg25WaZ46VVIya5f24LB UTH4zsFnKQAob/AqqBMSbuEdnI+QsvJB1pHRgzQZ8QFrKseiE5LJtmsZXoPKbnLnF+4D GAu93iuXUi/zyyk3jKVhU7s1ot7UPQM592zds7jfVjxqMakMVms5+h7qruEJ5K0Nj7bE q0IRmDzOQOjDJCaNx6iSCsCjKxj6eV3SgI/l5PKhkSGBgS5LONoKOM1D5UVyZ/oV/Ipg NUug== X-Gm-Message-State: ABy/qLauVfeTfJbN8Fph010zv6clQ4WWwKIDZtlOHpYKhN8i72PMuWv6 8fJABDEViEPEU0lfi0vGLsNmILT2FeBOPUSssOE= X-Google-Smtp-Source: APBJJlGvkWxzw5xVEXHpXjRFpaillK2R73qO+9Ug3BEAVX/KSuUfcc1BA/PF49S80XHTLzEsxPE0hw== X-Received: by 2002:a6b:e80e:0:b0:786:6180:76f6 with SMTP id f14-20020a6be80e000000b00786618076f6mr20434734ioh.12.1689174298016; Wed, 12 Jul 2023 08:04:58 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id h16-20020a0566380f1000b0042b08954dc3sm1202958jas.33.2023.07.12.08.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 08:04:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass Subject: [PATCH v3 00/18] bootstd: Add a bootmeth for ChromiumOS on x86 Date: Wed, 12 Jul 2023 09:04:29 -0600 Message-ID: <20230712150453.2407923-1-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.390.g38632f3daf-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.8 at phobos.denx.de X-Virus-Status: Clean This series adds a simple bootmeth for ChromiumOS on x86. It uses zimage to boot the kernel. Full verified boot is not included at this stage - that is still a separate chunk of code to be brought into standard boot at some point. For now it just obtains the kernel and command line and boots. This should be enough to boot Chrome OS from coreboot on all x86 machines in circulation, although only Brya (2022) and Coral (2017) have been tested. ChromiumOS needs quite large kernel parameters, to hold the DM verity settings and other pieces. This makes it painful to modify just one parameter, since the whole cmdline must be adjusted at once. To cope with this, a new cmdline-editing feature is provided: the 'bootflow cmdline' command allows individual parameters to be added, modified and deleted. To deal with enabling debug console, a variant supports setting 'earlycon' and 'console' automatically. The 'bdinfo' command is updated to show serial-port info also. Booting the zimage is now done programmatically, rather than running through the command-line interface. Minor tweaks are made to the coreboot and coral config so that booting works correctly. Note that the ACPI tables are not updated with the required firmware information in this series, so a warning is shown on boot. This will be addressed later since it requires quite a bit of configuration. Finally, this fixes a recently introduced bug in unit testing and updates the algorithm to avoid running flat-tree tests which don't actually use the devicetree. Changes in v3: - Drop CONFIG_MISC and CONFIG_NVMEM - Update commit message - Separate out patch to restore test behaviour on failure Changes in v2: - Update host_bootdev.c too - Correct 'it not known' typo - Explain why the setup information is not behind an #ifdef - Add comment for copy_in() - Avoid multiplication on a boolean - Add a comment as to why @len is needed - Show error messages when something goes wrong - Add new patch to create a little more room for U-Boot on qemu-x86_64 - Add new patch to switch x86 qemu to standard boot - Drop mention of NVMe support Simon Glass (18): test: Skip flat-tree tests if devicetree is not used bootstd: Correct the name of the QEMU bootmeth bootstd: Use bootdev instead of bootdevice bootstd: Correct baudrate typo bootstd: Allow storing the OS command line in the bootflow bootstd: Use the bootargs env var for changing the cmdline bootstd: Allow storing x86 setup information bdinfo: Show information about the serial port bootstd: Add a function to update a command line bootstd: Add support for updating elements of the cmdline x86: qemu: Create a little more room for U-Boot x86: qemu: Switch to standard boot bootstd: Support automatically setting Linux parameters x86: Add a function to boot a zimage x86: zimage: Export the function to obtain the cmdline bootstd: Add a simple bootmeth for ChromiumOS x86: coreboot: Adjust various config options x86: coral: Adjust various config options arch/x86/include/asm/zimage.h | 27 +++ arch/x86/lib/zimage.c | 93 ++++++-- boot/Kconfig | 11 + boot/Makefile | 1 + boot/bootflow.c | 339 ++++++++++++++++++++++++++++- boot/bootmeth-uclass.c | 2 +- boot/bootmeth_cros.c | 212 ++++++++++++++++++ boot/bootmeth_qfw.c | 2 +- cmd/bdinfo.c | 21 ++ cmd/bootflow.c | 87 +++++++- configs/chromebook_coral_defconfig | 10 +- configs/coreboot_defconfig | 14 +- configs/qemu-x86_64_defconfig | 5 +- configs/qemu-x86_defconfig | 2 +- configs/tools-only_defconfig | 1 + doc/usage/cmd/bootflow.rst | 100 ++++++++- drivers/mmc/mmc_bootdev.c | 2 +- drivers/scsi/scsi_bootdev.c | 2 +- drivers/usb/host/usb_bootdev.c | 2 +- fs/sandbox/host_bootdev.c | 2 +- include/bootdev.h | 2 +- include/bootflow.h | 100 ++++++++- include/configs/qemu-x86.h | 8 - include/env_callback.h | 6 +- net/eth_bootdev.c | 2 +- test/boot/bootflow.c | 263 ++++++++++++++++++++++ test/test-main.c | 3 +- 27 files changed, 1263 insertions(+), 56 deletions(-) create mode 100644 boot/bootmeth_cros.c -- 2.41.0.390.g38632f3daf-goog