From patchwork Mon Jun 19 11:59:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1796533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=edW1UyLl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ql7dH6Q5Yz20XQ for ; Mon, 19 Jun 2023 22:00:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 79F868545F; Mon, 19 Jun 2023 14:00:38 +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="edW1UyLl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6A7385362; Mon, 19 Jun 2023 14:00:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 ECC2285362 for ; Mon, 19 Jun 2023 14:00:19 +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-wr1-x42d.google.com with SMTP id ffacd0b85a97d-311099fac92so3973257f8f.0 for ; Mon, 19 Jun 2023 05:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687176019; x=1689768019; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=688nb1nvXJuE+ANjo8OntXEZq4ZPUdBRuua9hsuxd28=; b=edW1UyLlYmBH+lK6mvy7+c7v3ke2leK0zOh6lbNAV74xTh4YHXEcPPs1hEWmM5fLBv 56baUIV9yVp6rjYdhBM2Pq+GPwfGV7oAWzukhLUVSCD2bcY/jEKrmSLRF2LOFF/yf+Te okL7NvjeRS87ZoJ7GxK5eGXMYTI+YMdGrjN9o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687176019; x=1689768019; 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=688nb1nvXJuE+ANjo8OntXEZq4ZPUdBRuua9hsuxd28=; b=bk2TcyRpe+AdbFL3VZGXyKDBFca0NinP1lGdYXxIRaWLtFQePJFgEaRY/vFZmGyvl7 NAkBNb7FlZeIkjlRhyP2ENcZ4ZsXEcS3gC1+n+WAyOkRioZ5iMT5QbfqPPO1tqH1PqLT iaK+GcUWK3nSdX7s4BsUKI9zPm5woTN0fB+0A+8Pf70S0X3eLgKEfjSy1XhWfVpVFIHP yzeKGbvw1cpxf1n903DBHnDvZCHl1c4QIpakMR1SvxlllyrBAAxMLiuTs5vZZgHfFsJf G82P8yr3H50T00PVT8PTxF235CqMlyVyd7eeHqVK1tX5vnBiTHv7bZfW97W0vtHMogPR EcmQ== X-Gm-Message-State: AC+VfDwdxRRmAK9OV73/8jWHKNHpLbSA1HF66Nj34S3PT06I/eR2V3VX 2H/WsxaIMLRHSS3ZUQ4fyQxBfElh+eaXNXuMD/4= X-Google-Smtp-Source: ACHHUZ6MR9jliZ0pckbjsjrkOFgLEIBSgD4LwY73aX4OerXZwqeABw+zhqyrCkms5+7dU6/CEvPWQw== X-Received: by 2002:adf:f2c7:0:b0:306:3b78:fe33 with SMTP id d7-20020adff2c7000000b003063b78fe33mr8155133wrp.32.1687176019005; Mon, 19 Jun 2023 05:00:19 -0700 (PDT) Received: from sjg1.roam.corp.google.com (79-67-123-132.dynamic.dsl.as9105.com. [79.67.123.132]) by smtp.gmail.com with ESMTPSA id k6-20020adff5c6000000b0031122bd3c82sm8886794wrp.17.2023.06.19.05.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 05:00:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Nikhil M Jain , Simon Glass , Anatolij Gustschin , =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= Subject: [PATCH v4 00/45] x86: Use qemu-x86_64 to boot EFI installers Date: Mon, 19 Jun 2023 12:59:15 +0100 Message-ID: <20230619120011.1587499-1-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 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 various minor features so that qemu-x86_64 can boot the Ubuntu 2022.04 installer using a virtio device: qemu-system-x86_64 -M pc -drive format=raw,file=root.img -bios /tmp/b/qemu-x86_64/u-boot.rom -drive if=virtio,file=ubuntu-22.04.2-desktop-amd64.iso -smp 4 -m 4G -serial mon:stdio The main changes include: - Enable video in SPL while running in 32-bit mode - Drop the duplicate ACPI tables with EFI - Support PCI autoconfig in SPL - Support FAT on a CDROM filesystem - Improved bootstd rules around device tree and efi_set_bootdev() There are also quite a number of minor tweaks and fixes to make things easier to use. This series is based on an older version of the SPL-video series from Nikhil M Jain. It is available at u-boot-dm/bryc-working Changes in v4: - Bring in dropped mtrr_add_request() request patch - Drop patch "video: Allow building video drivers for SPL" - Drop use of video in SPL - Bring in bochs patch to this series Changes in v3: - Fix invalid commit IDs obtained from another branch - Add a tag name for the blob - Add new patch to refactor table-writing code a ltitle - Adjust the code to handle qemu writing a pointer to tables in memory Changes in v2: - Add new patch with docs for mtrr command - Add docs to board_init_f_r() too - Fix BINS typo - Drop the Ooops string - Drop ** in strings and use log_err() for messages - Use log_warning() for the warning - Handle the case where the tables are in the bloblist - Add new patch to show the number of physical address bits - Add new patch to convert some debug statements to use logging - Add new patch to support Micron memory - Add new patch to make sure that the LPC is active before SDRAM init - Add new patch to support outputing function names in SPL - Drop patch to set high bits of the mtrr base register, for now - Bring in to qemu series - Rebase to -next - Drop unused of_match - Fix Boschs typo - Rename bochs_init_linear_fb() function to drop 'linear' - Fix uninited variable Simon Glass (45): x86: Return mtrr_add_request() to its old purpose x86: Allow listing MTRRs in SPL x86: mtrr: Add documentation bios_emulator: Add Kconfig and adjust Makefile for SPL bios_emulator: Drop VIDEO_IO_OFFSET x86: Tidy up EFI code in interrupt_init() x86: Add a comment for board_init_f_r_trampoline() x86: Show the CPU physical address size with bdinfo x86: Correct get_sp() implementation for 64-bit x86: Show an error when a BIOS exception occurs acpi: Add a comment to set the acpi tables bdinfo: Show the RAM top and approximate stack pointer part: Allow setting the partition-table type qfw: Show the file address if available log: Tidy up an ambiguous comment. qfw: Set the address of the ACPI tables efi: Show all known UUIDs with CONFIG_CMD_EFIDEBUG x86: Improve the trampoline in 64-bit mode Show the malloc base with the bdinfo command nvme: Provide more useful debugging messages pci: Support autoconfig in SPL pci: Allow the video BIOS to work in SPL with QEMU pci: Tidy up logging and reporting for video BIOS x86: Allow video-BIOS code to be built for SPL x86: Pass video settings from SPL to U-Boot proper x86: Init video in SPL if enabled pci: Adjust video BIOS debugging to be SPL-friendly pci: Mask the ROM address in case it is already enabled x86: Enable display for QEMU 64-bit x86: Allow logging to be used in SPL reliably fs: fat: Shrink the size of a few strings fs: fat: Support reading from a larger block size x86: Enable useful options for qemu-86_64 x86: Refactor table-writing code a litlle x86: Record the start and end of the tables x86: Show the number of physical address bits x86: Convert some debug statements to use logging x86: link: Support Micron memory x86: Make sure that the LPC is active before SDRAM init log: Support outputing function names in SPL sandbox: Correct header order in board file sandbox: Install ACPI tables on startup efi: Use the installed ACPI tables x86: video: Add a driver for QEMU bochs emulation x86: Switch QEMU over to use the bochs driver arch/sandbox/include/asm/global_data.h | 4 + arch/x86/cpu/i386/cpu.c | 2 + arch/x86/cpu/i386/interrupt.c | 17 +-- arch/x86/cpu/intel_common/mrc.c | 10 +- arch/x86/cpu/ivybridge/sdram.c | 4 +- arch/x86/cpu/mtrr.c | 67 ++++++++- arch/x86/cpu/qemu/Kconfig | 2 +- arch/x86/cpu/start64.S | 19 +++ arch/x86/dts/chromebook_link.dts | 1 + arch/x86/include/asm/global_data.h | 5 + arch/x86/include/asm/mtrr.h | 20 +++ arch/x86/include/asm/u-boot-x86.h | 27 +++- arch/x86/lib/Makefile | 7 +- arch/x86/lib/bdinfo.c | 6 + arch/x86/lib/bios.c | 4 +- arch/x86/lib/bootm.c | 2 +- arch/x86/lib/mrccache.c | 6 +- arch/x86/lib/spl.c | 63 +++++++-- arch/x86/lib/tables.c | 42 ++++-- board/google/Kconfig | 7 - board/sandbox/sandbox.c | 22 ++- cmd/Kconfig | 8 ++ cmd/acpi.c | 24 +++- cmd/bdinfo.c | 6 + cmd/part.c | 34 +++++ cmd/qfw.c | 2 +- cmd/x86/mtrr.c | 60 +------- common/bloblist.c | 1 + common/board_f.c | 12 +- common/board_r.c | 7 +- common/log.c | 2 +- common/log_console.c | 10 +- configs/qemu-x86_64_defconfig | 16 ++- configs/qemu-x86_defconfig | 3 - disk/part.c | 16 +++ doc/usage/cmd/acpi.rst | 29 +++- doc/usage/cmd/mtrr.rst | 151 ++++++++++++++++++++ doc/usage/cmd/part.rst | 74 ++++++++++ doc/usage/cmd/qfw.rst | 28 ++-- doc/usage/index.rst | 1 + drivers/Kconfig | 2 + drivers/Makefile | 2 +- drivers/bios_emulator/Kconfig | 10 ++ drivers/bios_emulator/biosemui.h | 18 +-- drivers/bios_emulator/x86emu/sys.c | 1 + drivers/gpio/intel_ich6_gpio.c | 5 +- drivers/misc/qfw.c | 12 ++ drivers/nvme/nvme.c | 36 +++-- drivers/pch/pch9.c | 6 +- drivers/pci/Kconfig | 8 ++ drivers/pci/pci-uclass.c | 10 +- drivers/pci/pci_rom.c | 165 +++++++++++++++++----- drivers/video/Kconfig | 30 ++++ drivers/video/Makefile | 1 + drivers/video/bochs.c | 123 ++++++++++++++++ drivers/video/bochs.h | 36 +++++ fs/fat/Kconfig | 13 ++ fs/fat/fat.c | 121 +++++++++++++--- fs/fat/fat_write.c | 22 ++- include/asm-generic/global_data.h | 13 ++ include/bloblist.h | 1 + include/configs/conga-qeval20-qa3-e3845.h | 2 - include/configs/dfi-bt700.h | 2 - include/configs/minnowmax.h | 2 - include/configs/som-db5800-som-6867.h | 2 - include/configs/theadorable-x86-common.h | 2 - include/configs/x86-chromebook.h | 2 - include/part.h | 9 ++ include/pci_ids.h | 1 + include/video.h | 24 ++++ lib/efi_loader/efi_acpi.c | 33 +++-- lib/uuid.c | 2 +- test/dm/acpi.c | 38 +++++ 73 files changed, 1302 insertions(+), 273 deletions(-) create mode 100644 doc/usage/cmd/mtrr.rst create mode 100644 drivers/bios_emulator/Kconfig create mode 100644 drivers/video/bochs.c create mode 100644 drivers/video/bochs.h