Jonas Karlman <[email protected]> schrieb am Do., 14. Nov. 2024, 21:26:
> Hi Heinrich, > > On 2024-11-13 20:55, Heinrich Schuchardt wrote: > > Some hard devices need specific routines to scan for block devices, > > e.g. NVMe (nvme scan), SCSI (scsi start). > > > > Invoke bootdev_hunt() to find all block devices. > > > > Signed-off-by: Heinrich Schuchardt <[email protected]> > > --- > > lib/efi_loader/efi_setup.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c > > index aa59bc7779d..8e0ff16f3eb 100644 > > --- a/lib/efi_loader/efi_setup.c > > +++ b/lib/efi_loader/efi_setup.c > > @@ -7,6 +7,7 @@ > > > > #define LOG_CATEGORY LOGC_EFI > > > > +#include <bootdev.h> > > #include <efi_loader.h> > > #include <efi_variable.h> > > #include <log.h> > > @@ -228,6 +229,13 @@ efi_status_t efi_init_obj_list(void) > > * Probe block devices to find the ESP. > > * efi_disks_register() must be called before efi_init_variables(). > > */ > > + if (CONFIG_IS_ENABLED(BOOTSTD)) { > > + int r; > > + > > + r = bootdev_hunt(NULL, 0); > > + if (r) > > + log_debug("No boot device available\n"); > > + } > > ret = efi_disks_register(); > > if (ret != EFI_SUCCESS) > > goto out; > > This is causing significant slower boot when trying to boot using > extlinux (or script) from mmc device on Rockchip, this will cause all > slow devices to be initialized before a quick mmc boot, e.g. pci init, > usb start and dhcp due to efi_mgr being the global bootmeth. > Specifically DHCP is very slow and not needed here. Maybe Simon has an idea how to filter it out. We should filter on UCLASS_BLK related here. Furthermore I don't know if global bootmeths are always have to run first or if you could customize this. Best regards Heinrich > With this patch applied: > > U-Boot 2025.01-rc2 (Nov 14 2024 - 20:09:17 +0000) > > Model: Radxa ROCK 3B > SoC: RK3568J > DRAM: 8 GiB (effective 7.7 GiB) > PMIC: RK809 (on=0x40, off=0x00) > Core: 341 devices, 33 uclasses, devicetree: separate > MMC: mmc@fe000000: 2, mmc@fe2b0000: 1, mmc@fe310000: 0 > Loading Environment from nowhere... OK > In: serial@fe660000 > Out: serial@fe660000 > Err: serial@fe660000 > Net: eth1: ethernet@fe010000, eth0: ethernet@fe2a0000 > 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': > pcie_dw_rockchip pcie@fe260000: PCIe-0 Link Fail > pcie_dw_rockchip pcie@fe280000: PCIe-1 Link Fail > ethernet@fe2a0000 Waiting for PHY auto negotiation to complete......... > TIMEOUT ! > phy_startup() failed: -110 > FAILED: -110 > ethernet@fe010000 Waiting for PHY auto negotiation to complete......... > TIMEOUT ! > phy_startup() failed: -110 > FAILED: -110 > BOOTP broadcast 1 > BOOTP broadcast 2 > BOOTP broadcast 3 > BOOTP broadcast 4 > BOOTP broadcast 5 > BOOTP broadcast 6 > BOOTP broadcast 7 > BOOTP broadcast 8 > BOOTP broadcast 9 > BOOTP broadcast 10 > BOOTP broadcast 11 > BOOTP broadcast 12 > BOOTP broadcast 13 > BOOTP broadcast 14 > BOOTP broadcast 15 > BOOTP broadcast 16 > BOOTP broadcast 17 > > Retry time exceeded; starting again > pcie_dw_rockchip pcie@fe260000: PCIe-0 Link Fail > pcie_dw_rockchip pcie@fe280000: PCIe-1 Link Fail > pcie_dw_rockchip pcie@fe260000: PCIe-0 Link Fail > pcie_dw_rockchip pcie@fe280000: PCIe-1 Link Fail > scanning bus for devices... > Bus usb@fd000000: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.10 > Bus usb@fd800000: USB EHCI 1.00 > scanning bus usb@fd000000 for devices... 1 USB Device(s) found > scanning bus usb@fd800000 for devices... 2 USB Device(s) found > No boot device available > Card did not respond to voltage select! : -110 > Cannot persist EFI variables without system partition > 0 efi_mgr ready (none) 0 <NULL> > ** Booting bootflow '<NULL>' with efi_mgr > Loading Boot0000 'mmc 1' failed > Loading Boot0001 'mmc 0' failed > EFI boot manager: Cannot load any image > Boot failed (err=-14) > Scanning bootdev '[email protected]': > 1 extlinux ready mmc 1 [email protected] > /extlinux/extlinux.conf > ** Booting bootflow '[email protected]_1' with extlinux > 1: linux > Retrieving file: /Image.gz > Retrieving file: /initramfs.cpio.gz > Uncompressing Kernel Image to 0 > ## Flattened Device Tree blob at eded3690 > Booting using the fdt blob at 0xeded3690 > Working FDT set to eded3690 > Loading Ramdisk to ecb0d000, end ecea1d3c ... OK > Loading Device Tree to 00000000ecaf5000, end 00000000ecb0c6d7 ... OK > Working FDT set to ecaf5000 > > Starting kernel ... > > I guess we can always disable efi_mgr on Rockchip, similar to sunxi, to > restore pre stdboot behavior. > > Regards, > Jonas > >

