Index: stand/efi/loader/autoload.c =================================================================== --- stand/efi/loader/autoload.c +++ stand/efi/loader/autoload.c @@ -27,11 +27,29 @@ #include __FBSDID("$FreeBSD$"); +#if defined(LOADER_FDT_SUPPORT) +#include +#include +#endif + #include "loader_efi.h" int efi_autoload(void) { +#if defined(LOADER_FDT_SUPPORT) + int err; + /* + * Setup the FDT early, so that we're not scrambling to get this done + * as we're preparing for entry into the kernel. This takes care of a + * lot of file loading that might get done in the process, and reduces + * the chances of things going wrong. + */ + if ((err = fdt_setup_fdtp()) != 0) { + printf("No valid device tree blob found!\n"); + return (err); + } +#endif return (0); }