Merge tag 'x86-pull-20230809' of https://source.denx.de/u-boot/custodians/u-boot-x86
authorTom Rini <trini@konsulko.com>
Wed, 9 Aug 2023 17:17:34 +0000 (13:17 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 9 Aug 2023 17:17:34 +0000 (13:17 -0400)
- x86: Fixes for distro booting
- x86: Move some boards to text environment

103 files changed:
arch/x86/cpu/qemu/Kconfig
arch/x86/cpu/qemu/dram.c
arch/x86/cpu/qemu/e820.c
arch/x86/cpu/qemu/qemu.c
arch/x86/include/asm/qemu.h [new file with mode: 0644]
arch/x86/lib/bios.c
arch/x86/lib/i8254.c
arch/x86/lib/physmem.c
arch/x86/lib/spl.c
board/coreboot/coreboot/coreboot.env [new file with mode: 0644]
board/efi/efi-x86_app/efi-x86_app.env [new file with mode: 0644]
board/efi/efi-x86_payload/efi-x86_payload.env [new file with mode: 0644]
board/emulation/qemu-x86/qemu-x86.env [new file with mode: 0644]
board/intel/bayleybay/bayleybay.env [new file with mode: 0644]
board/intel/cherryhill/cherryhill.env [new file with mode: 0644]
board/intel/cougarcanyon2/cougarcanyon2.env [new file with mode: 0644]
board/intel/crownbay/crownbay.env [new file with mode: 0644]
board/intel/edison/edison.env [new file with mode: 0644]
board/intel/galileo/galileo.env [new file with mode: 0644]
board/intel/minnowmax/minnowmax.env [new file with mode: 0644]
board/intel/slimbootloader/slimbootloader.env [new file with mode: 0644]
board/keymile/km83xx/km83xx.env
board/keymile/kmcent2/kmcent2.env
board/keymile/pg-wcom-ls102xa/pg-wcom-expu1.env
board/keymile/pg-wcom-ls102xa/pg-wcom-seli8.env
board/siemens/iot2050/iot2050.env
board/ti/am62ax/am62ax.env
board/ti/am62x/am62x.env
board/ti/am64x/am64x.env
board/ti/am65x/am65x.env
board/ti/j721e/j721e.env
board/ti/j721s2/j721s2.env
board/ti/ks2_evm/k2e_evm.env
board/ti/ks2_evm/k2g_evm.env
board/ti/ks2_evm/k2hk_evm.env
board/ti/ks2_evm/k2l_evm.env
boot/bootdev-uclass.c
common/board_f.c
common/usb_storage.c
configs/qemu-x86_64_defconfig
configs/qemu-x86_defconfig
doc/board/coreboot/coreboot.rst
doc/board/emulation/qemu-x86.rst
doc/develop/bootstd.rst
doc/usage/environment.rst
drivers/Makefile
drivers/block/ide.c
drivers/mmc/mmc-uclass.c
drivers/nvme/nvme.c
drivers/scsi/scsi.c
drivers/usb/host/usb-uclass.c
drivers/video/Kconfig
drivers/video/video-uclass.c
drivers/virtio/virtio-uclass.c
include/bootdev.h
include/configs/am335x_evm.h
include/configs/am43xx_evm.h
include/configs/am57xx_evm.h
include/configs/am62ax_evm.h
include/configs/am62x_evm.h
include/configs/am64x_evm.h
include/configs/am65x_evm.h
include/configs/bayleybay.h
include/configs/cherryhill.h
include/configs/coreboot.h
include/configs/cougarcanyon2.h
include/configs/crownbay.h
include/configs/da850evm.h
include/configs/dra7xx_evm.h
include/configs/edison.h
include/configs/efi-x86_app.h
include/configs/efi-x86_payload.h
include/configs/galileo.h
include/configs/minnowmax.h
include/configs/omap3_evm.h
include/configs/omapl138_lcdk.h
include/configs/phycore_am335x_r2.h
include/configs/qemu-x86.h
include/configs/sifive-unleashed.h
include/configs/slimbootloader.h
include/configs/ti_omap4_common.h
include/configs/ti_omap5_common.h
include/configs/x86-common.h
include/env/distro/sf.h [moved from include/environment/distro/sf.h with 100% similarity]
include/env/pg-wcom/common.env [moved from include/environment/pg-wcom/common.env with 100% similarity]
include/env/pg-wcom/ls102xa.env [moved from include/environment/pg-wcom/ls102xa.env with 95% similarity]
include/env/pg-wcom/powerpc.env [moved from include/environment/pg-wcom/powerpc.env with 100% similarity]
include/env/ti/dfu.h [moved from include/environment/ti/dfu.h with 100% similarity]
include/env/ti/k3_dfu.env [moved from include/environment/ti/k3_dfu.env with 100% similarity]
include/env/ti/k3_dfu.h [moved from include/environment/ti/k3_dfu.h with 100% similarity]
include/env/ti/k3_rproc.env [moved from include/environment/ti/k3_rproc.env with 100% similarity]
include/env/ti/k3_rproc.h [moved from include/environment/ti/k3_rproc.h with 100% similarity]
include/env/ti/mmc.env [moved from include/environment/ti/mmc.env with 100% similarity]
include/env/ti/mmc.h [moved from include/environment/ti/mmc.h with 100% similarity]
include/env/ti/nand.env [moved from include/environment/ti/nand.env with 100% similarity]
include/env/ti/nand.h [moved from include/environment/ti/nand.h with 100% similarity]
include/env/ti/ti_armv7_common.env [moved from include/environment/ti/ti_armv7_common.env with 100% similarity]
include/env/ti/ti_armv7_keystone2.env [moved from include/environment/ti/ti_armv7_keystone2.env with 100% similarity]
include/env/ti/ufs.env [moved from include/environment/ti/ufs.env with 100% similarity]
include/env/ti/ufs.h [moved from include/environment/ti/ufs.h with 100% similarity]
include/env/x86.env [new file with mode: 0644]
include/usb.h
lib/vsprintf.c

index aa329b0..f8f2f64 100644 (file)
@@ -12,7 +12,7 @@ config QEMU
        imply SYS_NS16550
        imply USB
        imply USB_EHCI_HCD
-       imply VIDEO_BOCHS
+       imply VIDEO_VESA
 
 if QEMU
 
index 595c397..1a52d1d 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/global_data.h>
 #include <asm/post.h>
 #include <asm/arch/qemu.h>
+#include <linux/sizes.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 19e54c5..ebfe595 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/e820.h>
 #include <asm/arch/qemu.h>
 #include <asm/global_data.h>
+#include <linux/sizes.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 274978c..7041455 100644 (file)
@@ -48,7 +48,7 @@ static void enable_pm_ich9(void)
        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;
diff --git a/arch/x86/include/asm/qemu.h b/arch/x86/include/asm/qemu.h
new file mode 100644 (file)
index 0000000..f1e95ff
--- /dev/null
@@ -0,0 +1,14 @@
+/* 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
index e29cae7..f146bbd 100644 (file)
@@ -204,7 +204,7 @@ static u8 vbe_get_mode_info(struct vesa_state *mi)
 
        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;
index 0f97538..a8d1db1 100644 (file)
@@ -7,6 +7,7 @@
 #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
index 1eb97ac..382f768 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/cpu.h>
 #include <asm/global_data.h>
 #include <linux/compiler.h>
+#include <linux/sizes.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -144,7 +145,7 @@ static void x86_phys_memset_page(phys_addr_t map_addr, uintptr_t offset, int c,
 
        /* 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);
index b6812bb..f99df08 100644 (file)
@@ -27,6 +27,7 @@
 #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>
 
@@ -137,7 +138,6 @@ static int x86_spl_init(void)
        }
 
 #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);
@@ -292,6 +292,8 @@ void spl_board_init(void)
 #ifndef CONFIG_TPL
        preloader_console_init();
 #endif
+       if (IS_ENABLED(CONFIG_QEMU))
+               qemu_chipset_init();
 
        if (CONFIG_IS_ENABLED(VIDEO)) {
                struct udevice *dev;
diff --git a/board/coreboot/coreboot/coreboot.env b/board/coreboot/coreboot/coreboot.env
new file mode 100644 (file)
index 0000000..0f5bb6f
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
+
+splashsource=virtio_fs
+splashimage=0x1000000
diff --git a/board/efi/efi-x86_app/efi-x86_app.env b/board/efi/efi-x86_app/efi-x86_app.env
new file mode 100644 (file)
index 0000000..106836a
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2015 Google, Inc
+ */
+
+#include <env/x86.env>
diff --git a/board/efi/efi-x86_payload/efi-x86_payload.env b/board/efi/efi-x86_payload/efi-x86_payload.env
new file mode 100644 (file)
index 0000000..6a65628
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
diff --git a/board/emulation/qemu-x86/qemu-x86.env b/board/emulation/qemu-x86/qemu-x86.env
new file mode 100644 (file)
index 0000000..adcc1c5
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
diff --git a/board/intel/bayleybay/bayleybay.env b/board/intel/bayleybay/bayleybay.env
new file mode 100644 (file)
index 0000000..89e1849
--- /dev/null
@@ -0,0 +1,9 @@
+/* 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
diff --git a/board/intel/cherryhill/cherryhill.env b/board/intel/cherryhill/cherryhill.env
new file mode 100644 (file)
index 0000000..929b6a1
--- /dev/null
@@ -0,0 +1,9 @@
+/* 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
diff --git a/board/intel/cougarcanyon2/cougarcanyon2.env b/board/intel/cougarcanyon2/cougarcanyon2.env
new file mode 100644 (file)
index 0000000..6329b0f
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
diff --git a/board/intel/crownbay/crownbay.env b/board/intel/crownbay/crownbay.env
new file mode 100644 (file)
index 0000000..9e95414
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <env/x86.env>
diff --git a/board/intel/edison/edison.env b/board/intel/edison/edison.env
new file mode 100644 (file)
index 0000000..c7d4de7
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2017 Intel Corp.
+ */
+
+/* empty environment */
diff --git a/board/intel/galileo/galileo.env b/board/intel/galileo/galileo.env
new file mode 100644 (file)
index 0000000..83e77bb
--- /dev/null
@@ -0,0 +1,11 @@
+/* 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
diff --git a/board/intel/minnowmax/minnowmax.env b/board/intel/minnowmax/minnowmax.env
new file mode 100644 (file)
index 0000000..71f3607
--- /dev/null
@@ -0,0 +1,11 @@
+/* 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
diff --git a/board/intel/slimbootloader/slimbootloader.env b/board/intel/slimbootloader/slimbootloader.env
new file mode 100644 (file)
index 0000000..3fce487
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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
index ed2487c..1f13aaa 100644 (file)
@@ -13,8 +13,8 @@ netdev=eth0
 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
index 6b676a4..efa762e 100644 (file)
@@ -1,4 +1,4 @@
-#include <environment/pg-wcom/common.env>
+#include <env/pg-wcom/common.env>
 
 EEprom_ivm=pca9547:70:9
 arch=ppc_82xx
index d960de6..1054dbf 100644 (file)
@@ -1,3 +1,3 @@
-#include <environment/pg-wcom/ls102xa.env>
+#include <env/pg-wcom/ls102xa.env>
 
 hostname=EXPU1
index 4031f8b..1232fe9 100644 (file)
@@ -1,3 +1,3 @@
-#include <environment/pg-wcom/ls102xa.env>
+#include <env/pg-wcom/ls102xa.env>
 
 hostname=SELI8
index 7fd836e..caa9f80 100644 (file)
@@ -6,7 +6,7 @@
  *   Jan Kiszka <jan.kiszka@siemens.com>
  */
 
-#include <environment/ti/ti_armv7_common.env>
+#include <env/ti/ti_armv7_common.env>
 
 usb_pgood_delay=900
 
index 491ec97..3f7c333 100644 (file)
@@ -1,5 +1,5 @@
-#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=
index bb37d21..f2dc878 100644 (file)
@@ -1,5 +1,5 @@
-#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=
index ecb0736..1567907 100644 (file)
@@ -1,6 +1,6 @@
-#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
index 036f475..755bff2 100644 (file)
@@ -1,8 +1,8 @@
-#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=
index f7a4880..2f2fb05 100644 (file)
@@ -1,10 +1,10 @@
-#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
index 2ec652d..6825b14 100644 (file)
@@ -1,10 +1,10 @@
-#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
index 746e406..a145db5 100644 (file)
@@ -1,5 +1,5 @@
-#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
index 72807ac..4f4941d 100644 (file)
@@ -1,6 +1,6 @@
-#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
index f1cdc70..0714a51 100644 (file)
@@ -1,5 +1,5 @@
-#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
index ddb5cd4..e8a803a 100644 (file)
@@ -1,5 +1,5 @@
-#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
index 3f2c8d7..fa52bc3 100644 (file)
@@ -262,7 +262,7 @@ static int bootdev_get_suffix_start(struct udevice *dev, const char *suffix)
        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];
@@ -305,7 +305,9 @@ int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp)
        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) {
@@ -335,7 +337,7 @@ static int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp)
        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");
@@ -535,6 +537,8 @@ static int default_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,
        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
@@ -660,7 +664,8 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp)
                                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);
                        }
@@ -696,6 +701,7 @@ int bootdev_setup_iter(struct bootflow_iter *iter, const char *label,
        /* 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);
        }
@@ -766,6 +772,7 @@ static int bootdev_hunt_drv(struct bootdev_hunter *info, uint seq, bool show)
                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;
                }
@@ -831,9 +838,11 @@ int bootdev_hunt_prio(enum bootdev_prio_t prio, bool show)
                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;
 }
index 7d2c380..791c1e6 100644 (file)
@@ -411,8 +411,7 @@ __weak int arch_reserve_mmu(void)
 
 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));
index ac64275..8577422 100644 (file)
@@ -246,7 +246,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
                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;
 
index 9cf38a5..c6f3067 100644 (file)
@@ -84,6 +84,10 @@ CONFIG_SPL_DM_RTC=y
 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
index 95a6ff9..24682a5 100644 (file)
@@ -5,10 +5,14 @@ CONFIG_NR_DRAM_BANKS=8
 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
@@ -16,6 +20,8 @@ CONFIG_SHOW_BOOT_PROGRESS=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
@@ -23,11 +29,13 @@ CONFIG_SYS_PBSIZE=532
 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
@@ -53,6 +61,9 @@ CONFIG_NVME_PCI=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
index 0fe95af..21801a8 100644 (file)
@@ -51,6 +51,40 @@ can be useful for running UEFI applications, for example.
 
 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
 ----------
index e7dd4e9..15f56b6 100644 (file)
@@ -113,7 +113,87 @@ sure the specified CPU supports 64-bit like '-cpu core2duo'. Conversely
 '-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.
index 7a2a69f..ec31365 100644 (file)
@@ -306,7 +306,7 @@ media device::
 
 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");
@@ -316,7 +316,7 @@ The bootdev device is typically created automatically in the media uclass'
 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);
 
index 2c44e5d..c6439dd 100644 (file)
@@ -81,6 +81,12 @@ Example::
         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.
 
@@ -94,7 +100,7 @@ to add environment variables.
 
 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
index 2e38c75..efc2a4a 100644 (file)
@@ -39,6 +39,8 @@ obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
 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
@@ -64,7 +66,6 @@ obj-$(CONFIG_SPL_USB_HOST) += usb/host/
 obj-$(CONFIG_SPL_SATA) += ata/ scsi/
 obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
-obj-$(CONFIG_SPL_VIDEO) +=video/
 
 endif
 endif
@@ -99,7 +100,6 @@ obj-y += rtc/
 obj-y += scsi/
 obj-y += sound/
 obj-y += spmi/
-obj-y += video/
 obj-y += watchdog/
 obj-$(CONFIG_QE) += qe/
 obj-$(CONFIG_U_QE) += qe/
index 89201dd..c698f9c 100644 (file)
@@ -1059,9 +1059,9 @@ static int ide_probe(struct udevice *udev)
                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;
index 01d9b02..0e15767 100644 (file)
@@ -421,7 +421,7 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg)
        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);
 
index a7add66..20dc910 100644 (file)
@@ -910,7 +910,7 @@ int nvme_init(struct udevice *udev)
                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);
 
index 6caeb3f..0a3420b 100644 (file)
@@ -607,7 +607,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)
                /* 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);
 
index 02c0138..7a03435 100644 (file)
@@ -346,7 +346,7 @@ int usb_init(void)
        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)
index e32ce13..2a37d02 100644 (file)
@@ -1011,6 +1011,16 @@ config SPL_VIDEO
 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
index 8f268fc..f743ed7 100644 (file)
@@ -141,7 +141,7 @@ int video_reserve(ulong *addrp)
        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);
index f2b3ef1..c542016 100644 (file)
@@ -248,7 +248,7 @@ static int virtio_uclass_post_probe(struct udevice *udev)
        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);
        }
index 1533adf..8482331 100644 (file)
@@ -371,7 +371,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp);
 /**
  * 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
@@ -386,7 +386,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp);
 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
@@ -398,7 +398,7 @@ int bootdev_setup_for_dev(struct udevice *parent, const char *drv_name);
  * @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
@@ -428,8 +428,8 @@ static inline int bootdev_setup_for_dev(struct udevice *parent,
        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;
 }
index 5b47778..504b1f0 100644 (file)
@@ -76,7 +76,7 @@
 #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 \
index a2f73c4..7ee7b7e 100644 (file)
@@ -64,7 +64,7 @@
 #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 \
index ba91f2b..06edde6 100644 (file)
@@ -11,7 +11,7 @@
 #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 */
index 3997ce5..57003f1 100644 (file)
@@ -9,8 +9,8 @@
 #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
index 6b2a6ee..44180dc 100644 (file)
@@ -10,7 +10,7 @@
 #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
index 1e37ab4..062102a 100644 (file)
@@ -11,9 +11,9 @@
 
 #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
index 2fa658d..9e90239 100644 (file)
@@ -10,9 +10,9 @@
 #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
index b0df328..9b0f5ce 100644 (file)
@@ -2,20 +2,3 @@
 /*
  * 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 */
index d6ce70a..a300957 100644 (file)
@@ -2,16 +2,3 @@
 /*
  * 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 */
index b4f49bf..e00c408 100644 (file)
@@ -2,23 +2,3 @@
 /*
  * 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 */
index 31639e4..0406786 100644 (file)
@@ -2,16 +2,3 @@
 /*
  * 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 */
index 387bb88..0c842dd 100644 (file)
@@ -2,20 +2,3 @@
 /*
  * 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 */
index 736af88..cef4042 100644 (file)
        "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 \
index ef1d5a1..633ec1f 100644 (file)
@@ -11,7 +11,7 @@
 #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
 
index 455a889..127c2c4 100644 (file)
@@ -2,14 +2,3 @@
 /*
  * 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
index 843ed8b..d582404 100644 (file)
@@ -2,14 +2,3 @@
 /*
  * 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
index c72b067..e00c408 100644 (file)
@@ -2,20 +2,3 @@
 /*
  * 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 */
index 0380ac2..9b0f5ce 100644 (file)
@@ -2,22 +2,3 @@
 /*
  * 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 */
index 842672d..068a2af 100644 (file)
@@ -2,19 +2,3 @@
 /*
  * 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 */
index adb25a6..f449677 100644 (file)
@@ -67,7 +67,7 @@
 
 #include <config_distro_bootcmd.h>
 
-#include <environment/ti/mmc.h>
+#include <env/ti/mmc.h>
 
 #define CFG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
index af00935..fc2655a 100644 (file)
        "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 \
index 4e6dc79..8668da6 100644 (file)
@@ -59,8 +59,8 @@
        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 \
index 3e52352..9b0f5ce 100644 (file)
@@ -2,26 +2,3 @@
 /*
  * 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 */
index f208f5e..2996b37 100644 (file)
@@ -26,7 +26,7 @@
        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"
index 20b99a1..85f6a96 100644 (file)
@@ -2,38 +2,3 @@
 /*
  * 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__ */
index 9e312ac..c4f116a 100644 (file)
@@ -56,7 +56,7 @@
        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 \
index 74a39c4..4e5aa74 100644 (file)
@@ -39,8 +39,8 @@
 #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"
index c1c5a09..8bd0716 100644 (file)
@@ -5,22 +5,10 @@
  * 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"                             \
similarity index 95%
rename from include/environment/pg-wcom/ls102xa.env
rename to include/env/pg-wcom/ls102xa.env
index 5b5bda9..abbec42 100644 (file)
@@ -1,6 +1,6 @@
 #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
diff --git a/include/env/x86.env b/include/env/x86.env
new file mode 100644 (file)
index 0000000..d00d98f
--- /dev/null
@@ -0,0 +1,20 @@
+/* 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
index 42b001c..09e3f0c 100644 (file)
@@ -257,7 +257,14 @@ int usb_kbd_deregister(int force);
 
 #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 */
 
index e87503e..e14c6ca 100644 (file)
@@ -680,8 +680,10 @@ repeat:
                        break;
 
                case 'd':
-                       if (fmt[1] == 'E')
+                       if (fmt[1] == 'E') {
                                flags |= ERRSTR;
+                               fmt++;
+                       }
                /* fallthrough */
                case 'i':
                        flags |= SIGN;
@@ -725,7 +727,6 @@ repeat:
                        ADDCH(str, ' ');
                        for (p = errno_str(num); *p; p++)
                                ADDCH(str, *p);
-                       fmt++;
                }
        }