Compare commits
6 Commits
cherry-53a
...
secb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ee1c3b067 | ||
|
|
bc6fd0e137 | ||
|
|
c6c8597951 | ||
|
|
4bbd4dcf9a | ||
|
|
af5d7bdf02 | ||
|
|
d46a3706e6 |
@@ -5,9 +5,11 @@
|
||||
* Copyright 2025 Simon Glass <sjg@chromium.org>
|
||||
*/
|
||||
|
||||
#include <acpi/acpi_table.h>
|
||||
#include <bootm.h>
|
||||
#include <bootstage.h>
|
||||
#include <event.h>
|
||||
#include <timer.h>
|
||||
#include <usb.h>
|
||||
#include <dm/root.h>
|
||||
|
||||
@@ -25,6 +27,21 @@ void bootm_final(enum bootm_final_t flags)
|
||||
|
||||
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
|
||||
|
||||
/* Update FPDT boot performance record if it exists */
|
||||
if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE)) {
|
||||
struct acpi_fpdt_boot *fpdt;
|
||||
|
||||
fpdt = acpi_get_fpdt_boot();
|
||||
if (fpdt) {
|
||||
u64 time;
|
||||
|
||||
time = timer_get_boot_us();
|
||||
fpdt->ebs_entry = time;
|
||||
fpdt->ebs_exit = time;
|
||||
acpi_fix_fpdt_checksum();
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BOOTSTAGE_FDT) && IS_ENABLED(CONFIG_CMD_FDT))
|
||||
bootstage_fdt_add_report();
|
||||
if (IS_ENABLED(CONFIG_BOOTSTAGE_REPORT))
|
||||
|
||||
@@ -785,3 +785,14 @@ int acpi_fix_fpdt_checksum(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_create_fpdt(struct acpi_ctx *ctx,
|
||||
const struct acpi_writer *entry)
|
||||
{
|
||||
u64 uboot_start;
|
||||
|
||||
uboot_start = bootstage_get_time(BOOTSTAGE_ID_START_UBOOT_F);
|
||||
|
||||
return acpi_write_fpdt(ctx, uboot_start);
|
||||
}
|
||||
ACPI_WRITER(6fpdt, "FPDT", acpi_create_fpdt, 0);
|
||||
|
||||
@@ -19,6 +19,7 @@ from argparse import ArgumentParser
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
import build_helper
|
||||
|
||||
@@ -47,6 +48,10 @@ def parse_args():
|
||||
help='Package up the payload instead of the app')
|
||||
parser.add_argument('-P', '--partition', action='store_true',
|
||||
help='Create a partition table')
|
||||
parser.add_argument('-c', '--spice', action='store_true',
|
||||
help='Enable SPICE for clipboard sharing')
|
||||
parser.add_argument('-N', '--net', action='store_true',
|
||||
help='Enable networking (with SSH forwarding on port 2222)')
|
||||
parser.add_argument('-v', '--verbose', action='store_true',
|
||||
help='Show executed commands')
|
||||
|
||||
@@ -115,6 +120,12 @@ class BuildEfi:
|
||||
else: # x86
|
||||
extra += ['-device', 'qemu-xhci', '-device', 'usb-kbd',
|
||||
'-device', 'usb-mouse']
|
||||
|
||||
# This uses QEMU's GTK clipboard integration with SPICE vdagent
|
||||
if self.args.spice:
|
||||
extra += ['-device', 'virtio-serial-pci']
|
||||
extra += ['-chardev', 'qemu-vdagent,id=spicechannel0,name=vdagent,clipboard=on']
|
||||
extra += ['-device', 'virtserialport,chardev=spicechannel0,name=com.redhat.spice.0']
|
||||
extra += ['-serial', 'mon:stdio']
|
||||
serial_msg = ''
|
||||
if self.args.kvm:
|
||||
@@ -134,10 +145,15 @@ class BuildEfi:
|
||||
|
||||
cmd = [qemu]
|
||||
cmd += '-m', mem
|
||||
cmd += '-nic', 'none'
|
||||
if self.args.net:
|
||||
cmd += '-netdev', 'user,id=net0,hostfwd=tcp::2222-:22'
|
||||
cmd += '-device', 'virtio-net-pci,netdev=net0'
|
||||
else:
|
||||
cmd += '-nic', 'none'
|
||||
cmd += extra
|
||||
self.helper.add_qemu_args(self.args, cmd, base_hd=1)
|
||||
tout.info(' '.join(cmd))
|
||||
sys.stdout.flush()
|
||||
command.run(*cmd)
|
||||
|
||||
def setup_files(self, build, build_type, dst):
|
||||
|
||||
@@ -51,6 +51,8 @@ def parse_args():
|
||||
help='Run qboot instead of U-Boot')
|
||||
parser.add_argument('-x', '--xpl', action='store_true',
|
||||
help='Use xPL image rather than U-Boot proper')
|
||||
parser.add_argument('-T', '--tkey', action='store_true',
|
||||
help='Enable TKey USB passthrough for testing')
|
||||
parser.add_argument(
|
||||
'--sct-seq',
|
||||
help='SCT sequence-file to be written into the SCT image if -e')
|
||||
@@ -153,6 +155,9 @@ class BuildQemu:
|
||||
default_bios = 'u-boot.rom'
|
||||
self.helper.qemu = 'qemu-system-i386'
|
||||
self.qemu_extra.extend(['-machine', 'q35'])
|
||||
if args.tkey:
|
||||
# Pass through TKey USB device to QEMU
|
||||
self.qemu_extra.extend(['-device', 'usb-host,vendorid=0x1207,productid=0x8887'])
|
||||
if self.helper.bitness == 64:
|
||||
self.board = 'qemu-x86_64'
|
||||
self.helper.qemu = 'qemu-system-x86_64'
|
||||
|
||||
Reference in New Issue
Block a user