imply SYS_NS16550
imply USB
imply USB_EHCI_HCD
- imply VIDEO_BOCHS
+ imply VIDEO_VESA
if QEMU
#include <asm/global_data.h>
#include <asm/post.h>
#include <asm/arch/qemu.h>
+#include <linux/sizes.h>
DECLARE_GLOBAL_DATA_PTR;
#include <asm/e820.h>
#include <asm/arch/qemu.h>
#include <asm/global_data.h>
+#include <linux/sizes.h>
DECLARE_GLOBAL_DATA_PTR;
pci_write_config32(ICH9_PM, PMBA, CONFIG_ACPI_PM1_BASE | 1);
}
-static void qemu_chipset_init(void)
+void qemu_chipset_init(void)
{
u16 device, xbcs;
int pam, i;
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Generic QEMU header
+ *
+ * Copyright 2023 Google LLC
+ */
+
+#ifndef __QEMU_H
+#define __QEMU_H
+
+/* set up the chipset for QEMU so that video can be used */
+void qemu_chipset_init(void);
+
+#endif
realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode,
0x0000, buffer_seg, buffer_adr);
- memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_state));
+ memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_mode_info));
mi->valid = true;
return 0;
#include <common.h>
#include <asm/io.h>
#include <asm/i8254.h>
+#include <asm/ibmpc.h>
#define TIMER1_VALUE 18 /* 15.6us */
#define BEEP_FREQUENCY_HZ 440
#include <asm/cpu.h>
#include <asm/global_data.h>
#include <linux/compiler.h>
+#include <linux/sizes.h>
DECLARE_GLOBAL_DATA_PTR;
/* Make sure the window is below U-Boot. */
assert(window + LARGE_PAGE_SIZE <
- gd->relocaddr - CONFIG_SYS_MALLOC_LEN - CFG_SYS_STACK_SIZE);
+ gd->relocaddr - CONFIG_SYS_MALLOC_LEN - SZ_32K);
/* Map the page into the window and then memset the appropriate part. */
x86_phys_map_page(window, map_addr, 1);
memset((void *)(window + offset), c, size);
#include <asm/mtrr.h>
#include <asm/pci.h>
#include <asm/processor.h>
+#include <asm/qemu.h>
#include <asm/spl.h>
#include <asm-generic/sections.h>
}
#ifndef CONFIG_SYS_COREBOOT
- log_debug("bss\n");
debug("BSS clear from %lx to %lx len %lx\n", (ulong)&__bss_start,
(ulong)&__bss_end, (ulong)&__bss_end - (ulong)&__bss_start);
memset(&__bss_start, 0, (ulong)&__bss_end - (ulong)&__bss_start);
#ifndef CONFIG_TPL
preloader_console_init();
#endif
+ if (IS_ENABLED(CONFIG_QEMU))
+ qemu_chipset_init();
if (CONFIG_IS_ENABLED(VIDEO)) {
struct udevice *dev;
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
+
+splashsource=virtio_fs
+splashimage=0x1000000
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2015 Google, Inc
+ */
+
+#include <env/x86.env>
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
+
+/* don't use i8042-kbd */
+stdin=serial,usbkbd
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
+
+/* don't use i8042-kbd */
+stdin=serial,usbkbd
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2017 Intel Corp.
+ */
+
+/* empty environment */
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
+
+/* use just serial */
+stdin=serial
+stdout=serial
+stderr=serial
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015 Google, Inc
+ */
+
+#include <env/x86.env>
+
+/* don't use i8042-kbd */
+stdin=usbkbd,serial
+
+usb_pgood_delay=40
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include <env/x86.env>
+
+/* don't use video */
+stdout=serial
+stderr=serial
+
+usb_pgood_delay=40
+
+ramdiskaddr=0x4000000
+ramdiskfile=initrd
+bootdev=usb
+bootdevnum=0
+bootdevpart=0
+bootfsload=fatload
+bootusb=setenv bootdev usb; boot
+bootscsi=setenv bootdev scsi; boot
+bootmmc=setenv bootdev mmc; boot
+bootargs=console=ttyS0,115200 console=tty0
uimage=uImage
#endif
-#include <environment/pg-wcom/common.env>
-#include <environment/pg-wcom/powerpc.env>
+#include <env/pg-wcom/common.env>
+#include <env/pg-wcom/powerpc.env>
#if CONFIG_TARGET_KMCOGE5NE
add_default+= eccmode=bch
-#include <environment/pg-wcom/common.env>
+#include <env/pg-wcom/common.env>
EEprom_ivm=pca9547:70:9
arch=ppc_82xx
-#include <environment/pg-wcom/ls102xa.env>
+#include <env/pg-wcom/ls102xa.env>
hostname=EXPU1
-#include <environment/pg-wcom/ls102xa.env>
+#include <env/pg-wcom/ls102xa.env>
hostname=SELI8
* Jan Kiszka <jan.kiszka@siemens.com>
*/
-#include <environment/ti/ti_armv7_common.env>
+#include <env/ti/ti_armv7_common.env>
usb_pgood_delay=900
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/mmc.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/mmc.env>
default_device_tree=ti/k3-am62a7-sk.dtb
findfdt=
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/mmc.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/mmc.env>
default_device_tree=ti/k3-am625-sk.dtb
findfdt=
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/mmc.env>
-#include <environment/ti/k3_dfu.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/mmc.env>
+#include <env/ti/k3_dfu.env>
findfdt=
if test $board_name = am64x_gpevm; then
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/mmc.env>
-#include <environment/ti/k3_dfu.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/mmc.env>
+#include <env/ti/k3_dfu.env>
#if CONFIG_CMD_REMOTEPROC
-#include <environment/ti/k3_rproc.env>
+#include <env/ti/k3_rproc.env>
#endif
findfdt=
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/mmc.env>
-#include <environment/ti/ufs.env>
-#include <environment/ti/k3_dfu.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/mmc.env>
+#include <env/ti/ufs.env>
+#include <env/ti/k3_dfu.env>
#if CONFIG_CMD_REMOTEPROC
-#include <environment/ti/k3_rproc.env>
+#include <env/ti/k3_rproc.env>
#endif
default_device_tree=ti/k3-j721e-common-proc-board.dtb
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/mmc.env>
-#include <environment/ti/ufs.env>
-#include <environment/ti/k3_dfu.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/mmc.env>
+#include <env/ti/ufs.env>
+#include <env/ti/k3_dfu.env>
#if CONFIG_CMD_REMOTEPROC
-#include <environment/ti/k3_rproc.env>
+#include <env/ti/k3_rproc.env>
#endif
default_device_tree=ti/k3-j721s2-common-proc-board.dtb
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/ti_armv7_keystone2.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/ti_armv7_keystone2.env>
findfdt=setenv fdtfile ${name_fdt}
boot=ubi
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/ti_armv7_keystone2.env>
-#include <environment/ti/mmc.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/ti_armv7_keystone2.env>
+#include <env/ti/mmc.env>
set_name_pmmc=setenv name_pmmc ti-sci-firmware-k2g.bin
dev_pmmc=0
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/ti_armv7_keystone2.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/ti_armv7_keystone2.env>
findfdt=setenv fdtfile ${name_fdt}
boot=ubi
-#include <environment/ti/ti_armv7_common.env>
-#include <environment/ti/ti_armv7_keystone2.env>
+#include <env/ti/ti_armv7_common.env>
+#include <env/ti/ti_armv7_keystone2.env>
findfdt=setenv fdtfile ${name_fdt}
boot=ubi
return len;
}
-int bootdev_setup_sibling_blk(struct udevice *blk, const char *drv_name)
+int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name)
{
struct udevice *parent, *dev;
char dev_name[50];
if (device_get_uclass_id(dev) != UCLASS_BOOTDEV)
return -EINVAL;
- /* This should always work if bootdev_setup_sibling_blk() was used */
+ /*
+ * This should always work if bootdev_setup_for_sibling_blk() was used
+ */
len = bootdev_get_suffix_start(dev, ".bootdev");
ret = device_find_child_by_namelen(parent, dev->name, len, &blk);
if (ret) {
if (device_get_uclass_id(blk) != UCLASS_BLK)
return -EINVAL;
- /* This should always work if bootdev_setup_sibling_blk() was used */
+ /* This should always work if bootdev_setup_for_sibling_blk() was used */
len = bootdev_get_suffix_start(blk, ".blk");
snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name,
"bootdev");
int ret;
ret = bootdev_get_sibling_blk(dev, &blk);
+ log_debug("sibling_blk ret=%d, blk=%s\n", ret,
+ ret ? "(none)" : blk->name);
/*
* If there is no media, indicate that no more partitions should be
* checked
ret = bootdev_hunt_prio(iter->cur_prio,
iter->flags &
BOOTFLOWIF_SHOW);
- log_debug("- hunt ret %d\n", ret);
+ log_debug("- bootdev_hunt_prio() ret %d\n",
+ ret);
if (ret)
return log_msg_ret("hun", ret);
}
/* hunt for any pre-scan devices */
if (iter->flags & BOOTFLOWIF_HUNT) {
ret = bootdev_hunt_prio(BOOTDEVP_1_PRE_SCAN, show);
+ log_debug("- bootdev_hunt_prio() ret %d\n", ret);
if (ret)
return log_msg_ret("pre", ret);
}
log_debug("Hunting with: %s\n", name);
if (info->hunt) {
ret = info->hunt(info, show);
+ log_debug(" - hunt result %d\n", ret);
if (ret)
return ret;
}
if (prio != info->prio)
continue;
ret = bootdev_hunt_drv(info, i, show);
+ log_debug("bootdev_hunt_drv() return %d\n", ret);
if (ret && ret != -ENOENT)
result = ret;
}
+ log_debug("exit %d\n", result);
return result;
}
static int reserve_video(void)
{
- if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
- CONFIG_IS_ENABLED(BLOBLIST)) {
+ if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) {
struct video_handoff *ho;
ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
if (ret)
return ret;
- ret = bootdev_setup_sibling_blk(dev, "usb_bootdev");
+ ret = bootdev_setup_for_sibling_blk(dev, "usb_bootdev");
if (ret) {
int ret2;
CONFIG_SYS_NS16550_PORT_MAPPED=y
CONFIG_SPI=y
CONFIG_USB_KEYBOARD=y
+CONFIG_SPL_VIDEO=y
+CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
+CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
+CONFIG_FRAMEBUFFER_VESA_MODE=0x144
CONFIG_CONSOLE_SCROLL_LINES=5
# CONFIG_SPL_USE_TINY_PRINTF is not set
CONFIG_GENERATE_ACPI_TABLE=y
CONFIG_ENV_SIZE=0x40000
CONFIG_MAX_CPUS=2
CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx"
+CONFIG_DEBUG_UART_BASE=0x3f8
+CONFIG_DEBUG_UART_CLOCK=1843200
+CONFIG_DEBUG_UART=y
CONFIG_SMP=y
CONFIG_GENERATE_PIRQ_TABLE=y
CONFIG_GENERATE_MP_TABLE=y
CONFIG_FIT=y
+CONFIG_BOOTSTD_FULL=y
CONFIG_BOOTSTD_DEFAULTS=y
CONFIG_BOOTSTAGE=y
CONFIG_BOOTSTAGE_REPORT=y
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_LOG=y
+CONFIG_LOGF_FUNC=y
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_LAST_STAGE_INIT=y
CONFIG_PCI_INIT_R=y
CONFIG_CMD_CPU=y
CONFIG_CMD_BOOTEFI_SELFTEST=y
CONFIG_CMD_NVEDIT_EFI=y
+CONFIG_CMD_MEM_SEARCH=y
CONFIG_CMD_IDE=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_BOOTP_BOOTFILESIZE=y
+CONFIG_CMD_EFIDEBUG=y
CONFIG_CMD_TIME=y
CONFIG_CMD_QFW=y
CONFIG_CMD_BOOTSTAGE=y
CONFIG_SYS_NS16550_PORT_MAPPED=y
CONFIG_SPI=y
CONFIG_USB_KEYBOARD=y
+CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
+CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
+CONFIG_FRAMEBUFFER_VESA_MODE=0x144
CONFIG_CONSOLE_SCROLL_LINES=5
CONFIG_GENERATE_ACPI_TABLE=y
# CONFIG_GZIP is not set
This has only been lightly tested.
+CBFS access
+-----------
+
+You can use the 'cbfs' commands to access the Coreboot filesystem::
+
+ => cbfsinit
+ => cbfsinfo
+
+ CBFS version: 0x31313132
+ ROM size: 0x100000
+ Boot block size: 0x4
+ CBFS size: 0xffdfc
+ Alignment: 64
+ Offset: 0x200
+
+ => cbfsls
+ size type name
+ ------------------------------------------
+ 32 cbfs header cbfs master header
+ 16720 17 fallback/romstage
+ 53052 17 fallback/ramstage
+ 398 raw config
+ 715 raw revision
+ 117 raw build_info
+ 4044 raw fallback/dsdt.aml
+ 640 cmos layout cmos_layout.bin
+ 17804 17 fallback/postcar
+ 335797 payload fallback/payload
+ 607000 null (empty)
+ 10752 bootblock bootblock
+
+ 12 file(s)
+
+ =>
Memory map
----------
'-cpu pentium' won't work for obvious reasons that the processor only
supports 32-bit.
-Note 64-bit support is very preliminary at this point. Lots of features
-are missing in the 64-bit world. One notable feature is the VGA console
-support which is currently missing, so that you must specify '-nographic'
-to get 64-bit U-Boot up and running.
+Booting distros
+---------------
+
+It is possible to install and boot a standard Linux distribution using
+qemu-x86_64 by setting up a root disk::
+
+ qemu-img create root.img 10G
+
+then using the installer to install. For example, with Ubuntu 2023.04::
+
+ qemu-system-x86_64 -m 8G -smp 4 -bios /tmp/b/qemu-x86_64/u-boot.rom \
+ -drive file=root.img,if=virtio,driver=raw \
+ -drive file=ubuntu-23.04-desktop-amd64.iso,if=virtio,driver=raw
+
+You can also add `-serial mon:stdio` if you want the serial console to show as
+well as the video.
+
+The output will be something like this::
+
+ U-Boot SPL 2023.07 (Jul 23 2023 - 08:00:12 -0600)
+ Trying to boot from SPI
+ Jumping to 64-bit U-Boot: Note many features are missing
+
+
+ U-Boot 2023.07 (Jul 23 2023 - 08:00:12 -0600)
+
+ CPU: QEMU Virtual CPU version 2.5+
+ DRAM: 8 GiB
+ Core: 20 devices, 13 uclasses, devicetree: separate
+ Loading Environment from nowhere... OK
+ Model: QEMU x86 (I440FX)
+ Net: e1000: 52:54:00:12:34:56
+ eth0: e1000#0
+ Hit any key to stop autoboot: 0
+ Scanning for bootflows in all bootdevs
+ Seq Method State Uclass Part Name Filename
+ --- ----------- ------ -------- ---- ------------------------ ----------------
+ Scanning global bootmeth 'efi_mgr':
+ Hunting with: nvme
+ Hunting with: qfw
+ Hunting with: scsi
+ scanning bus for devices...
+ Hunting with: virtio
+ Scanning bootdev 'qfw_pio.bootdev':
+ fatal: no kernel available
+ Scanning bootdev 'virtio-blk#0.bootdev':
+ Scanning bootdev 'virtio-blk#1.bootdev':
+ 0 efi ready virtio 2 virtio-blk#1.bootdev.part efi/boot/bootx64.efi
+ ** Booting bootflow 'virtio-blk#1.bootdev.part_2' with efi
+ EFI using ACPI tables at f0060
+ efi_install_fdt() WARNING: Can't have ACPI table and device tree - ignoring DT.
+ efi_run_image() Booting /efi\boot\bootx64.efi
+ error: file `/boot/' not found.
+
+Standard boot looks through various available devices and finds the virtio
+disks, then boots from the first one. After a second or so the grub menu appears
+and you can work through the installer flow normally.
+
+Note that standard boot will not find 32-bit distros, since it looks for a
+different filename.
+
+Current limitations
+-------------------
+
+Only qemu-x86-64 can be used for booting distros, since qemu-x86 (the 32-bit
+version of U-Boot) seems to have an EFI bug leading to the boot handing after
+Linux is selected from grub, e.g. with `debian-12.1.0-i386-netinst.iso`::
+
+ ** Booting bootflow 'virtio-blk#1.bootdev.part_2' with efi
+ EFI using ACPI tables at f0180
+ efi_install_fdt() WARNING: Can't have ACPI table and device tree - ignoring DT.
+ efi_run_image() Booting /efi\boot\bootia32.efi
+ Failed to open efi\boot\root=/dev/sdb3 - Not Found
+ Failed to load image 큀緃: Not Found
+ start_image() returned Not Found, falling back to default loader
+ Welcome to GRUB!
+
+The bochs video driver also seems to cause problems before the OS is able to
+show a display.
+
+Finally, the use of `-M accel=kvm` is intended to use the native CPU's
+virtual-machine features to accelerate operation, but this causes U-Boot to hang
+when jumping 64-bit mode, at least on AMD machines. This may be a bug in U-Boot
+or something else.
The bootdev device is typically created automatically in the media uclass'
`post_bind()` method by calling `bootdev_setup_for_dev()` or
-`bootdev_setup_sibling_blk()`. The code typically something like this::
+`bootdev_setup_for_sibling_blk()`. The code typically something like this::
/* dev is the Ethernet device */
ret = bootdev_setup_for_dev(dev, "eth_bootdev");
or::
/* blk is the block device (child of MMC device)
- ret = bootdev_setup_sibling_blk(blk, "mmc_bootdev");
+ ret = bootdev_setup_for_sibling_blk(blk, "mmc_bootdev");
if (ret)
return log_msg_ret("bootdev", ret);
echo CONFIG_SYS_BOARD boot failed - please check your image
echo Load address is CONFIG_SYS_LOAD_ADDR
+Settings which are common to a group of boards can use #include to bring in
+a common file in the `include/env` directory, containing environment
+settings. For example::
+
+ #include <env/ti/mmc.env>
+
If CONFIG_ENV_SOURCE_FILE is empty and the default filename is not present, then
the old-style C environment is used instead. See below.
Board maintainers are encouraged to migrate to the text-based environment as it
is easier to maintain. The distro-board script still requires the old-style
-environment but work is underway to address this.
+environments, so use :doc:`../develop/bootstd` instead.
List of environment variables
obj-$(CONFIG_$(SPL_)NVME) += nvme/
obj-$(CONFIG_XEN) += xen/
obj-$(CONFIG_$(SPL_)FPGA) += fpga/
+obj-$(CONFIG_$(SPL_)VIDEO) += video/
+
obj-y += bus/
ifndef CONFIG_TPL_BUILD
obj-$(CONFIG_SPL_SATA) += ata/ scsi/
obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
obj-$(CONFIG_SPL_THERMAL) += thermal/
-obj-$(CONFIG_SPL_VIDEO) +=video/
endif
endif
obj-y += scsi/
obj-y += sound/
obj-y += spmi/
-obj-y += video/
obj-y += watchdog/
obj-$(CONFIG_QE) += qe/
obj-$(CONFIG_U_QE) += qe/
desc->lba48 = pdesc.lba48;
desc->type = pdesc.type;
- ret = bootdev_setup_for_dev(udev, "ide_bootdev");
+ ret = bootdev_setup_for_sibling_blk(blk, "ide_bootdev");
if (ret)
- return log_msg_ret("bootdev", ret);
+ return log_msg_ret("bd", ret);
}
return 0;
mmc->cfg = cfg;
mmc->priv = dev;
- ret = bootdev_setup_sibling_blk(bdev, "mmc_bootdev");
+ ret = bootdev_setup_for_sibling_blk(bdev, "mmc_bootdev");
if (ret)
return log_msg_ret("bootdev", ret);
if (ret)
goto free_id;
- ret = bootdev_setup_sibling_blk(ns_udev, "nvme_bootdev");
+ ret = bootdev_setup_for_sibling_blk(ns_udev, "nvme_bootdev");
if (ret)
return log_msg_ret("bootdev", ret);
/* TODO: undo create */
return log_msg_ret("pro", ret);
- ret = bootdev_setup_sibling_blk(bdev, "scsi_bootdev");
+ ret = bootdev_setup_for_sibling_blk(bdev, "scsi_bootdev");
if (ret)
return log_msg_ret("bd", ret);
if (controllers_initialized == 0)
printf("No working controllers found\n");
- return usb_started ? 0 : -1;
+ return usb_started ? 0 : -ENOENT;
}
int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp)
if SPL_VIDEO
source "drivers/video/tidss/Kconfig"
+config SPL_VIDEO_HANDOFF
+ bool "Pass the video frame-buffer through to U-Boot proper"
+ depends on SPL_BLOBLIST
+ default y if !X86
+ help
+ Enable this to set up video-handoff information in SPL which can be
+ picked up in U-Boot proper. This includes the frame buffer and
+ various other pieces of information. With this enabled, SPL can set
+ up video and avoid re-initing it later.
+
config SPL_VIDEO_LOGO
bool "Show the U-Boot logo on the display at SPL"
default y if !SPL_SPLASH_SCREEN
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
gd->video_top);
- if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+ if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(VIDEO_HANDOFF)) {
struct video_handoff *ho;
ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
device_set_name_alloced(vdev);
if (uc_priv->device == VIRTIO_ID_BLOCK && !IS_ENABLED(CONFIG_SANDBOX)) {
- ret = bootdev_setup_sibling_blk(vdev, "virtio_bootdev");
+ ret = bootdev_setup_for_sibling_blk(vdev, "virtio_bootdev");
if (ret)
return log_msg_ret("bootdev", ret);
}
/**
* bootdev_setup_for_dev() - Bind a new bootdev device (deprecated)
*
- * Please use bootdev_setup_sibling_blk() instead since it supports multiple
+ * Please use bootdev_setup_for_sibling_blk() instead since it supports multiple
* (child) block devices for each media device.
*
* Creates a bootdev device as a child of @parent. This should be called from
int bootdev_setup_for_dev(struct udevice *parent, const char *drv_name);
/**
- * bootdev_setup_for_blk() - Bind a new bootdev device for a blk device
+ * bootdev_setup_for_sibling_blk() - Bind a new bootdev device for a blk device
*
* Creates a bootdev device as a sibling of @blk. This should be called from
* the driver's bind() method or its uclass' post_bind() method, at the same
* @drv_name: Name of bootdev driver to bind
* Return: 0 if OK, -ve on error
*/
-int bootdev_setup_sibling_blk(struct udevice *blk, const char *drv_name);
+int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name);
/**
* bootdev_get_sibling_blk() - Locate the block device for a bootdev
return 0;
}
-static inline int bootdev_setup_sibling_blk(struct udevice *blk,
- const char *drv_name)
+static inline int bootdev_setup_for_sibling_blk(struct udevice *blk,
+ const char *drv_name)
{
return 0;
}
#include <config_distro_bootcmd.h>
#ifndef CONFIG_SPL_BUILD
-#include <environment/ti/dfu.h>
+#include <env/ti/dfu.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
#include <config_distro_bootcmd.h>
#ifndef CONFIG_SPL_BUILD
-#include <environment/ti/dfu.h>
+#include <env/ti/dfu.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
#ifndef __CONFIG_AM57XX_EVM_H
#define __CONFIG_AM57XX_EVM_H
-#include <environment/ti/dfu.h>
+#include <env/ti/dfu.h>
#include <linux/sizes.h>
#define CFG_SYS_NS16550_COM1 UART1_BASE /* Base EVM has UART0 */
#define __CONFIG_AM62AX_EVM_H
#include <linux/sizes.h>
-#include <environment/ti/mmc.h>
-#include <environment/ti/k3_dfu.h>
+#include <env/ti/mmc.h>
+#include <env/ti/k3_dfu.h>
/* DDR Configuration */
#define CFG_SYS_SDRAM_BASE1 0x880000000
#define __CONFIG_AM625_EVM_H
#include <config_distro_bootcmd.h>
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
/* DDR Configuration */
#define CFG_SYS_SDRAM_BASE1 0x880000000
#include <linux/sizes.h>
#include <config_distro_bootcmd.h>
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
#include <asm/arch/am64_hardware.h>
-#include <environment/ti/k3_dfu.h>
+#include <env/ti/k3_dfu.h>
/* DDR Configuration */
#define CFG_SYS_SDRAM_BASE1 0x880000000
#define __CONFIG_AM654_EVM_H
#include <linux/sizes.h>
-#include <environment/ti/mmc.h>
-#include <environment/ti/k3_rproc.h>
-#include <environment/ti/k3_dfu.h>
+#include <env/ti/mmc.h>
+#include <env/ti/k3_rproc.h>
+#include <env/ti/k3_dfu.h>
/* DDR Configuration */
#define CFG_SYS_SDRAM_BASE1 0x880000000
/*
* Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial,usbkbd\0" \
- "stdout=serial,vidconsole\0" \
- "stderr=serial,vidconsole\0"
-
-/* Environment configuration */
-
-#endif /* __CONFIG_H */
/*
* Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
*/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=usbkbd,serial\0" \
- "stdout=vidconsole,serial\0" \
- "stderr=vidconsole,serial\0"
-
-/* Environment configuration */
-
-#endif /* __CONFIG_H */
/*
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define SPLASH_SETTINGS "splashsource=virtio_fs\0" \
- "splashimage=0x1000000\0"
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd,usbkbd\0" \
- "stdout=serial,vidconsole\0" \
- "stderr=serial,vidconsole\0"
-
-/* ATA/IDE support */
-
-#endif /* __CONFIG_H */
/*
* Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
*/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd,usbkbd\0" \
- "stdout=serial,vga\0" \
- "stderr=serial,vga\0"
-
-/* Environment configuration */
-
-#endif /* __CONFIG_H */
/*
* Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd,usbkbd\0" \
- "stdout=serial,vidconsole\0" \
- "stderr=serial,vidconsole\0"
-
-/* Environment configuration */
-
-#endif /* __CONFIG_H */
"fdtaddr=0xc0600000\0" \
"scriptaddr=0xc0600000\0"
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
#ifndef __CONFIG_DRA7XX_EVM_H
#define __CONFIG_DRA7XX_EVM_H
-#include <environment/ti/dfu.h>
+#include <env/ti/dfu.h>
#define CFG_MAX_MEM_MAPPED 0x80000000
/*
* Copyright (c) 2017 Intel Corp.
*/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <asm/ibmpc.h>
-
-/* Miscellaneous configurable options */
-
-#define CFG_SYS_STACK_SIZE (32 * 1024)
-
-#endif
/*
* Copyright (c) 2015 Google, Inc
*/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial\0" \
- "stdout=vidconsole\0" \
- "stderr=vidconsole\0"
-
-#endif
/*
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd,usbkbd\0" \
- "stdout=serial,vidconsole\0" \
- "stderr=serial,vidconsole\0"
-
-/* ATA/IDE support */
-
-#endif /* __CONFIG_H */
/*
* Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-/* ns16550 UART is memory-mapped in Quark SoC */
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial\0" \
- "stdout=serial\0" \
- "stderr=serial\0"
-
-/* Environment configuration */
-
-#endif /* __CONFIG_H */
/*
* Copyright (C) 2015 Google, Inc
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=usbkbd,serial\0" \
- "stdout=vidconsole,serial\0" \
- "stderr=vidconsole,serial\0" \
- "usb_pgood_delay=40\0"
-
-#endif /* __CONFIG_H */
#include <config_distro_bootcmd.h>
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
"fdtaddr=0xc0600000\0" \
"scriptaddr=0xc0600000\0"
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
func(NAND, nand, 0)
#include <config_distro_bootcmd.h>
-#include <environment/ti/dfu.h>
-#include <environment/ti/mmc.h>
+#include <env/ti/dfu.h>
+#include <env/ti/mmc.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_MMC_TI_ARGS \
/*
* Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
*/
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <linux/sizes.h>
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd\0" \
- "stdout=serial,vidconsole\0" \
- "stderr=serial,vidconsole\0"
-
-/*
- * ATA/SATA support for QEMU x86 targets
- * - Only legacy IDE controller is supported for QEMU '-M pc' target
- * - AHCI controller is supported for QEMU '-M q35' target
- */
-
-#endif /* __CONFIG_H */
func(DHCP, dhcp, na)
#include <config_distro_bootcmd.h>
-#include <environment/distro/sf.h>
+#include <env/distro/sf.h>
#define TYPE_GUID_LOADER1 "5B193300-FC78-40CD-8002-E86C45580B47"
#define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985"
/*
* Copyright (C) 2019 Intel Corporation <www.intel.com>
*/
-
-#ifndef __SLIMBOOTLOADER_CONFIG_H__
-#define __SLIMBOOTLOADER_CONFIG_H__
-
-#include <configs/x86-common.h>
-
-#define CFG_STD_DEVICES_SETTINGS \
- "stdin=serial,i8042-kbd,usbkbd\0" \
- "stdout=serial\0" \
- "stderr=serial\0"
-
-/*
- * Override CFG_EXTRA_ENV_SETTINGS in x86-common.h
- */
-#undef CFG_EXTRA_ENV_SETTINGS
-#define CFG_EXTRA_ENV_SETTINGS \
- CFG_STD_DEVICES_SETTINGS \
- "netdev=eth0\0" \
- "consoledev=ttyS0\0" \
- "ramdiskaddr=0x4000000\0" \
- "ramdiskfile=initrd\0" \
- "bootdev=usb\0" \
- "bootdevnum=0\0" \
- "bootdevpart=0\0" \
- "bootfsload=fatload\0" \
- "bootusb=setenv bootdev usb; boot\0" \
- "bootscsi=setenv bootdev scsi; boot\0" \
- "bootmmc=setenv bootdev mmc; boot\0" \
- "bootargs=console=ttyS0,115200 console=tty0\0"
-
-/*
- * Override CONFIG_BOOTCOMMAND in x86-common.h
- */
-
-#endif /* __SLIMBOOTLOADER_CONFIG_H__ */
func(DHCP, dhcp, na)
#include <config_distro_bootcmd.h>
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
#define DFUARGS
#endif
-#include <environment/ti/mmc.h>
-#include <environment/ti/nand.h>
+#include <env/ti/mmc.h>
+#include <env/ti/nand.h>
#ifndef CONSOLEDEV
#define CONSOLEDEV "ttyS2"
* Graeme Russ, graeme.russ@gmail.com.
*/
-#include <asm/ibmpc.h>
-
#ifndef __CONFIG_X86_COMMON_H
#define __CONFIG_X86_COMMON_H
/*-----------------------------------------------------------------------
- * CPU Features
- */
-
-#define CFG_SYS_STACK_SIZE (32 * 1024)
-
-/*-----------------------------------------------------------------------
- * Environment configuration
- */
-
-/*-----------------------------------------------------------------------
* USB configuration
*/
#define CFG_OTHBOOTARGS "othbootargs=acpi=off\0"
#endif
-#if defined(CONFIG_DISTRO_DEFAULTS)
-#define DISTRO_BOOTENV BOOTENV
-#else
-#define DISTRO_BOOTENV
-#endif
-
#ifndef SPLASH_SETTINGS
#define SPLASH_SETTINGS
#endif
#define CFG_EXTRA_ENV_SETTINGS \
- DISTRO_BOOTENV \
CFG_STD_DEVICES_SETTINGS \
SPLASH_SETTINGS \
"pciconfighost=1\0" \
#define WCOM_UBI_PARTITION_APP
-#include <environment/pg-wcom/common.env>
+#include <env/pg-wcom/common.env>
EEprom_ivm=pca9547:70:9
boot=bootm $load_addr_r - $fdt_addr_r
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2008
+ * Graeme Russ, graeme.russ@gmail.com
+ */
+
+pciconfighost=1
+netdev=eth0
+consoledev=ttyS0
+scriptaddr=0x7000000
+kernel_addr_r=0x1000000
+ramdisk_addr_r=0x4000000
+ramdiskfile=initramfs.gz
+
+/* common console settings */
+stdin=serial,i8042-kbd,usbkbd
+stdout=serial,vidconsole
+stderr=serial,vidconsole
#endif
/* routines */
-int usb_init(void); /* initialize the USB Controller */
+
+/*
+ * usb_init() - initialize the USB Controllers
+ *
+ * Returns: 0 if OK, -ENOENT if there are no USB devices
+ */
+int usb_init(void);
+
int usb_stop(void); /* stop the USB Controller */
int usb_detect_change(void); /* detect if a USB device has been (un)plugged */
break;
case 'd':
- if (fmt[1] == 'E')
+ if (fmt[1] == 'E') {
flags |= ERRSTR;
+ fmt++;
+ }
/* fallthrough */
case 'i':
flags |= SIGN;
ADDCH(str, ' ');
for (p = errno_str(num); *p; p++)
ADDCH(str, *p);
- fmt++;
}
}