If I understand your question correctly, you want to modify the boot targets (either change the order in which the bootloader will look into targets or remove some of them) in the uboot environment. Is that the case? Do you have a specific reason why you want to remove USB, ethernet and MMC1 from the targets list?
Here we have instructions for how to build a custom Uboot from sources and deploy it: https://developer.toradex.com/linux-bsp/os-development/build-u-boot-and-linux-kernel-from-source-code/build-u-boot/#downstream
This is what I would recommend to try first: Build your uboot, deploy and test it before you add the patches into your Yocto build for the image.
Now regarding the file you need to modify to change the order of boot targets:
Currently, we have an include file per device. In there you can specify the U-Boot environment and also the boot devices. Here for example the verdin-imx8mp:
https://git.toradex.com/cgit/u-boot-toradex.git/tree/include/configs/verdin-imx8mp.h?h=toradex_imx_lf_v2024.04
The macro BOOT_TARGET_DEVICES
will then create the boot target list. If you want to add for example USB as first boot source, you could do something like this:
diff --git a/include/configs/verdin-imx8mp.h b/include/configs/verdin-imx8mp.h
index bff417fdafb..80b4055cd97 100644
--- a/include/configs/verdin-imx8mp.h
+++ b/include/configs/verdin-imx8mp.h
@@ -30,6 +30,7 @@
/* Enable Distro Boot */
#define BOOT_TARGET_DEVICES(func) \
+ func(USB, usb, 0) \
func(MMC, mmc, 1) \
func(MMC, mmc, 2) \
func(DHCP, dhcp, na)
This patch can then be added in your custom meta layer (meta-custom/recipes-bsp/u-boot
) with a SRC_URI;append
.