diff --git a/stand/efi/loader/autoload.c b/stand/efi/loader/autoload.c index 6225980a5a4e..d409285834c3 100644 --- a/stand/efi/loader/autoload.c +++ b/stand/efi/loader/autoload.c @@ -50,7 +50,8 @@ efi_autoload(void) * imply that we're on a platform where FDT is a requirement. If we * fix this, then the error handling here should be fixed accordingly. */ - fdt_setup_fdtp(); + if (fdt_is_setup() == 0) + fdt_setup_fdtp(); #endif return (0); } diff --git a/stand/fdt/fdt_loader_cmd.c b/stand/fdt/fdt_loader_cmd.c index 87b587275bc2..ef6e59be6aff 100644 --- a/stand/fdt/fdt_loader_cmd.c +++ b/stand/fdt/fdt_loader_cmd.c @@ -509,6 +509,16 @@ fdt_apply_overlays() free(overlay); } +int +fdt_is_setup(void) +{ + + if (fdtp != NULL) + return (1); + + return (0); +} + int fdt_setup_fdtp() { diff --git a/stand/fdt/fdt_platform.h b/stand/fdt/fdt_platform.h index 0528dd0f033e..bbc2fe0549cc 100644 --- a/stand/fdt/fdt_platform.h +++ b/stand/fdt/fdt_platform.h @@ -48,6 +48,7 @@ int fdt_load_dtb_addr(struct fdt_header *); int fdt_load_dtb_file(const char *); void fdt_load_dtb_overlays(const char *); int fdt_setup_fdtp(void); +int fdt_is_setup(void); /* The platform library needs to implement these functions */ int fdt_platform_load_dtb(void);